diff --git a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc
index bc870eb74c6266989d050222c096758c3bbd11c0..6ce15fb9cb99868159b8b91bcceb354db1c57709 100644 (file)
$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 */
$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"));
}
}
$ldap->cd($this->dn);
$ldap->add($this->attrs);
}
- show_ldap_error($ldap->get_error(),_("Device could not be saved."));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+ }
}