Code

Updated class_acl.inc
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Aug 2009 07:00:52 +0000 (07:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Aug 2009 07:00:52 +0000 (07:00 +0000)
- Allow objects without 'cn' to be listed correctly, we just need 'uid' and 'dn' to create Acls.
- There may be gosaAccounts without cn... or not?

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

gosa-core/include/class_acl.inc

index 63a4a24025bae253bd01c1ceeca8341d56021165..b2e18704cef64ee0092b6ee25624915e8cc601d6 100644 (file)
@@ -87,7 +87,14 @@ class acl extends plugin
       $ldap->search('(&(objectClass=gosaAccount)(gosaUnitTag='.$tag.'))', array('uid', 'cn'));
     }
     while ($attrs= $ldap->fetch()){
-      $this->users['U:'.$attrs['dn']]= $attrs['cn'][0].' ['.$attrs['uid'][0].']';
+
+      // Allow objects without cn to be listed without causing an error.
+      if(!isset($attrs['cn'][0])){
+        $this->users['U:'.$attrs['dn']]=  $attrs['uid'][0];
+      }else{
+        $this->users['U:'.$attrs['dn']]= $attrs['cn'][0].' ['.$attrs['uid'][0].']';
+      }
+
     }
     ksort($this->users);