From 59d127bd6bd7365af3e6cb34f542ef2112d843c7 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 13 Aug 2008 09:36:02 +0000 Subject: [PATCH] Updated devices -Fixed empty checks. -Fixed object creation, it wasn't possible to create new devices - no objectClasses were set. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12206 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/devices/class_deviceGeneric.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc index e87182120..59295598a 100644 --- a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc +++ b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc @@ -86,7 +86,7 @@ class deviceGeneric extends plugin { $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)){ @@ -165,8 +165,14 @@ class deviceGeneric extends plugin { 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."|"; -- 2.30.2