From: hickert Date: Fri, 28 Mar 2008 14:31:55 +0000 (+0000) Subject: Updated dhcp account X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=871db3793a4712d336b3502f11c00fc14c30e5e9;p=gosa.git Updated dhcp account -IP addresses will now be updated git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10064 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 4c34e9eb4..a0925d884 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -645,21 +645,6 @@ class termDNS extends plugin } } - if(count($this->dhcpHostEntry) == 0){ - $this->dialog = new dhcpHost($this->dhcpParentNode,TRUE); - $this->dialog->cn = $this->cn; - $this->dialog->dhcpHWAddress = "ethernet ".$this->macAddress; - if(!empty($this->ipHostNumber)){ - $this->dialog->statements['fixed-address'] = $this->ipHostNumber; - } - $this->dialog->execute(); - $this->dialog->save_object(); - $this->dhcpHostEntry = $this->dialog->save(); - if(count($this->dhcpHostEntry['dhcpOption']) == 0){ - $this->dhcpHostEntry['dhcpOption']= array("host-name ".$this->cn); - } - } - /* Write mac address to dhcp settings */ if($this->dhcp_is_Account){ if(!isset($this->dhcpHostEntry['dhcpHWAddress'][0]) || @@ -668,7 +653,16 @@ class termDNS extends plugin $this->dhcpHostEntry['MODIFIED'] = TRUE; } } - + + /* Updated IP host number */ + if($this->dhcp_is_Account){ + foreach($this->dhcpHostEntry['dhcpStatements'] as $id => $value){ + if(preg_match("/^fixed-address/",$value)){ + $this->dhcpHostEntry['dhcpStatements'][$id] = "fixed-address ".$this->ipHostNumber; + $this->dhcpHostEntry['MODIFIED'] = TRUE; + } + } + } /* Unset dhcpStatements if this attribute is empty */ if(isset($this->dhcpHostEntry['dhcpStatements']) &&