Code

Code cleanup- Removed unused checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 10:45:29 +0000 (10:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 10:45:29 +0000 (10:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12827 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_userinfo.inc

index 327cb3b1be947e8bd0169bd1d9f3dc914a15d32f..e5ba9c7365cda1dbabc40bcd1f7557984260f1ea 100644 (file)
@@ -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) ; 
   }