From 95c9f997722a7f14e12e6dfec2ebefc42e65bee8 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 Oct 2007 13:10:48 +0000 Subject: [PATCH] Initialze dhcp plugin if it wasn't currently. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7604 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index acc3ba3cb..f242f3e2f 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -423,7 +423,7 @@ class termDNS extends plugin $message= plugin::check(); if($this->dhcpEnabled && $this->dhcp_is_Account && $this->dhcpParentNode != "" && count($this->dhcpHostEntry) == 0){ - $message[] =_("You have not configured your dhcp settings yet."); +# $message[] =_("You have not configured your dhcp settings yet."); } /* Check if ip must be given @@ -541,6 +541,21 @@ class termDNS extends plugin /* New entry */ if($this->dhcpEnabled){ + 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]) || -- 2.30.2