summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-03-20 07:17:41 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-03-20 07:17:41 -0600
commit01fdb2d38a2e789f1dfa10899ca07d9eca290f35 (patch)
tree2449cc141a7edb4ce27f6b95c387160e0b0317dd /usr/local/www/services_dhcp.php
parent9d537f9f0240d0a2cc7c4d7d5fd91f3ff6e6e31c (diff)
downloadpfsense-01fdb2d38a2e789f1dfa10899ca07d9eca290f35.zip
pfsense-01fdb2d38a2e789f1dfa10899ca07d9eca290f35.tar.gz
To pick the starting tab on Services: DHCP server, use the same logic as used for creating tabs to make sure the first tab really gets selected.
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-xusr/local/www/services_dhcp.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index e8b7a0e..e4697a8 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -119,10 +119,14 @@ $iflist = get_configured_interface_with_descr();
/* set the starting interface */
if (!$if || !isset($iflist[$if])) {
- if($config['interfaces']['lan'])
- $if = "lan";
- else
- $if = "wan";
+ foreach ($iflist as $ifent => $ifname) {
+ $oc = $config['interfaces'][$ifent];
+ if ((is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && (!is_ipaddr($oc['ipaddr']))) ||
+ (!is_array($config['dhcpd'][$ifent]) && (!is_ipaddr($oc['ipaddr']))))
+ continue;
+ $if = $ifent;
+ break;
+ }
}
if (is_array($config['dhcpd'][$if])){
OpenPOWER on IntegriCloud