Code

Added mapping for "halt" to "localboot"
[gosa.git] / plugins / admin / systems / class_terminalStartup.inc
index d5894c839b4ad70c76dade0bf138e2b71928c4e2..f8f27fb61b229883ef5bdf23a57713e7ba306a9a 100644 (file)
@@ -1,11 +1,6 @@
 <?php
 class termstartup extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Manage terminal startup options";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* Generic terminal attributes */
   var $bootmode= "G";
   var $goLdapServerList= array();
@@ -24,7 +19,7 @@ class termstartup extends plugin
 
 
   /* attribute list for save action */
-  var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters");
+  var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters","gotoModules");
   var $objectclasses= array("GOhard");
 
   /* Helper */
@@ -38,13 +33,15 @@ class termstartup extends plugin
 
     /* Get arrays */
     foreach (array("gotoModules") as $val){
-      if (isset($this->attrs["$val"]["count"])){
-        for ($i= 0; $i<$this->attrs["count"]; $i++){
-          if (isset($this->attrs["$val"][$i])){
-            array_push($this->$val, $this->attrs["$val"][$i]);
+      $tmp =array();
+      if (isset($this->attrs[$val]["count"])){
+        for ($i= 0; $i<$this->attrs[$val]["count"]; $i++){
+          if (isset($this->attrs[$val][$i])){
+            $tmp[] = $this->attrs["$val"][$i];
           }
         }
       }
+      $this->$val = $tmp;
       sort ($this->$val);
       $this->$val= array_unique($this->$val);
     }
@@ -182,7 +179,7 @@ class termstartup extends plugin
     /* Delete module */
     if (isset ($_POST['delete_module'])){
       if (count($_POST['modules_list']) && chkacl ($this->acl, "gotoModule") == ""){
-        $this->del_list ($this->gotoModules, $_POST['modules_list']);
+        $this->gotoModules = $this->del_list($this->gotoModules, $_POST['modules_list']);
       }
     }
 
@@ -248,9 +245,7 @@ class termstartup extends plugin
         $use = " checked ";
       };
 
-      if(chkacl($this->acl,"gotoLdapServer") == ""){
-        $use.= " disabled ";
-      }
+      $use .= chkacl($this->acl,"gotoLdapServer");
 
       $SelectBoxLdapServer->AddEntry(
           array(
@@ -381,8 +376,9 @@ class termstartup extends plugin
       if (isset ($this->$val) && count ($this->$val) != 0){
     
         $this->attrs["$val"]= array_unique($this->$val);
+      }else{
+        $this->attrs["$val"]=array();
       }
-      if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array();
     }
 
     /* Strip out 'default' values */
@@ -423,7 +419,7 @@ class termstartup extends plugin
 
 
   /* Delete value to array, check if unique */
-  function del_list (&$array, $list)
+  function del_list ($array, $list)
   {
     $tmp= array();
     foreach ($array as $mod){
@@ -431,7 +427,7 @@ class termstartup extends plugin
         $tmp[]= $mod;
       }
     }
-    $array= $tmp;
+    return($tmp);
   }
 
    /* Generate ListBox frindly output for the defined shares