Code

Added toggling of remove flag for packages
[gosa.git] / plugins / admin / fai / class_faiManagement.inc
index 9b7ff99df7c32e275c125a5a65479a5832b9406c..b134623f088450d70d8a42dc6fe6c2309c3ba2c4 100644 (file)
@@ -542,12 +542,9 @@ class faiManagement extends plugin
      ****************/
 
     /* Display dialog with system list */
+    $this->DivListFai->parent = $this;
     $this->DivListFai->execute();
-
-    /* Add departments if subsearch is disabled */
-    if(!$this->DivListFai->SubSearch){
-      $this->DivListFai->AddDepartments($this->DivListFai->selectedBase,4);
-    }
+    $this->DivListFai->AddDepartments($this->DivListFai->selectedBase,4);
     $this->reload();
     $this->DivListFai->setEntries($this->objects);
     return($this->DivListFai->Draw());
@@ -559,11 +556,9 @@ class faiManagement extends plugin
   {
     $ret = array("main"=>"/");
     $ldap = $this->config->get_ldap_link();
-    $ldap->cd($this->config->current['BASE']);
     if(!$base){
-               $base= "ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+      $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
     }
-    $ldap->cd($base);
     $ldap->ls("(objectClass=FAIbranch)",$base);
     while($attrs = $ldap->fetch()){
       if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
@@ -571,7 +566,8 @@ class faiManagement extends plugin
         $ret = array_merge($ret,$this->getBranches($attrs['dn'],"".$prefix.$attrs['ou'][0]."/"));
       }
     }
-    return($ret);
+
+    return ($ret);
   }
 
   
@@ -615,13 +611,8 @@ class faiManagement extends plugin
       }
 
       /* Fetch objects from fai sub department */
-      if($this->DivListFai->SubSearch){
-        $res= get_list("(&(objectClass=".$type.")(cn=$Regex))", $this->ui->subtreeACL, preg_replace("/^.*ou=fai,ou=configs,ou=systems,/","",$base),
-            array("cn","description","objectClass","FAIclass","FAIstate"), GL_SIZELIMIT | GL_SUBSEARCH);
-      }else{
-        $res= get_list("(&(objectClass=".$type.")(cn=$Regex))", $this->ui->subtreeACL, $obj['OU'].$base,
+      $res= get_list("(&(objectClass=".$type.")(cn=$Regex))", $this->ui->subtreeACL, $obj['OU'].$base,
             array("cn","description","objectClass","FAIclass","FAIstate"), GL_SIZELIMIT);
-      }
 
       /* Walk through objects */
                        foreach($res as $object){
@@ -715,7 +706,7 @@ class faiManagement extends plugin
       return(false);
     }elseif(empty($name)){
       return(false);
-    }elseif(in_array($name,array("fai","disk","packages","scripts","templates","hooks","variables","profiles","apps"))){
+    }elseif(is_department_name_reserved($name,$base)){
       return(false);
     }
     return(true);