diff options
author | Ermal <eri@pfsense.org> | 2010-10-01 16:51:21 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-10-01 16:51:21 +0000 |
commit | 78ae2b1406d4651d408bb2db843d531dc9dffd08 (patch) | |
tree | 42059caa06a6c9ce24ec3258e0a71f9aa29c6f71 /usr | |
parent | d44d26c13ea8e1bc13657f0a186c3cfda7b28d47 (diff) | |
download | pfsense-78ae2b1406d4651d408bb2db843d531dc9dffd08.zip pfsense-78ae2b1406d4651d408bb2db843d531dc9dffd08.tar.gz |
Make sure we do not overwrite the gateway stored in config with a dynamic gateway info. Correct POST var name(Found by ghnb). Also correctly reload only the defaultgw interface changed only if it is different than the present one.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 3e5c916..22c2959 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -110,7 +110,7 @@ if ($_POST) { if ($_POST['gateway'] && (is_ipaddr($_POST['gateway'])) && !$_REQUEST['isAjax']) { if (!empty($config['interfaces'][$_POST['interface']]['ipaddr'])) { - if (is_ipaddr($config['interfaces'][$_POST['interface']]['ipaddr']) && $_POST['gateway'] == "dynamic") + if (is_ipaddr($config['interfaces'][$_POST['interface']]['ipaddr']) && (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic")) $input_errors[] = gettext("Dynamic gateway values cannot be specified for interfaces with a static ip configuration."); } $parent_ip = get_interface_ip($_POST['interface']); @@ -195,8 +195,8 @@ if ($_POST) { if (!$input_errors) { if (!(($_POST['weight'] && $_POST['weight'] > 1) || $_POST['latencylow'] || $_POST['latencyhigh'] || $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || $_POST['defaultgw'] || - ($_POST['gateway'] && $_POST['gateway'] != "dynamic") || - ($_POST['monitorip'] && $_POST['monitor'] != "dynamic"))) { + (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic") || + (empty($_POST['monitor']) || $_POST['monitor'] == "dynamic"))) { header("Location: system_gateways.php"); exit; } @@ -223,10 +223,11 @@ if ($_POST) { $i = 0; foreach($a_gateway_item as $gw) { unset($config['gateways']['gateway_item'][$i]['defaultgw']); + if ($gw['interface'] != $_POST['interface']) + $reloadif = true; $i++; } $gateway['defaultgw'] = true; - $reloadif = true; } if ($_POST['latencylow']) |