diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-03-20 07:17:41 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-03-20 07:17:41 -0600 |
commit | 01fdb2d38a2e789f1dfa10899ca07d9eca290f35 (patch) | |
tree | 2449cc141a7edb4ce27f6b95c387160e0b0317dd | |
parent | 9d537f9f0240d0a2cc7c4d7d5fd91f3ff6e6e31c (diff) | |
download | pfsense-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.
-rwxr-xr-x | usr/local/www/services_dhcp.php | 12 |
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])){ |