summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-10-01 17:03:06 +0000
committerErmal <eri@pfsense.org>2010-10-01 17:03:06 +0000
commitc568e6828107ee211bda109f3dee509b134b71b9 (patch)
tree47ff6738c1920f30370cb60da7a1697dcd58a9a0 /usr/local/www/system_gateways_edit.php
parent78ae2b1406d4651d408bb2db843d531dc9dffd08 (diff)
downloadpfsense-c568e6828107ee211bda109f3dee509b134b71b9.zip
pfsense-c568e6828107ee211bda109f3dee509b134b71b9.tar.gz
Handle the cases to not save data on config better.
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php10
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;
}
OpenPOWER on IntegriCloud