summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-10-06 00:11:38 +0700
committergnhb <gnoahb@gmail.com>2010-10-06 00:11:38 +0700
commit7fa03a98aa034f4e75b5ae60a3309ba5d404bcc5 (patch)
tree8a8e6693259f4b9132558cec74957bcd695b46b2 /usr/local/www/system_gateways_edit.php
parent1ced293c958c8e506de4384749be7e78f4d07ac4 (diff)
downloadpfsense-7fa03a98aa034f4e75b5ae60a3309ba5d404bcc5.zip
pfsense-7fa03a98aa034f4e75b5ae60a3309ba5d404bcc5.tar.gz
Simplify this code so it's obvious what we're really testing for.
Should be no functional change here.
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index dfd703b..4848bed 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -195,11 +195,10 @@ if ($_POST) {
}
if (!$input_errors) {
- if (!(($_POST['weight'] && $_POST['weight'] > 1) || $_POST['latencylow'] || $_POST['latencyhigh'] ||
+ if (!($_POST['weight'] > 1 || $_POST['latencylow'] || $_POST['latencyhigh'] ||
$_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")))) {
+ $_POST['defaultgw'] || is_ipaddr($_POST['monitor']) || is_ipaddr($_POST['gateway']))) {
+ /* Delete from config if gw is dynamic and user is not saving any additional gateway data that system doesn't know */
if (isset($id) && $a_gateway_item[$id])
unset($a_gateway_item[$id]);
write_config();
OpenPOWER on IntegriCloud