summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5ebe8e)
raw | patch | inline | side by side (parent: f5ebe8e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Apr 2006 10:26:55 +0000 (10:26 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Apr 2006 10:26:55 +0000 (10:26 +0000) |
Instead of calling ldap->search for each Package
call ldap->search with all packages in a single search
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3062 594d385d-05f5-0310-b6e9-bd551577e9d8
call ldap->search with all packages in a single search
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3062 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_faiPackage.inc | patch | blob | history |
index 2e30084b7e5ae67c05f41466ec2177bb96eac2f3..7e72481f99b84beb4fe34b651cc44e2977d07add 100644 (file)
$this->usedPackages = array();
}
- $ldap = $this->config->get_ldap_link();
+
+ /* Create one filter with all package names,
+ instead of calling $ldap->search for every single package
+ */
+ $PackageFilter = "";
foreach($this->usedPackages as $name){
- $ldap->search("(&(objectClass=FAIdebconfInfo)(FAIpackage=".$name."))",array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection",""));
- 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;
- }
+ $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"));
+
+ /* 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;
}
}