From: hickert Date: Wed, 22 Nov 2006 07:32:34 +0000 (+0000) Subject: Fixed errors with departments in reference tabs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1686595460029cbd08df4e20d75cad86adeaf0b4;p=gosa.git Fixed errors with departments in reference tabs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5185 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/generic/references/class_reference.inc b/plugins/generic/references/class_reference.inc index fe047ba3a..bc2c1e5ae 100644 --- a/plugins/generic/references/class_reference.inc +++ b/plugins/generic/references/class_reference.inc @@ -137,12 +137,17 @@ class reference extends plugin if (!isset($this->objectCache[$dn])){ $ldap= $this->config->get_ldap_link(); if (preg_match('/,/', $dn)){ - $ldap->cat($dn, array("cn", "objectClass", "description")); + $ldap->cat($dn, array("cn", "objectClass", "description","ou")); } else { - $ldap->search("(uid=$dn)", array("cn", "objectClass", "description")); + $ldap->search("(uid=$dn)", array("cn", "objectClass", "description","ou")); } if ($ldap->count()){ $attrs= $ldap->fetch(); + + if(isset($attrs['ou']) && !isset($attrs['cn'])){ + $attrs['cn'] = $attrs['ou']; + } + if (isset($attrs['description'])){ $description= $attrs['description'][0]; } else {