From 01fdb2d38a2e789f1dfa10899ca07d9eca290f35 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sat, 20 Mar 2010 07:17:41 -0600 Subject: 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. --- usr/local/www/services_dhcp.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'usr/local/www/services_dhcp.php') 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])){ -- cgit v1.1