Code

Fixed acl management base handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 May 2007 07:15:13 +0000 (07:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 May 2007 07:15:13 +0000 (07:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6241 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/acl/class_aclManagement.inc
plugins/admin/acl/class_divListACL.inc

index d5ed8084793dc8fabc99736061964d7dbd89a249..8b3ccd1c21b62073455268625aa466a9503a6c82 100644 (file)
@@ -496,12 +496,17 @@ class aclManagement extends plugin
           }
         }else{
           $ldap->cat($fetch_base,$Attrs);
-          if($ldap->count())          {
-            $attrs = $ldap->fetch();
+          $attrs = $ldap->fetch();
+          if($attrs && isset($attrs['gosaAclEntry'])){
             $re2 = preg_replace("/\*/",".*",$Regex);
-            if( (isset($attrs['cn'][0]) && preg_match("/".$re2."/i",$attrs['cn'][0]))
-               |(isset($attrs['ou'][0]) && preg_match("/".$re2."/i",$attrs['ou'][0]))){
 
+            if(!isset($attrs['ou']) && !isset($attrs['cn'])){
+              $namingAttr= preg_replace("/^[^=]*+=([^,]*),.*$/","\\1",$fetch_base);
+              if(preg_match("/".$re2."/i",$namingAttr)){
+                $res[] = $attrs;
+              }
+            }elseif( (isset($attrs['cn'][0]) && preg_match("/".$re2."/i",$attrs['cn'][0]))
+               ||(isset($attrs['ou'][0]) && preg_match("/".$re2."/i",$attrs['ou'][0]))){
               $res[] = $attrs;
             }
           }
index c44cdcdd2ca1d98a1dbc3d1f4294824cfdbd1c62..3324d970f26ce59e1a9845ac2203d32ea3bc4576 100644 (file)
@@ -96,6 +96,7 @@ class divListACL extends MultiSelectWindow
   
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";