summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: efc4e7e)
raw | patch | inline | side by side (parent: efc4e7e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Mar 2008 13:14:36 +0000 (13:14 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Mar 2008 13:14:36 +0000 (13:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9973 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiPackage.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index 0134210477b17521a83064c293eaf486732ca785..8201e1a40a7ed6da3bafb67fc0a1ca1b902b4230 100644 (file)
if($dn != "new"){
$this->dn =$dn;
- /* Get FAIstate
- */
+ /* Get FAIstate */
if(isset($this->attrs['FAIstate'][0])){
$this->FAIstate = $this->attrs['FAIstate'][0];
}
- }
- if(isset($this->attrs['FAIpackage'])){
- unset($this->attrs['FAIpackage']['count']);
- foreach($this->attrs['FAIpackage'] as $pkg){
- $this->usedPackages[$pkg] = $pkg;
- }
- ksort($this->usedPackages);
- }else{
+ /* Check if there are already some packages in this list
+ */
$this->usedPackages = array();
- }
-
- if($dn != "new"){
+ if(isset($this->attrs['FAIpackage'])){
+ unset($this->attrs['FAIpackage']['count']);
+ foreach($this->attrs['FAIpackage'] as $pkg){
+ $this->usedPackages[$pkg] = $pkg;
+ }
+ ksort($this->usedPackages);
+ }
- /* Create one filter with all package names,
- instead of calling $ldap->search for every single package
+ /* Fetch all package configurations from ldap
*/
$PackageFilter = "";
foreach($this->usedPackages as $name){
/* Search for configuration objects */
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection","FAIstate"));
+ $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType",
+ "FAIvariableContent","FAIpackage","FAIdebianSection","FAIstate"));
- /* Walk through configurations and append them to our list of ConfiguredPackages */
+ /* Walk through configurations and append them to our list of ConfiguredPackages
+ */
while($attr = $ldap->fetch()){
/* Skip objects, that are tagged as removed */
$this->ConfiguredPackages[$attr['FAIpackage'][0]][$attr['FAIvariable'][0]]=$tmp;
}
}
- }
- if (isset($this->attrs['FAIdebianSection']['count'])){
- unset($this->attrs['FAIdebianSection']['count']);
- }
- if((isset($this->attrs['FAIdebianSection']))&&(is_array($this->attrs['FAIdebianSection']))){
- $this->FAIdebianSection = array();
- foreach($this->attrs['FAIdebianSection'] as $sec){
- $this->FAIdebianSection[$sec]=$sec;
+ if (isset($this->attrs['FAIdebianSection']['count'])){
+ unset($this->attrs['FAIdebianSection']['count']);
+ }
+ if((isset($this->attrs['FAIdebianSection']))&&(is_array($this->attrs['FAIdebianSection']))){
+ $this->FAIdebianSection = array();
+ foreach($this->attrs['FAIdebianSection'] as $sec){
+ $this->FAIdebianSection[$sec]=$sec;
+ }
}
- }
- if((isset($this->attrs['FAIdebianSection']))&&(is_string($this->attrs['FAIdebianSection']))){
- $this->FAIdebianSection=array($this->attrs['FAIdebianSection']=>$this->attrs['FAIdebianSection']) ;
- }
- $this->confDir = CONFIG_DIR."/fai/";
- $this->FAIpackage = array();
+ if((isset($this->attrs['FAIdebianSection']))&&(is_string($this->attrs['FAIdebianSection']))){
+ $this->FAIdebianSection=array($this->attrs['FAIdebianSection']=>$this->attrs['FAIdebianSection']) ;
+ }
+ $this->confDir = CONFIG_DIR."/fai/";
+ $this->FAIpackage = array();
+ } // ENDE dn != new
$methods = array();
foreach($this->FAIinstallMethods as $method){
$methods[$method] = $method;
}
$this->FAIinstallMethods = $methods;
+
/* Check if we exist already - no need to ask for revisions, etc. then */
if ($this->dn != "new"){
$this->newDialogShown= true;
}
-
}
+
function execute()
{
/* Call parent execute */
$this->is_dialog =true;
}
- /* Delte selected package */
+ /* Delete selected package */
if(isset($_POST['Delpkg']) && $this->acl_is_writeable("FAIpackage")){
if($this->FAIstate != "freeze"){
foreach($_POST['usedPackages'] as $del){