diff --git a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc
index 5a4de8ad20d434fc8f7629f29a4971147092fe4e..0448b3bde477c104852c65bfc142a2dcb5f575ea 100644 (file)
$this->base= dn2base($ui->dn);
}
} else {
- $this->base =preg_replace ("/^[^,]+,".get_ou('deviceou')."/","",$this->dn);
+ $this->base =preg_replace ("/^[^,]+,".get_ou('deviceRDN')."/","",$this->dn);
}
$this->orig_base = $this->base;
$this->orig_dn = $this->dn;
{
$message = plugin::check();
- if(empty($this->cn)||(preg_match("/[^a-z0-9]/i",$this->cn))){
+ if($this->cn == "" ||(preg_match("/[^a-z0-9]/i",$this->cn))){
$message[]= msgPool::invalid(_("Name"),$this->cn,"/^[a-z0-9]*$/i");
}
if(preg_match("/[^a-z0-9!\"?.,;:-_\(\) ]/i",$this->description)){
/* Skip serial check if vendor and product id are given */
if(preg_match("/^\s+$/i",$this->devID)){
$message[]= msgPool::invalid(_("iSerial"),"","01234");
+ }elseif(empty($this->devID) && $this->devID!="0"){
+ $message[]= msgPool::required(_("iSerial"));
}
if(empty($this->serial) || !$this->is_2byteHex($this->serial)){
$message[]= msgPool::invalid(_("Serial"),"","","0x1234");
{
plugin::save();
- $this->attrs = array();
- $this->attrs['cn'] = $this->cn;
+ /* Unset non ldap attributes
+ */
+ foreach(array("devID","serial","vendor", "type", "description") as $name){
+ if(isset($this->attrs[$name])){
+ unset($this->attrs[$name]);
+ }
+ }
+
$this->attrs['gotoHotplugDevice'] = "";
foreach(array("description","devID","serial","vendor", "type") as $post){
$this->attrs['gotoHotplugDevice'] .= $this->$post."|";
"cn" => _("Name"),
"base" => _("Base"),
"description" => _("Description"),
- "type" => _("Tpye"),
+ "type" => _("Type"),
"serial" => _("Serial"),
"vendor" => _("Vendor"),
- "devID" => _("Devive ID"))
+ "devID" => _("Device ID"))
));
}