From 5dc87d091e3206c3fb0c73435d51aee3725fbeaa Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Oct 2007 07:48:45 +0000 Subject: [PATCH] Some changes for Arp New devices git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7612 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_ArpNewDevice.inc | 2 +- plugins/admin/systems/class_termDNS.inc | 33 ++++++++++++++++++++ plugins/admin/systems/tabs_arpnewdevice.inc | 4 +-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/plugins/admin/systems/class_ArpNewDevice.inc b/plugins/admin/systems/class_ArpNewDevice.inc index f2d7a754c..79009908e 100644 --- a/plugins/admin/systems/class_ArpNewDevice.inc +++ b/plugins/admin/systems/class_ArpNewDevice.inc @@ -12,7 +12,7 @@ class ArpNewDevice extends plugin { plugin :: plugin($config,$dn); $this->cn =""; - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); $this->acl = "#all#"; $this->netConfigDNS->acl = $this->acl; $this->netConfigDNS->force_dns(); diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index af07e450b..97dbc5bc9 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -44,6 +44,7 @@ class termDNS extends plugin var $initially_was_account = false; var $dnsEntry = array(); var $DNSenabled = false; + var $hide_dns_check_box = FALSE; /* Terminal dns */ @@ -336,6 +337,8 @@ class termDNS extends plugin /* Assign all needed vars */ $smarty->assign("DNSAccount",$this->DNS_is_account); + $smarty->assign("hide_dns_check_box",$this->hide_dns_check_box); + $smarty->assign("Zones",$this->Zones); $smarty->assign("ZoneCnt",count($this->Zones)); $smarty->assign("ZoneKeys",($this->Zones)); @@ -450,6 +453,9 @@ class termDNS extends plugin } + if($this->hide_dns_check_box){ + $this->DNS_is_account = true; + } } } @@ -598,6 +604,21 @@ 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]) || @@ -834,6 +855,10 @@ class termDNS extends plugin $tmp['plProvidedAcls']["zoneName"] = _("Zone name"); $tmp['plProvidedAcls']["dNSTTL"] = _("TTL"); } + + /* Handle post event */ + $tmp2 = new servdns($this->config,$this->dn); + $tmp2->handle_post_events("modify"); } return($tmp); } @@ -952,6 +977,14 @@ class termDNS extends plugin } return($ret); } + + function force_dns() + { + if($this->DNSenabled){ + $this->DNS_is_account = TRUE; + $this->hide_dns_check_box = TRUE; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/tabs_arpnewdevice.inc b/plugins/admin/systems/tabs_arpnewdevice.inc index f5d7f6830..fe12b4090 100644 --- a/plugins/admin/systems/tabs_arpnewdevice.inc +++ b/plugins/admin/systems/tabs_arpnewdevice.inc @@ -3,9 +3,9 @@ class ArpNewDeviceTabs extends tabs { - function save() + function save($ignore_account= FALSE) { - tabs::save(TRUE); + tabs::save($ignore_account); } function execute() -- 2.30.2