Code

Updated device handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Sep 2010 11:27:51 +0000 (11:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Sep 2010 11:27:51 +0000 (11:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19752 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc
gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc

index baaa24bcaa173a1422690a82a43c82b998a5b944..50fdafe6760014084a253bea279462652447f212 100644 (file)
@@ -6,9 +6,15 @@ class DeviceTab extends tabs
     {
         // Prepare object DN
         $baseobject= $this->by_object['Device'];
-        $cn      = preg_replace('/,/', '\,', $baseobject->cn);
-        $cn      = preg_replace('/"/', '\"', $cn);
-        $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base;
+        $uuid    = preg_replace('/,/', '\,', $baseobject->deviceUUID);
+
+        if(empty($uuid)){
+            $cn      = preg_replace('/,/', '\,', $baseobject->cn);
+            $cn      = preg_replace('/"/', '\"', $cn);
+            $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base;
+        }else{
+            $this->dn= "deviceUUID=".$uuid.",ou=systems,".$baseobject->base;
+        }
         $baseobject->dn= $this->dn;
 
         // Object moved?
index 04b08f6883c14d39cb2ec8e5663e3d3fa141ee4e..ccbc6a7a75d29f133657080e52091aad6245f133 100644 (file)
@@ -102,6 +102,16 @@ class Device extends plugin
                 }
             }
         }
+
+        // Check ip-address
+        if (!empty($this->ipHostNumber) && !tests::is_ip($this->ipHostNumber)){
+            $message[]= msgPool::invalid(_("IP address"), "", "", "192.168.1.10");
+        }
+
+        // Check mac-address
+        if (!empty($this->ipHostNumber) && !tests::is_ip($this->macAddress)){
+            $message[]= msgPool::invalid(_("MAC address"), "", "", "00:0C:7F:31:33:F1");
+        }
  
         return($message);
     }