diff options
author | Renato Botelho <renato@netgate.com> | 2015-07-18 14:36:05 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-07-18 14:36:05 -0300 |
commit | 117948fdaa89fe78327eea9d914fe8474743f9fb (patch) | |
tree | fa1748dce8ccb301693302ac55c7e85ec21b4057 /usr/local/www/system_routes_edit.php | |
parent | 2353f74c7af235637cda1a774455ffb5665d61d2 (diff) | |
parent | 205178aa8277442587aae5db76ff5510ebdcc5c9 (diff) | |
download | pfsense-117948fdaa89fe78327eea9d914fe8474743f9fb.zip pfsense-117948fdaa89fe78327eea9d914fe8474743f9fb.tar.gz |
Merge pull request #1738 from phil-davis/Static-Routes
Diffstat (limited to 'usr/local/www/system_routes_edit.php')
-rw-r--r-- | usr/local/www/system_routes_edit.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index 4654232..a64580b 100644 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -106,9 +106,13 @@ if ($_POST) { if (($_POST['gateway']) && is_ipaddr($_POST['network'])) { if (!isset($a_gateways[$_POST['gateway']])) { $input_errors[] = gettext("A valid gateway must be specified."); - } - if (!validate_address_family($_POST['network'], $_POST['gateway'])) { - $input_errors[] = gettext("The gateway '{$a_gateways[$_POST['gateway']]['gateway']}' is a different Address Family as network '{$_POST['network']}'."); + } else if (isset($a_gateways[$_POST['gateway']]['disabled']) && !$_POST['disabled']) { + $input_errors[] = gettext("The gateway is disabled but the route is not. You must disable the route in order to choose a disabled gateway."); + } else { + // Note that the 3rd parameter "disabled" must be passed as explicitly true or false. + if (!validate_address_family($_POST['network'], $_POST['gateway'], $_POST['disabled'] ? true : false)) { + $input_errors[] = gettext("The gateway '{$a_gateways[$_POST['gateway']]['gateway']}' is a different Address Family than network '{$_POST['network']}'."); + } } } |