Code

Updated pathNavigator
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 10:03:05 +0000 (10:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 10:03:05 +0000 (10:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16738 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_pathNavigator.inc

index 520f03d75f69c16a75815cfa09dcd24ea76351e0..1fe3908b5408d893c99baccf40de7ecceb898392 100644 (file)
@@ -30,12 +30,17 @@ class pathNavigator
         if(!session::is_set("pathNavigator::registerPlugin:{$class->dn}")){
           global $config;
           $ldap = $config->get_ldap_link();
-          $ldap->cat($class->dn, array('cn'));
-          if($ldap->count()){
-            $attrs = $ldap->fetch();
-            $str = $attrs['cn'][0];
+
+          if(!empty($class->dn)){
+            $namingAttr = preg_replace("/^([^=]*)=.*$/","\\1",$class->dn);
+
+            $ldap->cat($class->dn, array($namingAttr));
+            if($ldap->count()){
+              $attrs = $ldap->fetch();
+              $str = $attrs[$namingAttr][0];
+            }
+            session::set("pathNavigator::registerPlugin:{$class->dn}", $str);
           }
-          session::set("pathNavigator::registerPlugin:{$class->dn}", $str);
         }
         $str = session::get("pathNavigator::registerPlugin:{$class->dn}");
         if(empty($title)){