Code

Hide take over option if there is no dhcp configuration to take over.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Sep 2007 08:29:12 +0000 (08:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Sep 2007 08:29:12 +0000 (08:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7235 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDHCP.inc
plugins/admin/systems/servdhcp.tpl

index 69f6d9547296a9330576fdfc01cc4001f526821f..ce22ef93a121ed058529c2dbe1a3bc1f0a1e3d2e 100644 (file)
@@ -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'])){
index 69331f271063e26bd92017569d1f53ac0436674f..1c2e4433225dbd1e381f635754b0742e15f25901 100644 (file)
@@ -21,6 +21,7 @@
 </table>
 {else}
 <table summary="" width="100%">
+{if $dhcp_server_list_cnt}
 <tr>
        <td style="width:100%;vertical-align:top;">
                <b>{t}Take over dhcp configuration from following server{/t}</b>&nbsp;
@@ -30,6 +31,7 @@
                <input type="submit" name="take_over" value="{t}Apply{/t}">
        </td>
 </tr>
+{/if}
 <tr>
        <td style="width:100%;vertical-align:top;">
        <h2>{t}DHCP sections{/t}</h2>