Code

Added additional acl filter condition.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 May 2008 05:52:19 +0000 (05:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 May 2008 05:52:19 +0000 (05:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10993 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_acl.inc
gosa-core/include/class_userinfo.inc

index faeac26983282bd7c980f961ce8ed8cc7e0deed6..c1f24d70728120bf8772753030b8a5f1bd6dbe2d 100644 (file)
@@ -326,12 +326,17 @@ class acl extends plugin
     if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){
 
       foreach ($this->ocMapping[$this->aclObject] as $oc){
-        unset($this->aclContents[$oc]);
-        unset($this->aclContents[$this->aclObject.'/'.$oc]);
-        if (isset($new_acl[$oc])){
+
+        if(isset($this->aclContents[$oc]) && is_array($this->aclContents)){
+          unset($this->aclContents[$oc]);
+          unset($this->aclContents[$this->aclObject.'/'.$oc]);
+        }else{
+#          trigger_error("Huhm?");
+        }
+        if (isset($new_acl[$oc]) && is_array($new_acl)){
           $this->aclContents[$oc]= $new_acl[$oc];
         }
-        if (isset($new_acl[$this->aclObject.'/'.$oc])){
+        if (isset($new_acl[$this->aclObject.'/'.$oc]) && is_array($new_acl)){
           $this->aclContents[$this->aclObject.'/'.$oc]= $new_acl[$this->aclObject.'/'.$oc];
         }
       }
index 013fa048f32fd08578e843fe25633edf0f0aa54d..a2e5eb63239b1c459351ccff254ad60d7c4eb3ca 100644 (file)
@@ -259,31 +259,28 @@ class userinfo
             continue;
           }
 
-#         /* With user filter */
-#         $sdn = preg_replace("/^[^,]*+,/","",$dn);
-#         if (isset($subacl['filter']) && !empty($subacl['filter'])){
-#
-#           $ldap->cd($sdn);
-#           $ldap->ls($subacl['filter'],$sdn);
-#           if(!$ldap->count()){
-#             continue;
-#           }else{
-#             $found = FALSE; 
-#             while($attrs = $ldap->fetch()){
-#               echo $attrs['dn']."<br>";
-#               if($attrs['dn'] == $dn){
-#                 $found = TRUE;
-#                 echo $acl."<br>";;
-#                 break;
-#               }
-#             }
-#             if(!$found){
-#               continue;
-#             }
-#           }
-#         }
-
-         /* Per attribute ACL? */
+         /* With user filter */
+         if (isset($subacl['filter']) && !empty($subacl['filter'])){
+           $sdn = preg_replace("/^[^,]*+,/","",$dn);
+           $ldap->cd($sdn);
+           $ldap->ls($subacl['filter'],$sdn);
+           if(!$ldap->count()){
+             continue;
+           }else{
+             $found = FALSE; 
+             while($attrs = $ldap->fetch()){
+               if($attrs['dn'] == $dn){
+                 $found = TRUE;
+                 break;
+               }
+             }
+             if(!$found){
+               continue;
+             }
+           }
+         }
+
+          /* Per attribute ACL? */
           if (isset($subacl['acl'][$object][$attribute])){
             $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attribute]);
             continue;