Code

Ensure that dhcpHWAddress will be written like this :
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 12:07:35 +0000 (12:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 12:07:35 +0000 (12:07 +0000)
ethernet 00:00:00:00:00:00
instead of MAC address only

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7489 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_termDNS.inc

index 609074146673fcb85d8dee9b4eb713e4e3e1d750..bbd46daa0644458af376c57d010ad4abc31b9f5b 100644 (file)
@@ -222,7 +222,7 @@ class termDNS extends plugin
         $this->dialog = new dhcpHost($this->dhcpHostEntry,TRUE);
       }
       $this->dialog->cn = $this->cn; 
-      $this->dialog->dhcpHWAddress = $this->macAddress; 
+      $this->dialog->dhcpHWAddress = "ethernet ".$this->macAddress; 
       if(!empty($this->ipHostNumber)){
         $this->dialog->statements['fixed-address'] = $this->ipHostNumber; 
       }
@@ -548,6 +548,16 @@ class termDNS extends plugin
     /* New entry */
     if($this->dhcpEnabled){
 
+      /* Write mac address to dhcp settings */
+      if($this->dhcp_is_Account){
+        if(!isset($this->dhcpHostEntry['dhcpHWAddress'][0]) || 
+            !preg_match("/ethernet ".$this->macAddress."/",$this->dhcpHostEntry['dhcpHWAddress'][0])){
+          $this->dhcpHostEntry['dhcpHWAddress'] = array("ethernet ".$this->macAddress);
+          $this->dhcpHostEntry['MODIFIED'] = TRUE;
+        }
+      }
+  
+
       /* Unset dhcpStatements if this attribute is empty  */
       if(isset($this->dhcpHostEntry['dhcpStatements']) && 
           ($this->dhcpHostEntry['dhcpStatements'] == "" || count($this->dhcpHostEntry['dhcpStatements']) == 0) ){