From: hickert Date: Thu, 8 Sep 2005 07:08:50 +0000 (+0000) Subject: Added checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6394a46feff8e3e8f582fb7634a36ff73483f70e;p=gosa.git Added checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1324 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/FAI/class_faiHookEntry.inc b/plugins/admin/FAI/class_faiHookEntry.inc index dba2a8ac6..06fe4024e 100644 --- a/plugins/admin/FAI/class_faiHookEntry.inc +++ b/plugins/admin/FAI/class_faiHookEntry.inc @@ -73,8 +73,31 @@ class faiHookEntry extends plugin function check() { $message= array(); + if(empty($this->Object_FAItask)) { + $message[]=_("Please enter a value for task."); + } + if(empty($this->Object_FAIscript)) { + $message[]=_("Please enter a value for script."); + } + + $str = utf8_encode("üöä"); + + if(empty($this->Object_description)){ + $message[] = _("Please enter a description."); + } + + if(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->Object_description)){ + $message[] = _("Invalid character in description. Please enter a valid description."); + } + + if(empty($this->Object_cn)){ + $message[] = _("Please enter a name."); + } + + if(preg_match("/[^0-9a-z]/",$this->Object_cn)){ + $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed."); + } - return ($message); } diff --git a/plugins/admin/FAI/class_faiScriptEntry.inc b/plugins/admin/FAI/class_faiScriptEntry.inc index f43052fa1..308b8c5c3 100644 --- a/plugins/admin/FAI/class_faiScriptEntry.inc +++ b/plugins/admin/FAI/class_faiScriptEntry.inc @@ -74,7 +74,28 @@ class faiScriptEntry extends plugin { $message= array(); + $str = utf8_encode("üöä"); + + if(empty($this->Object_FAIscript)){ + $message[]=_("Please specify a script."); + } + if(empty($this->Object_description)){ + $message[] = _("Please enter a description."); + } + + if(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->Object_description)){ + $message[] = _("Invalid character in description. Please enter a valid description."); + } + + if(empty($this->Object_cn)){ + $message[] = _("Please enter a name."); + } + + if(preg_match("/[^0-9a-z]/",$this->Object_cn)){ + $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed."); + } + return ($message); } diff --git a/plugins/admin/FAI/class_faiTemplateEntry.inc b/plugins/admin/FAI/class_faiTemplateEntry.inc index ca0f879f4..0aa307335 100644 --- a/plugins/admin/FAI/class_faiTemplateEntry.inc +++ b/plugins/admin/FAI/class_faiTemplateEntry.inc @@ -75,8 +75,31 @@ class faiTemplateEntry extends plugin function check() { $message= array(); + if(empty($this->Object_FAItemplateFile)){ + $message[]=_("Please specify a value for attribute 'file'."); + } + + if(empty($this->Object_FAItemplatePath)){ + $message[]=_("Please specify a value for attribute 'path'."); + } - + $str = utf8_encode("üöä"); + + if(empty($this->Object_description)){ + $message[] = _("Please enter a description."); + } + + if(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->Object_description)){ + $message[] = _("Invalid character in description. Please enter a valid description."); + } + + if(empty($this->Object_cn)){ + $message[] = _("Please enter a name."); + } + + if(preg_match("/[^0-9a-z]/",$this->Object_cn)){ + $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed."); + } return ($message); } diff --git a/plugins/admin/FAI/class_faiVariableEntry.inc b/plugins/admin/FAI/class_faiVariableEntry.inc index 01dff1dbb..6277645f5 100644 --- a/plugins/admin/FAI/class_faiVariableEntry.inc +++ b/plugins/admin/FAI/class_faiVariableEntry.inc @@ -71,8 +71,28 @@ class faiVariableEntry extends plugin function check() { $message= array(); - + $str = utf8_encode("üöä"); + if(empty($this->Object_FAIvariableContent)) { + $message[]=_("Please specify a value for the attribute 'content'."); + } + + if(empty($this->Object_description)){ + $message[] = _("Please enter a description."); + } + + if(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->Object_description)){ + $message[] = _("Invalid character in description. Please enter a valid description."); + } + + if(empty($this->Object_cn)){ + $message[] = _("Please enter a name."); + } + + if(preg_match("/[^0-9a-z]/",$this->Object_cn)){ + $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed."); + } + return ($message); }