From 1686595460029cbd08df4e20d75cad86adeaf0b4 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Nov 2006 07:32:34 +0000 Subject: [PATCH] Fixed errors with departments in reference tabs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5185 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/generic/references/class_reference.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 { -- 2.30.2