From: hickert Date: Wed, 10 Oct 2007 12:07:35 +0000 (+0000) Subject: Ensure that dhcpHWAddress will be written like this : X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=305fa6dae843e1ef2e6a5c3ba553e09c71878793;p=gosa.git Ensure that dhcpHWAddress will be written like this : 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 --- diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 609074146..bbd46daa0 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -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) ){