diff options
author | Ermal <eri@pfsense.org> | 2010-10-01 17:03:06 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-10-01 17:03:06 +0000 |
commit | c568e6828107ee211bda109f3dee509b134b71b9 (patch) | |
tree | 47ff6738c1920f30370cb60da7a1697dcd58a9a0 /usr | |
parent | 78ae2b1406d4651d408bb2db843d531dc9dffd08 (diff) | |
download | pfsense-c568e6828107ee211bda109f3dee509b134b71b9.zip pfsense-c568e6828107ee211bda109f3dee509b134b71b9.tar.gz |
Handle the cases to not save data on config better.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 22c2959..08f04e9 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -194,9 +194,13 @@ if ($_POST) { if (!$input_errors) { if (!(($_POST['weight'] && $_POST['weight'] > 1) || $_POST['latencylow'] || $_POST['latencyhigh'] || - $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || $_POST['defaultgw'] || - (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic") || - (empty($_POST['monitor']) || $_POST['monitor'] == "dynamic"))) { + $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || + ($_POST['defaultgw'] && !$pconfig['defaultgw']) || (!$_POST['defaultgw'] && $pconfig['defaultgw']) || + (empty($_POST['monitor']) || (!empty($_POST['gateway']) && $_POST['gateway'] != "dynamic")) || + (empty($_POST['monitor']) || (!empty($_POST['monitor']) && $_POST['monitor'] != "dynamic")))) { + if (isset($id) && $a_gateway_item[$id]) + unset($a_gateway_item[$id]); + write_config(); header("Location: system_gateways.php"); exit; } |