From: hickert Date: Thu, 30 Oct 2008 10:45:29 +0000 (+0000) Subject: Code cleanup- Removed unused checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6381009eee8c0717c482d8f30edfff6bf3acd774;p=gosa.git Code cleanup- Removed unused checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12827 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 327cb3b1b..e5ba9c736 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -182,12 +182,6 @@ class userinfo function get_category_permissions($dn, $category, $any_acl = FALSE) { - $ACL_CACHE = &session::get("ACL_CACHE"); - $id = $dn."+".$category."+".$any_acl; - if(isset($ACL_CACHE['CATEGORY_ACL'][$id])){ - return($ACL_CACHE['CATEGORY_ACL'][$id]); - } - /* If we are forced to skip ACLs checks for the current user then return all permissions. */ @@ -195,6 +189,13 @@ class userinfo return("rwcdm"); } + $ACL_CACHE = &session::get("ACL_CACHE"); + $id = $dn."+".$category."+".$any_acl; + if(isset($ACL_CACHE['CATEGORY_ACL'][$id])){ + return($ACL_CACHE['CATEGORY_ACL'][$id]); + } + + /* Get list of objectClasses and get the permissions for it */ $acl= ""; if (isset($this->ocMapping[$category])){ @@ -261,12 +262,10 @@ class userinfo if(!is_array($object)){ $object = array($object); } - $r = $w = $c = TRUE; + $r = $w = TRUE; foreach($object as $category){ $w &= preg_match("/w/",$this->has_complete_category_acls($dn, $category)); - $c &= preg_match("/c/",$this->has_complete_category_acls($dn, $category)); $r &= preg_match("/r/",$this->has_complete_category_acls($dn, $category)); -# print_a(array($category => array($r.$w.$c))); } return($r && $w ); } @@ -282,12 +281,9 @@ class userinfo if(!is_array($object)){ $object = array($object); } - $r = $w = $c = TRUE; + $r = TRUE; foreach($object as $category){ - $w &= preg_match("/w/",$this->has_complete_category_acls($dn, $category)); - $c &= preg_match("/c/",$this->has_complete_category_acls($dn, $category)); $r &= preg_match("/r/",$this->has_complete_category_acls($dn, $category)); -# print_a(array($category => array($r.$w.$c))); } return($r) ; }