From c803124cad284dbde7dd459641688dca2b2c2d6d Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Aug 2006 11:47:54 +0000 Subject: [PATCH] Fixed faiSummary git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4393 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiSummaryTab.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/admin/fai/class_faiSummaryTab.inc b/plugins/admin/fai/class_faiSummaryTab.inc index 42783ab36..3963f42cf 100644 --- a/plugins/admin/fai/class_faiSummaryTab.inc +++ b/plugins/admin/fai/class_faiSummaryTab.inc @@ -67,6 +67,7 @@ class faiSummaryTab extends plugin{ /* Get Classes and release */ $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses; $str = preg_replace("/^.*ou=profiles,/","",$this->dn); + if(isset($tmp[$str])){ $this->Release = $tmp[$str]; } @@ -142,18 +143,17 @@ class faiSummaryTab extends plugin{ } - /* returns an array with all possibly release types */ - function getBranches($base = false,$prefix = "") + function getBranches() { - $ret = array("main"=>"/"); + $dn = $this->config->current['BASE']; $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->config->current['BASE']); - $ldap->search("(objectClass=FAIbranch)",array("dn","cn","ou")); + $ldap->cd($dn); + $ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou","cn","dn")); + $ret = array("main"=>"/"); while($attrs = $ldap->fetch()){ - if((isset($attrs['ou']))&&($attrs['dn']!=$base)){ + if(preg_match("/ou=fai,/",$attrs['dn'])){ $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