Code

Applied patch from ticket 187
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 12:25:22 +0000 (12:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Oct 2007 12:25:22 +0000 (12:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7490 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_termDNS.inc

index 065a6e1129204b5aab84c4447748bf8400edd2cb..b926611329cc5d30bf70d3bfdaa8ecba7585c175 100644 (file)
@@ -214,7 +214,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; 
       }
@@ -535,6 +535,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) ){