From f688f03f581f7294414a1e2d249299c38b0d8846 Mon Sep 17 00:00:00 2001 From: wolffc Date: Fri, 17 Sep 2010 07:29:44 +0000 Subject: [PATCH] Fix regression in commit r19721. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index 7600ac934..27c1a7760 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -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")); -- 2.30.2