Code

Unified group check in FAI templates
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Aug 2008 08:25:06 +0000 (08:25 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Aug 2008 08:25:06 +0000 (08:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12089 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc

index 85f3ea6f818af26621377961690a58dabae6e966..5a4ab856b54f5b6ddaaba8496f536f548f0c5fac 100644 (file)
@@ -215,8 +215,12 @@ class faiTemplateEntry extends plugin
     if(empty($this->group)){
       $message[] = msgPool::required(_("Group"));
     }
-    elseif(preg_match("/[^0-9a-z]/i",$this->group)){
-      $message[] = msgPool::invalid(_("Group"),$this->group,"/[0-9a-z]/");
+    elseif (!tests::is_uid($this->group)){
+      if (strict_uid_mode()){
+        $message[]= msgPool::invalid(_("Group"), $this->group, "/[a-z0-9_-]/");
+      } else {
+        $message[]= msgPool::invalid(_("Group"), $this->group, "/[a-z0-9_-]/i");
+      }
     }
 
     return ($message);