Project

General

Profile

« Previous | Next » 

Revision c568e682

Added by Ermal LUÇI almost 15 years ago

Handle the cases to not save data on config better.

View differences:

usr/local/www/system_gateways_edit.php
194 194

  
195 195
	if (!$input_errors) {
196 196
		if (!(($_POST['weight'] && $_POST['weight'] > 1) || $_POST['latencylow'] || $_POST['latencyhigh'] ||
197
		    $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || $_POST['defaultgw'] ||
198
		    (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic") ||
199
		    (empty($_POST['monitor']) || $_POST['monitor'] == "dynamic"))) {
197
		    $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] ||
198
		    ($_POST['defaultgw'] && !$pconfig['defaultgw']) || (!$_POST['defaultgw'] && $pconfig['defaultgw']) ||
199
		    (empty($_POST['monitor']) || (!empty($_POST['gateway']) && $_POST['gateway'] != "dynamic")) ||
200
		    (empty($_POST['monitor']) || (!empty($_POST['monitor']) && $_POST['monitor'] != "dynamic")))) {
201
			if (isset($id) && $a_gateway_item[$id])
202
				unset($a_gateway_item[$id]);
203
			write_config();
200 204
			header("Location: system_gateways.php");
201 205
			exit;
202 206
		}

Also available in: Unified diff