From 7db39a804ab721db300683f505c87b9c2b8808a5 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 21 Aug 2009 07:00:52 +0000 Subject: [PATCH] Updated class_acl.inc - 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index 63a4a2402..b2e18704c 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -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); -- 2.30.2