Code

Fixed getBranches to show all branches, not only those in our subtree
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 09:11:51 +0000 (09:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 09:11:51 +0000 (09:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3603 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiSummaryTab.inc

index 0db08e8660fcb20403e9dbc768eece4f294fd86e..7d926bd3f4980c2553d41822c882bf5735a29cbf 100644 (file)
@@ -80,7 +80,9 @@ class faiSummaryTab extends plugin{
       if(isset($this->parent->by_object['workgeneric']->cn)){
         $this->Classes[] = $this->parent->by_object['workgeneric']->cn;
       }
-  
+      print_a($tmp);
+   
       $tmp = array_flip($tmp);
       if(!isset($tmp[$this->Release])) {
         $this->Release = "";
@@ -148,15 +150,12 @@ class faiSummaryTab extends plugin{
     $ret = array("main"=>"/");
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    if(!$base){
-      $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
-    }
-    $ldap->cd($base);
-    $ldap->ls("(objectClass=FAIbranch)",$base);
+    $ldap->search("(objectClass=FAIbranch)",array("dn","cn","ou"));
     while($attrs = $ldap->fetch()){
       if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
-        $ret[$attrs['dn']]= $prefix.$attrs['ou'][0];
-        $ret = array_merge($ret,$this->getBranches($attrs['dn'],"".$prefix.$attrs['ou'][0]."/"));
+        $name = convert_department_dn(preg_replace("/,ou=fai,.*$/","",$attrs['dn']));
+        $ret[$attrs['dn']] = $name;
+        $ret = array_merge($ret,$this->getBranches($attrs['dn'],$prefix.$attrs['ou'][0]."/"));
       }
     }
     return($ret);