From: hickert Date: Fri, 17 Sep 2010 11:27:51 +0000 (+0000) Subject: Updated device handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8de870631210f3306fa6124f50d452ae0a2d9f45;p=gosa.git Updated device handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19752 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc index baaa24bca..50fdafe67 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc @@ -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? diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc index 04b08f688..ccbc6a7a7 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -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); }