From 28b41056e3ea962dce1ad017a3c0a60252195e7a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 27 May 2009 15:07:27 -0700 Subject: Restructure things so that the application is now just another module. Kohana makes this type of transition fairly straightforward in that all controllers/helpers/etc are still located in the cascading filesystem without any extra effort, except that I've temporarily added a hack to force modules/gallery into the module path. Rename what's left of "core" to be "application" so that it conforms more closely to the Kohana standard (basically, just application/config/config.php which is the minimal thing that you need in the application directory) There's still considerable work left to be done here. --- core/controllers/permissions.php | 80 ---------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 core/controllers/permissions.php (limited to 'core/controllers/permissions.php') diff --git a/core/controllers/permissions.php b/core/controllers/permissions.php deleted file mode 100644 index b0cee303..00000000 --- a/core/controllers/permissions.php +++ /dev/null @@ -1,80 +0,0 @@ -is_album()) { - access::forbidden(); - } - - $view = new View("permissions_browse.html"); - $view->htaccess_works = access::htaccess_works(); - $view->item = $item; - $view->parents = $item->parents(); - $view->form = $this->_get_form($item); - - print $view; - } - - function form($id) { - $item = ORM::factory("item", $id); - access::required("edit", $item); - - if (!$item->is_album()) { - access::forbidden(); - } - - print $this->_get_form($item); - } - - function change($command, $group_id, $perm_id, $item_id) { - access::verify_csrf(); - $group = ORM::factory("group", $group_id); - $perm = ORM::factory("permission", $perm_id); - $item = ORM::factory("item", $item_id); - access::required("edit", $item); - - if ($group->loaded && $perm->loaded && $item->loaded) { - switch($command) { - case "allow": - access::allow($group, $perm->name, $item); - break; - - case "deny": - access::deny($group, $perm->name, $item); - break; - - case "reset": - access::reset($group, $perm->name, $item); - break; - } - } - } - - function _get_form($item) { - $view = new View("permissions_form.html"); - $view->item = $item; - $view->groups = ORM::factory("group")->find_all(); - $view->permissions = ORM::factory("permission")->find_all(); - return $view; - } -} -- cgit v1.2.3