From fbb45bb034aad683b2bd207a497d0cfc0b1b5a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Sat, 21 Jun 2008 17:13:18 +0000 Subject: Continue interface improvements --- usr/local/www/interfaces_lan.php | 28 +++++++++++++--------------- usr/local/www/interfaces_ppp.php | 18 ++++++------------ usr/local/www/interfaces_vlan.php | 10 +++------- usr/local/www/load_balancer_pool_edit.php | 15 ++++----------- usr/local/www/services_captiveportal.php | 16 +++++----------- usr/local/www/services_dhcp.php | 23 +++++++---------------- 6 files changed, 38 insertions(+), 72 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/interfaces_lan.php b/usr/local/www/interfaces_lan.php index ad2867d..9cbb04e 100755 --- a/usr/local/www/interfaces_lan.php +++ b/usr/local/www/interfaces_lan.php @@ -50,15 +50,16 @@ if ($_POST) { if ($_POST['bridge']) { /* double bridging? */ - for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { - if ($i != $index) { - if ($config['interfaces']['opt' . $i]['bridge'] == $_POST['bridge']) { - //$input_errors[] = "Optional interface {$i} " . - // "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " . + $iflist = get_configured_interface_list(true, true); + foreach ($iflist as $if) { + if ($if != $index) { /* XXX: totaly bogus */ + if ($config['interfaces'][$if]['bridge'] == $_POST['bridge']) { + //$input_errors[] = "Optional interface {$if} " . + // "({$config['interfaces'][$if]['descr']}) is already bridged to " . // "the specified interface."; - } else if ($config['interfaces']['opt' . $i]['bridge'] == "opt{$index}") { - //$input_errors[] = "Optional interface {$i} " . - // "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " . + } else if ($config['interfaces'][$if]['bridge'] == $if) { + //$input_errors[] = "Optional interface {$if} " . + // "({$config['interfaces'][$if]['descr']}) is already bridged to " . // "this interface."; } } @@ -174,13 +175,10 @@ function enable_change(enable_over) { 'WAN'); - for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { - $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; - } + $interfaces = get_configured_interface_with_descr(false, true); foreach ($interfaces as $iface => $ifacename) { + if ($iface == "lan") + continue; $ifinfo = get_interface_info($iface); if(isset($ifinfo['gateway'])) { ?> @@ -357,13 +356,7 @@ function clearcombo(){ 'LAN'); - else - $interfaces = array(); - for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { - if (isset($config['interfaces']['opt' . $i]['enable'])) - $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; - } + $interfaces = get_configured_interface_with_descr(); foreach ($interfaces as $iface => $ifacename): ?>