Code

Updated table summary
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiHookEntry.inc
index 2fcff5700f066bb83405e6d4f740d552236d8506..09b5d8dbfb4cb528ea11ee4d4f0882e639643de8 100644 (file)
@@ -23,7 +23,7 @@ class faiHookEntry extends plugin
   
   function faiHookEntry (&$config, $dn= NULL,$object=false)
   {
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, NULL);
     if($dn != "new"){
       $this->orig_cn= $object['cn'];
       $this->dn=$object['dn'];
@@ -145,12 +145,17 @@ class faiHookEntry extends plugin
       $message[]= msgPool::duplicated(_("Name"));
     }
 
-    if(empty($this->FAIscript)) {
-      $message[]= msgPool::required(_("Script"));
+    $c = trim($this->cn);
+    if($c == ""){
+      $message[] = msgPool::required(_("Name"));
+    }
+    if(preg_match("/[^a-z0-9_\-]/i",$c)){
+      $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
     }
 
-    if(empty($this->cn)){
-      $message[]= msgPool::required(_("Name"));
+    $s = trim($this->FAIscript);
+    if($s == ""){
+      $message[]= msgPool::required(_("Script"));
     }
 
     return ($message);