Code

Added syntax checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Oct 2010 11:20:06 +0000 (11:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Oct 2010 11:20:06 +0000 (11:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19884 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget.inc

index 899b587e0915a97e271c82b776124813670dad1f..0bbfd171ad581b2e24231b30b3695ac6878768e5 100644 (file)
@@ -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());
     }
 }