Code

Updated copy & paste
[gosa.git] / gosa-core / include / class_userinfo.inc
index 336923ac5c4b7f948779c21f6f39aa259f4b981a..c1c49ac40ddbb516ffd1e4960795dfe68ff8d0a4 100644 (file)
@@ -93,6 +93,7 @@ class userinfo
   function loadACL()
   {
     $this->ACL= array();    
+    $this->allACLs= array();    
     $this->groups= array();    
     $this->result_cache =array();
     $this->reset_acl_cache();
@@ -180,6 +181,7 @@ class userinfo
             if (preg_match('/^G:\*/',  $grp)){
               $interresting= TRUE;
             }
+            $this->allACLs[$dn][$idx]= $type;
           }
         }
 
@@ -189,7 +191,6 @@ class userinfo
           }
           $this->ACL[$dn][$idx]= $type;
         }
-        $this->allACLs[$dn][$idx]= $type;
       }
     }
 
@@ -447,12 +448,6 @@ class userinfo
         /* Inspect this ACL, place the result into ACL */
         foreach ($ACL[$cpath] as $subacl){
 
-          /* Reset? Just clean the ACL and turn over to the next one... */
-          if ($subacl['type'] == 'reset'){
-            $acl= $this->cleanACL($acl, TRUE);
-            continue;
-          }
-
           if($subacl['type'] == "role") {
             echo "role skipped";
             continue;
@@ -469,6 +464,12 @@ class userinfo
             }
           }
 
+          /* Reset? Just clean the ACL and turn over to the next one... */
+          if ($subacl['type'] == 'reset'){
+            $acl= $this->cleanACL($acl, TRUE);
+            continue;
+          }
+
           /* Self ACLs? 
            */
           if($dn != $this->dn && isset($subacl['acl'][$object][0]) && (strpos($subacl['acl'][$object][0],"s") !== FALSE)){
@@ -516,7 +517,10 @@ class userinfo
                 foreach($this->ocMapping[$ocs] as $oc){
                   if (isset($subacl['acl'][$ocs.'/'.$oc])){
 
-                    if($dn != $this->dn && strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue;
+                      // Skip ACLs wich are defined for ourselfs only - if not checking against ($ui->dn)
+                      if(isset($subacl['acl'][$ocs.'/'.$oc][0]) && 
+                              $dn != $this->dn && 
+                              strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue;
 
                     foreach($subacl['acl'][$ocs.'/'.$oc] as $attr => $dummy){
                       $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][$attr]);