Code

Fixed errors with departments in reference tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 07:32:34 +0000 (07:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 07:32:34 +0000 (07:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5185 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/generic/references/class_reference.inc

index fe047ba3af2aca222a9ac16e804c4e3f9176b070..bc2c1e5aec7f0a4b532d4d4fa1afc2fbdd641db3 100644 (file)
@@ -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 {