Code

Added check for printer name
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 14:13:38 +0000 (14:13 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 14:13:38 +0000 (14:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7664 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc

index 04e78a4075812132f6ad893a9595128edba71ddc..86d13fa9fb1ffe440221ab98bfefe12fab688a51 100644 (file)
@@ -640,7 +640,12 @@ class printgeneric extends plugin
 
     /* must: cn */
     if(($this->BelongsTo == "Printer") && (empty($this->cn))){
-      $message[]= "The required field 'Printer name' is not set.";
+      $message[]= _("The required field 'Printer name' is not set.");
+    }
+
+    /* must: cn */
+    if(($this->BelongsTo == "Printer") && !preg_match("/^[a-z0-9\.\-_]*$/i",$this->cn)){
+      $message[]= _("Invalid character in printer name.");
     }
 
     if($this->BelongsTo == "Printer"){