From c61a397c6988f4db9ffab539f80d8a521d3f2174 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Apr 2008 10:02:27 +0000 Subject: [PATCH] Updated FAI Package -Do not load the packages from ldap directly, use the copy&write methods to fetch all objects. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10403 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiPackage.inc | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index 1814daf6f..cc6a20b0e 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -89,38 +89,41 @@ class faiPackage extends plugin } $PackageFilter = "(&(objectClass=FAIdebconfInfo)(|".$PackageFilter."))"; - /* Search for configuration objects */ + $res = FAI::get_all_objects_for_given_base(FAI::get_release_dn($dn),$PackageFilter); $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->dn); - $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType", - "FAIvariableContent","FAIpackage","FAIdebianSection","FAIstate")); + $ldap->cd($this->config->current['BASE']); + foreach($res as $dn_v){ + if(preg_match("/".normalizePreg($dn)."$/",$dn_v['dn'])){ - /* Walk through configurations and append them to our list of ConfiguredPackages - */ - while($attr = $ldap->fetch()){ + $ldap->cat($dn_v['dn']); + $attr = $ldap->fetch(); - /* Skip objects, that are tagged as removed */ - if(isset($object['FAIstate'][0])){ - if(preg_match("/removed$/",$attr['FAIstate'][0])){ - continue; - } - } + /* Walk through configurations and append them to our list of ConfiguredPackages + */ - $tmp =array(); - $tmp['Name'] = $attr['FAIvariable'][0]; - $tmp['Type'] = $attr['FAIvariableType'][0]; + /* Skip objects, that are tagged as removed */ + if(isset($object['FAIstate'][0])){ + if(preg_match("/removed$/",$attr['FAIstate'][0])){ + continue; + } + } - if (isset($attr['FAIvariableContent'][0])){ - if(!in_array($attr['FAIvariableType'],array("multiselect"))){ - $tmp['Value'] = $attr['FAIvariableContent'][0]; - }else{ - $content = array(); - unset($attr['FAIvariableContent']['count']); - foreach($attr['FAIvariableContent'] as $attr){ - $tmp['Value'][] = $attr; + $tmp =array(); + $tmp['Name'] = $attr['FAIvariable'][0]; + $tmp['Type'] = $attr['FAIvariableType'][0]; + + if (isset($attr['FAIvariableContent'][0])){ + if(!in_array($attr['FAIvariableType'],array("multiselect"))){ + $tmp['Value'] = $attr['FAIvariableContent'][0]; + }else{ + $content = array(); + unset($attr['FAIvariableContent']['count']); + foreach($attr['FAIvariableContent'] as $attr){ + $tmp['Value'][] = $attr; + } } + $this->ConfiguredPackages[$attr['FAIpackage'][0]][$attr['FAIvariable'][0]]=$tmp; } - $this->ConfiguredPackages[$attr['FAIpackage'][0]][$attr['FAIvariable'][0]]=$tmp; } } -- 2.30.2