From 69169d3e18dd3462e10986da3e316b5e0ee2b14b Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Jan 2007 07:18:58 +0000 Subject: [PATCH] Added hot plug patch, to allow empty serial if vendor and product id are set git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5504 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_hotplugDialog.inc | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/personal/environment/class_hotplugDialog.inc b/plugins/personal/environment/class_hotplugDialog.inc index c0a7be3d5..704838234 100644 --- a/plugins/personal/environment/class_hotplugDialog.inc +++ b/plugins/personal/environment/class_hotplugDialog.inc @@ -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']))){ -- 2.30.2