Code

Removed duplicated post call
[gosa.git] / plugins / admin / systems / class_terminalStartup.inc
index 4b30c443e80531d05dfefd003acdaa04ddeb87e7..dfae3014777783a594ef3e81bd8ba5dee3f04ce4 100644 (file)
@@ -24,7 +24,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 */
@@ -40,6 +40,7 @@ class termstartup extends plugin
 
     /* Get arrays */
     foreach (array("gotoModules") as $val){
+      $this->$val = array();
       if (isset($this->attrs["$val"]["count"])){
         for ($i= 0; $i<$this->attrs["count"]; $i++){
           if (isset($this->attrs["$val"][$i])){
@@ -143,6 +144,10 @@ class termstartup extends plugin
         }
       }
     }
+
+    if($this->is_account){
+      @log::log("view","terminal/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -288,6 +293,7 @@ class termstartup extends plugin
   {
     if($this->acl_is_removeable()){
       $this->handle_post_events("remove");
+      @log::log("remove","terminal/".get_class($this),$this->dn,array_keys($this->attrs));
     }
   }
 
@@ -369,7 +375,9 @@ class termstartup extends plugin
     
         $this->attrs["$val"]= array_unique($this->$val);
       }
-      if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array();
+      if(!isset($this->attrs["$val"])){
+       $this->attrs["$val"]=array();
+      }
     }
 
     /* Strip out 'default' values */
@@ -391,9 +399,12 @@ class termstartup extends plugin
     /* Write back to ldap */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
+    
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    @log::log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system terminal/startup with dn '%s' failed."),$this->dn));
     $this->handle_post_events("modify");
   }