From 2b42ed97eb38cf4d13e493d886749a2c98549bf2 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 1 Jun 2006 09:11:51 +0000 Subject: [PATCH] Fixed getBranches to show all branches, not only those in our subtree git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3603 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiSummaryTab.inc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/admin/fai/class_faiSummaryTab.inc b/plugins/admin/fai/class_faiSummaryTab.inc index 0db08e866..7d926bd3f 100644 --- a/plugins/admin/fai/class_faiSummaryTab.inc +++ b/plugins/admin/fai/class_faiSummaryTab.inc @@ -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); -- 2.30.2