diff --git a/src/www/system_gateways_edit.php b/src/www/system_gateways_edit.php index 8b17c36e5..f3c6f1fdf 100644 --- a/src/www/system_gateways_edit.php +++ b/src/www/system_gateways_edit.php @@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } - if (!$found) { + if (!$found && !isset($pconfig['fargw'])) { $input_errors[] = sprintf(gettext("The gateway address %1\$s does not lie within one of the chosen interface's subnets."), $pconfig['gateway']); } } @@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } - if (!$found) { + if (!$found && !isset($pconfig['fargw'])) { $input_errors[] = sprintf(gettext("The gateway address %1\$s does not lie within one of the chosen interface's subnets."), $pconfig['gateway']); } } @@ -402,12 +402,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $gateway[$fieldname] = $pconfig[$fieldname]; } } + if (isset($_POST['disabled'])) { $gateway['disabled'] = true; - } else { + } elseif (isset($gateway['disabled'])) { unset($gateway['disabled']); } + if (isset($_POST['fargw'])) { + $gateway['fargw'] = true; + } elseif (isset($gateway['fargw'])) { + unset($gateway['fargw']); + } + /* when saving the manual gateway we use the attribute which has the corresponding id */ if (isset($realid)) { $a_gateway_item[$realid] = $gateway; @@ -459,7 +466,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $copy_fields = array( 'name', 'weight', 'interval', 'avg_delay_samples', 'avg_loss_samples', 'avg_loss_delay_samples', 'interface', 'friendlyiface', 'ipprotocol', 'gateway', 'latencylow', 'latencyhigh', 'losslow', 'losshigh', - 'down', 'monitor', 'descr', 'avg_delay_samples_calculated', 'avg_loss_samples_calculated', + 'down', 'monitor', 'descr', 'avg_delay_samples_calculated', 'avg_loss_samples_calculated', 'fargw', 'avg_loss_delay_samples_calculated', 'monitor_disable', 'dynamic', 'defaultgw', 'force_down', 'disabled' ); foreach ($copy_fields as $fieldname) { @@ -633,6 +640,15 @@ $( document ).ready(function() { + + + + /> + + +