From 978b28f3e62d879caf58238e3e62a7d19804f928 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 12 Sep 2007 07:43:24 +0000 Subject: [PATCH] Ported back take over changes from stable git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7276 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDHCP.inc | 40 ++++++++++++------------ plugins/admin/systems/servdhcp.tpl | 15 +-------- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/plugins/admin/systems/class_servDHCP.inc b/plugins/admin/systems/class_servDHCP.inc index 98fc75bc6..2392bb12f 100644 --- a/plugins/admin/systems/class_servDHCP.inc +++ b/plugins/admin/systems/class_servDHCP.inc @@ -21,6 +21,7 @@ class servdhcp extends goService var $dhcp_server_list = array("ENTRIES"=> array(),"FOR_LIST"=> array()); var $take_over_id = -1; + var $display_warning = TRUE; function servdhcp ($config, $dn= NULL, $parent= NULL) { @@ -95,15 +96,18 @@ class servdhcp extends goService * and hide default dhcp output */ if($this->take_over_id != -1){ + $this->dialog = FALSE; $id = $this->take_over_id; - $info = $this->get_dhcp_info_string($id); $smarty->assign("dns_take_over",TRUE); - $smarty->assign("info",$info); - $warning = sprintf(_("You are going to take over the dhcp setup from server '%s'."),$this->dhcp_server_list['ENTRIES'][$id]['cn'][0]); - $warning2 = _("The take over will be startet when you save this system. To abort this action, use the cancel button below."); - $smarty->assign("warning",$warning); - $smarty->assign("warning2",$warning2); + $warning = sprintf(_("You are going to migrate the DHCP setup from server '%s'."), + $this->dhcp_server_list['ENTRIES'][$id]['cn'][0]); + $warning.= " "._("The migration will be started when you save this system. To cancel this action, use the cancel button below."); + + if($this->display_warning){ + print_red($warning); + $this->display_warning = FALSE; + } return($smarty->fetch(get_template_path('servdhcp.tpl', TRUE))); } @@ -265,6 +269,16 @@ class servdhcp extends goService } + if(isset($_GET['act']) && $_GET['act']=="edit" && isset($_GET['id'])){ + $dn = base64_decode($_GET['id']); + if (isset($this->dhcpObjectCache[$dn])){ + $section= $this->objectType($dn); + $this->current_object= $dn; + $this->dialog= new $section($this->dhcpObjectCache[$dn]); + } + } + + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; @@ -684,20 +698,6 @@ class servdhcp extends goService } - function get_dhcp_info_string($id) - { - $ret = ""; - $ldap = $this->config->get_ldap_link(); - $ldap->cd("cn=dhcp,".$this->dhcp_server_list['ENTRIES'][$id]['dn']); - $ldap->search("(|(objectClass=dhcpSharedNetwork)(objectClass=dhcpSubnet)(objectClass=dhcpPool)(objectClass=dhcpGroup)(objectClass=dhcpHost))",array("dn","cn")); - $ldap->search("(objectClass=*)",array("dn","cn")); - while($attrs = $ldap->fetch()){ - $ret .= $attrs['dn']."\n"; - } - return($ret); - } - - function getListEntry() { $fields = goService::getListEntry(); diff --git a/plugins/admin/systems/servdhcp.tpl b/plugins/admin/systems/servdhcp.tpl index 5d79af70c..846af22ff 100644 --- a/plugins/admin/systems/servdhcp.tpl +++ b/plugins/admin/systems/servdhcp.tpl @@ -2,20 +2,7 @@
-

{t}DHCP take over initiated{/t}

- {$warning} - {t}This includes 'all' DHCP subsections that are located within this server. Please double check if your really want to do this.{/t} -

- {$warning2} -
- -

-

- {t}Following objects will be taken over{/t} : -

-

-

{$info}
-

+

{t}DHCP take over will take place when saving this entry. Choose 'Cancel' to abort.{/t}

-- 2.30.2