Code

Fix regression in commit r19721.
authorwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Sep 2010 07:29:44 +0000 (07:29 +0000)
committerwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Sep 2010 07:29:44 +0000 (07:29 +0000)
Check for empty name field first, to avoid a superfluous invalid
entry error when no script name has been  specified.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19733 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc

index 7600ac934b66b80b9b85cdae65f59201c8efa07d..27c1a77602081a323efebfcffeb4790983d36a14 100644 (file)
@@ -137,13 +137,14 @@ class faiScriptEntry extends plugin
       $message[] = msgPool::duplicated(_("Name"));
     }
 
+    if($this->cn == ""){
+      $message[] = msgPool::required(_("Name"));
+    }
+
     if(preg_match("/[^a-z0-9_\-]/i",$this->cn)){
       $message[] = msgPool::invalid(_("Name"),$this->cn,"/[a-z0-9_\-]/i");
     }
 
-    if(trim($this->cn)  == ""){
-      $message[] = msgPool::required(_("Name"));
-    }
     $s = trim($this->FAIscript);
     if($s == ""){
       $message[]= msgPool::required(_("Script"));