From 78fd52f682986d25fb95c171757d58384f7f58f8 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Sep 2006 06:27:48 +0000 Subject: [PATCH] Added printer patch git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4702 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPackage.inc | 56 ++++++++++++++------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index 67f5c6666..d2fe6bac3 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -101,36 +101,40 @@ class faiPackage extends plugin } - /* Create one filter with all package names, - instead of calling $ldap->search for every single package - */ - $PackageFilter = ""; - foreach($this->usedPackages as $name){ - $PackageFilter .= "(FAIpackage=".$name.")"; - } - $PackageFilter = "(&(objectClass=FAIdebconfInfo)(|".$PackageFilter."))"; - - /* Search for configuration objects */ - $ldap = $this->config->get_ldap_link(); - $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection")); + if($dn != "new"){ - /* Walk through configurations and append them to our list of ConfiguredPackages */ - while($attr = $ldap->fetch()){ - $tmp =array(); - $tmp['Name'] = $attr['FAIvariable'][0]; - $tmp['Type'] = $attr['FAIvariableType'][0]; + /* Create one filter with all package names, + instead of calling $ldap->search for every single package + */ + $PackageFilter = ""; + foreach($this->usedPackages as $name){ + $PackageFilter .= "(FAIpackage=".$name.")"; + } + $PackageFilter = "(&(objectClass=FAIdebconfInfo)(|".$PackageFilter."))"; - 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; + /* Search for configuration objects */ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->dn); + $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection")); + + /* Walk through configurations and append them to our list of ConfiguredPackages */ + while($attr = $ldap->fetch()){ + $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