Code

Updated class userinfo.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 09:00:44 +0000 (09:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 09:00:44 +0000 (09:00 +0000)
- Do not check "ignoreACL" config attribute on each ACL request.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12822 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_userinfo.inc

index 7ba77834a63a69d9e68c50027b0f85fdb5eb5651..a54892f507c0184afd735ecb19b37a0508598e82 100644 (file)
@@ -36,6 +36,7 @@ class userinfo
   var $ocMapping= array();
   var $groups= array();
   var $result_cache =array();
+  var $ignoreACl = FALSE;
 
   /* get acl's an put them into the userinfo object
      attr subtreeACL (userdn:components, userdn:component1#sub1#sub2,component2,...) */
@@ -67,6 +68,8 @@ class userinfo
     $this->uid= $attrs['uid'][0];
     $this->ip= $_SERVER['REMOTE_ADDR'];
 
+    $this->ignoreACL = ($this->config->get_cfg_value("ignoreAcl") == $this->dn);
+
     /* Initialize ACL_CACHE */
     session::set('ACL_CACHE',array());
     $this->reset_acl_cache();
@@ -350,7 +353,10 @@ class userinfo
 
           /* With user filter */
           if (isset($subacl['filter']) && !empty($subacl['filter'])){
-            if(!$ldap->object_match_filter($dn,$subacl['filter'])){
+            $id = $dn."-".$subacl['filter'];
+            if(!isset($ACL_CACHE[$id])){
+              $ACL_CACHE[$id] = $ldap->object_match_filter($dn,$subacl['filter']);
+            }elseif(!$ACL_CACHE[$id]){
               continue;
             }
           }
@@ -599,7 +605,7 @@ class userinfo
    */ 
   function ignore_acl_for_current_user()
   {
-    return($this->config->get_cfg_value("ignoreAcl") == $this->dn);
+    return($this->ignoreACL);
   }
 
 }