diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-09-10 09:27:17 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-09-10 09:27:17 +0000 |
commit | 934240efeb45a567968df27d0ced84ed007d41c2 (patch) | |
tree | 509fa1e2248e0b123d5e19b905c61184fe7f16af /usr/local/www/services_dhcp.php | |
parent | 12b3b339a0adbd798a7c408e56fc29dd8251cc38 (diff) | |
download | pfsense-934240efeb45a567968df27d0ced84ed007d41c2.zip pfsense-934240efeb45a567968df27d0ced84ed007d41c2.tar.gz |
* Correctly show dhcp tabs for the service
* Do not display tabs for the interface not elligible for running a dhcp service.
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 5a2f29a..12391ef 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -53,16 +53,10 @@ if($config['installedpackages']['olsrd']) { } } -$ifdescrs = get_configured_interface_with_descr(); +if (!$_GET['if']) + $savemsg = "<b>The DHCP Server can only be enabled on interfaces configured with static IP addresses.<p> The interfaces not configured with static ip will not be shown.</p></b>"; -foreach ($ifdescrs as $ifname => $ifdesc) { - $oc = $config['interfaces'][$ifname]; - - if (!is_ipaddr($oc['ipaddr']) && !$is_olsr_enabled) - $singleif_nostaticip = true; - else if ($oc['if']) - $iflist[$ifname] = $ifdesc; -} +$iflist = get_configured_interface_with_descr(); /* set the starting interface */ if($config['interfaces']['lan']) { @@ -379,13 +373,6 @@ function show_netboot_config() { echo "</html>"; exit; } - if ($singleif_nostaticip) { - echo "<b>The DHCP Server can only be enabled on interfaces configured with static IP addresses. Your interface is not configured with a static IP.</b>"; - include("fend.inc"); - echo "</body>"; - echo "</html>"; - exit; - } ?> <?php if (file_exists($d_staticmapsdirty_path)): ?><p> <?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> @@ -398,11 +385,22 @@ function show_netboot_config() { $tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) { + $oc = $config['interfaces'][$ifent]; + if (!is_ipaddr($oc['ipaddr'])) + continue; if ($ifent == $if) $active = true; else $active = false; $tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}"); + $tabscounter++; + } + if ($tabscounter == 0) { + echo "</td></tr></table></form>"; + include("fend.inc"); + echo "</body>"; + echo "</html>"; + exit; } display_top_tabs($tab_array); ?> |