Code

Added hot plug patch, to allow empty serial if vendor and product id are set
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 07:18:58 +0000 (07:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 07:18:58 +0000 (07:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5504 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_hotplugDialog.inc

index c0a7be3d5603d26b4ec075c50c9168aff622188e..704838234408c88e4e422432bfe4e98984d058e5 100644 (file)
@@ -123,21 +123,23 @@ class hotplugDialog extends plugin
         $message[]=_("Invalid character in description. Please specify a valid description.");
       }
 
-      if(empty($this->HOT_id) || preg_match("/[\|]/i",$this->HOT_id)){
-        $message[]=_("Please specify a valid id.");
+      if((empty($this->HOT_vendor)) || (empty($this->HOT_produkt))){
+        if(empty($this->HOT_id) || preg_match("/[\|\*]/i",$this->HOT_id)){
+          $message[]=_("Please specify a valid iSerial.");
+        }
       }
       if(empty($this->HOT_vendor) || !$this->is_2byteHex($this->HOT_vendor)){
-        $message[]=_("Please specify a valid vendor id. (2 byte hex like '0xFFFF')");
+        $message[]=_("Please specify a valid vendor ID. (2 byte hex like '0xFFFF')");
       }
       if(empty($this->HOT_produkt) || !$this->is_2byteHex($this->HOT_produkt)){
-        $message[]=_("Please specify a valid product id. (2 byte hex like '0xFFFF')");
+        $message[]=_("Please specify a valid product ID. (2 byte hex like '0xFFFF')");
       }
 
-    $ldap = $this->config->get_ldap_link();
-    $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDevice=".$this->HOT_name."*))",array("gotoHotplugDevice"));
-    if($ldap->count()){
-      $message[]=_("An Entry with this name already exists.");
-    }
+      $ldap = $this->config->get_ldap_link();
+      $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDevice=".$this->HOT_name."*))",array("gotoHotplugDevice"));
+      if($ldap->count()){
+        $message[]=_("An Entry with this name already exists.");
+      }
 
     }else{
       if((!isset($_POST['hotplugName']))||(empty($_POST['hotplugName']))){