From: hickert Date: Mon, 10 Sep 2007 08:29:12 +0000 (+0000) Subject: Hide take over option if there is no dhcp configuration to take over. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a305fa86dbdd1bb3b26f04b5d8f9f1c0f81ebbbe;p=gosa.git Hide take over option if there is no dhcp configuration to take over. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7235 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servDHCP.inc b/plugins/admin/systems/class_servDHCP.inc index 69f6d9547..ce22ef93a 100644 --- a/plugins/admin/systems/class_servDHCP.inc +++ b/plugins/admin/systems/class_servDHCP.inc @@ -69,6 +69,12 @@ class servdhcp extends plugin $ldap->cd($this->config->current['BASE']); $ldap->search("(&(objectClass=goServer)(dhcpServiceDN=*))",array("dn","cn","dhcpServiceDN")); while($attrs = $ldap->fetch()){ + + /* Skip own config */ + if($this->dn != "new" && preg_match("/".normalizePreg($this->dn)."$/",$attrs['dn'])){ + continue; + } + $ret['ENTRIES'][] = $attrs; } foreach($ret['ENTRIES'] as $key => $data){ @@ -109,6 +115,7 @@ class servdhcp extends plugin /* Give smarty the required informations */ $smarty->assign("dhcp_server_list", $this->dhcp_server_list['FOR_LIST']); + $smarty->assign("dhcp_server_list_cnt", count($this->dhcp_server_list['FOR_LIST'])); /* Take over requested, save id */ if(isset($_POST['take_over_src']) && isset($_POST['take_over'])){ diff --git a/plugins/admin/systems/servdhcp.tpl b/plugins/admin/systems/servdhcp.tpl index 69331f271..1c2e44332 100644 --- a/plugins/admin/systems/servdhcp.tpl +++ b/plugins/admin/systems/servdhcp.tpl @@ -21,6 +21,7 @@ {else} +{if $dhcp_server_list_cnt} +{/if}
{t}Take over dhcp configuration from following server{/t}  @@ -30,6 +31,7 @@

{t}DHCP sections{/t}