From: hickert Date: Thu, 1 Jun 2006 09:11:51 +0000 (+0000) Subject: Fixed getBranches to show all branches, not only those in our subtree X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2b42ed97eb38cf4d13e493d886749a2c98549bf2;p=gosa.git 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 --- 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);