From c6865c5ec250d04648f344190f7cfdf4ddb40046 Mon Sep 17 00:00:00 2001 From: Ermal Date: Sat, 2 Oct 2010 07:29:11 +0000 Subject: Fix intended behaviour when the default gateway changes interface. --- usr/local/www/system_gateways_edit.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index d1fcd30..dfd703b 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -208,7 +208,7 @@ if ($_POST) { } - $reloadif = false; + $reloadif = ""; $gateway = array(); if (empty($_POST['interface'])) @@ -229,8 +229,8 @@ if ($_POST) { $i = 0; foreach($a_gateway_item as $gw) { unset($config['gateways']['gateway_item'][$i]['defaultgw']); - if ($gw['interface'] != $_POST['interface']) - $reloadif = true; + if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) + $reloadif = $gw['interface']; $i++; } $gateway['defaultgw'] = true; @@ -260,8 +260,8 @@ if ($_POST) { if($_REQUEST['isAjax']) { echo $_POST['name']; exit; - } else if ($reloadif == true) - send_event("interface reconfigure {$_POST['interface']}"); + } else if (!empty($reloadif)) + send_event("interface reconfigure {$reloadif}"); header("Location: system_gateways.php"); exit; -- cgit v1.1