From: hickert Date: Fri, 1 Oct 2010 11:20:06 +0000 (+0000) Subject: Added syntax checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9149ddd07bd7e173056e8690eb43c25d50dc5820;p=gosa.git Added syntax checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19884 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc index 899b587e0..0bbfd171a 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc @@ -108,6 +108,12 @@ class TemplateWidget */ function check() { + if($this->required && empty($this->value)){ + return(array(msgPool::required($this->display))); + } + if(!empty($this->value) && !empty($this->syntax) && !preg_match("/".$this->syntax."/", $this->value)){ + return(array(msgPool::invalid($this->display, $this->value, "/".$this->syntax."/"))); + } return(array()); } }