Code

Added new show_*_header to environemnt
[gosa.git] / plugins / personal / environment / class_logonManagementDialog.inc
index ea1dcca55d0fec0f92ea948ffa8d45304405d076..98ce41ff312a27e1e7454f321ab4c79e3ff2337b 100644 (file)
@@ -41,6 +41,9 @@ class logonManagementDialog extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     $smarty= get_smarty();
     $display= "";
 
@@ -66,6 +69,7 @@ class logonManagementDialog extends plugin
     }else{
       $smarty->assign("LogonNameACL","");
     }
+  
 
     $display.= $smarty->fetch(get_template_path('logonManagement.tpl', TRUE,dirname(__FILE__)));
     return($display);
@@ -76,7 +80,7 @@ class logonManagementDialog extends plugin
     if(isset($_POST['dialogissubmitted'])){
       foreach($this->attributes as $attr){
         if(isset($_POST[$attr])){
-          $this->$attr= $_POST[$attr]
+          $this->$attr = stripslashes($_POST[$attr])
         }else{
           $this->$attr = false;
         }
@@ -86,17 +90,22 @@ class logonManagementDialog extends plugin
 
   function check()
   {
-  $message = array();
-  
-  if(preg_match("/[^a-z]/",$this->LogonName)){
-    $message[] = _("Specified name is invalid.");
-  } 
+    /* Call common method to give check the hook */
+    $message= plugin::check();
   
-  if(preg_match("/[^a-z0-9,\.-;:_\(\)!\? ]/i",$this->LogonDescription)){
-    $message[] = _("Specified decription contains invalid characters.");
-  }
-  return $message;
+    if(preg_match("/[^a-z]/",$this->LogonName)){
+      $message[] = _("Specified name is invalid.");
+    } 
+
+    if(empty($this->LogonName)){
+      $message[] = _("Please specify a valid script name.");
+    }
+
+    if(preg_match("/[^a-z0-9,\.-;:_\(\)!\? ]/i",$this->LogonDescription)){
+      $message[] = _("Specified description contains invalid characters.");
+    }
+
+    return $message;
   }