Code

msgPool
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Mar 2008 13:36:08 +0000 (13:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Mar 2008 13:36:08 +0000 (13:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9714 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/devices/class_deviceGeneric.inc
gosa-plugins/goto/admin/devices/class_deviceManagement.inc

index eed97d25ddaf077a71951a97712eb1ac39d2ae02..6ce15fb9cb99868159b8b91bcceb354db1c57709 100644 (file)
@@ -84,21 +84,21 @@ class deviceGeneric extends plugin
     $message = plugin::check();
 
     if(empty($this->cn)||(preg_match("/[^a-z0-9]/i",$this->cn))){
-      $message[]=_("Please specify a valid name. Only 0-9 a-Z is allowed.");
+      $message[]= msgPool::invalid(_("Name"),$this->cn,"/^[a-z0-9]*$/i");
     }
     if(preg_match("/[^a-z0-9!\"?.,;:-_\(\) ]/i",$this->description)){
-      $message[]=_("Invalid character in description. Please specify a valid description.");
+      $message[]= msgPool::invalid(_("Description"),$this->cn,"/^[a-z0-9!\"?.,;:-_\(\) ]*$/i");
     }
 
     /* Skip serial check if vendor and product id are given */
     if(preg_match("/^\s+$/i",$this->dev_id)){
-      $message[]=_("Please specify a valid iSerial.");
+      $message[]= msgPool::invalid(_("iSerial"),"","01234");
     }
     if(empty($this->serial) || !$this->is_2byteHex($this->serial)){
-      $message[]=_("Please specify a valid vendor ID. (2 byte hex like '0xFFFF')");
+      $message[]= msgPool::invalid(_("Serial"),"","","0x1234");
     }
     if(empty($this->vendor) || !$this->is_2byteHex($this->vendor)){
-      $message[]=_("Please specify a valid product ID. (2 byte hex like '0xFFFF')");
+      $message[]= msgPool::invalid(_("Vender ID"),"","","0x1234");
     }
    
     /* Check if entry already exists */ 
@@ -106,7 +106,7 @@ class deviceGeneric extends plugin
       $ldap = $this->config->get_ldap_link();
       $ldap->search("(&(objectClass=gotoDevice)(cn=".$this->cn."*))",array("cn"));
       if($ldap->count()){
-        $message[]=_("An Entry with this name already exists.");
+        $message[]= msgPool::duplicate(_("Name"));
       }
     }
 
index 6d3a29420049425d53493af5a4e8781cdf127945..55d405e5dfbdec4acb838841af4bd2a88835f85a 100644 (file)
@@ -274,7 +274,7 @@ class deviceManagement extends plugin
         } else {
           /* Normally this shouldn't be reached, send some extra
              logs to notify the administrator */
-          print_red (_("You are not allowed to delete this device type!"));
+          print_red (msgPool::permDelete());
           new log("security","devices/".get_class($this),$dn,array(),"Tried to trick deletion.");
         }
         /* Remove lock file after successfull deletion */
@@ -329,7 +329,7 @@ class deviceManagement extends plugin
 
         /* Obviously the user isn't allowed to delete. Show message and
            clean session. */
-       print_red (_("You are not allowed to delete this device!"));
+          print_red (msgPool::permDelete());
       }
     }
 
@@ -358,7 +358,7 @@ class deviceManagement extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red (_("You are not allowed to delete this device!"));
+        print_red (msgPool::permDelete());
         new log("security","devices/".get_class($this),$dn,array(),"Tried to trick deletion.");
       }