From 996f686d299140d4610aabb661c89d1cc7aa65e1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 3 Nov 2005 06:36:23 +0000 Subject: [PATCH] removed soacl, as it contained only calls to the acl-class of the API, which are ok in BO --- resources/inc/class.bo_acl.inc.php | 20 ++++++++----------- resources/inc/class.so_acl.inc.php | 31 ------------------------------ 2 files changed, 8 insertions(+), 43 deletions(-) delete mode 100755 resources/inc/class.so_acl.inc.php diff --git a/resources/inc/class.bo_acl.inc.php b/resources/inc/class.bo_acl.inc.php index 580bad3f07..ee6e43d6e7 100755 --- a/resources/inc/class.bo_acl.inc.php +++ b/resources/inc/class.bo_acl.inc.php @@ -36,9 +36,8 @@ define('EGW_ACL_DIRECT_BOOKING',128); define('EGW_ACL_CALREAD',256); - $this->so =& CreateObject('resources.so_acl'); - $this->permissions = $this->so->get_permissions($GLOBALS['egw_info']['user']['account_id'],true); - $this->egw_cats = createobject('phpgwapi.categories','','resources'); + $this->permissions = $GLOBALS['egw']->acl->get_all_location_rights($GLOBALS['egw_info']['user']['account_id'],'resources',true); + $this->egw_cats =& CreateObject('phpgwapi.categories','','resources'); $this->accounts = $GLOBALS['egw']->accounts->get_list(); $this->debug = False; @@ -66,7 +65,7 @@ /** * get list of cats where current user has given rights * - * @author Cornelius Wei� + * @author Cornelius Weiss * @param int $perm_type one of EGW_ACL_READ, EGW_ACL_ADD, EGW_ACL_EDIT, EGW_ACL_DELETE, EGW_ACL_DIRECT_BOOKING * @return array cat_id => cat_name * TODO mark subcats and so on! @@ -101,20 +100,19 @@ /** * gets name of category * - * @author Lukas Wei� + * @author Lukas Weiss * @param int $cat_id * @return mixed name of category */ function get_cat_name($cat_id) { - $cat = $this->egw_cats->return_single($cat_id); - return $cat[0]['name']; + return $this->egw_cats->id2name($cat_id); } /** * gets userid of admin for given category * - * @author Cornelius Wei� + * @author Cornelius Weiss * @param int $cat_id * @return int userid of cat admin */ @@ -153,7 +151,7 @@ */ function get_rights($cat_id) { - return $this->so->get_rights('L'.$cat_id); + return $GLOBALS['egw']->acl->get_all_rights('L'.$cat_id,'resources'); } @@ -191,9 +189,7 @@ $calbookcat = $calbook ? $calbook : array(); $admincat = $admin ? $admin : array(); - $this->so->remove_location('L' . $cat_id); -// reset($this->accounts); -// while (list($null,$account) = each($this->accounts)) + $GLOBALS['egw']->acl->delete_repository('resources','L' . $cat_id,false); foreach($this->accounts as $num => $account) { diff --git a/resources/inc/class.so_acl.inc.php b/resources/inc/class.so_acl.inc.php deleted file mode 100755 index 246656f9b2..0000000000 --- a/resources/inc/class.so_acl.inc.php +++ /dev/null @@ -1,31 +0,0 @@ -acl->get_all_rights($location,'news_admin'); - } - - function remove_location($location) - { - $GLOBALS['egw']->acl->delete_repository('news_admin',$location,false); - } - - function get_permissions($user, $inc_groups) - { - return $GLOBALS['egw']->acl->get_all_location_rights($user,'sitemgr',$inc_groups); - } - }