summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-12-21 15:27:20 +0100
committerSeth Mos <seth.mos@xs4all.nl>2009-12-21 15:27:20 +0100
commit2328dcc5f0fd5cd875ec15d47260d3626615bb0d (patch)
treec924961f54efe3240ea8ce94f7f51b816f1a9941 /usr
parentd30bbdd730e0fb86d913c3ab5cd529d83220a685 (diff)
downloadpfsense-2328dcc5f0fd5cd875ec15d47260d3626615bb0d.zip
pfsense-2328dcc5f0fd5cd875ec15d47260d3626615bb0d.tar.gz
Partial rewrite of gateway code, now partially facilitates dynamic interfaces
- Upgrade code takes different naming into account - Add gateway entries for dynamic interfaces - Rewrite status array to also support dynamic interfaces. - Always use unique localhost monitor IP addresses for down dynamic interfaces - Accept the gateway IP address of "dynamic" on the gateway edit page
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_gateways_edit.php31
1 files changed, 19 insertions, 12 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 170f071..20f303d 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -90,7 +90,7 @@ if ($_POST) {
$input_errors[] = "The gateway name must not contain invalid characters.";
}
/* skip system gateways which have been automatically added */
- if ($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($pconfig['attribute'] != "system")) {
+ if (($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($pconfig['attribute'] != "system")) && (! $_POST['gateway'] == "dynamic")) {
$input_errors[] = "A valid gateway IP address must be specified.";
}
if ($_POST['gateway'] && (is_ipaddr($_POST['gateway'])) && ($pconfig['attribute'] != "system")) {
@@ -107,20 +107,26 @@ if ($_POST) {
if (isset($_POST['name'])) {
/* check for overlaps */
foreach ($a_gateways as $gateway) {
- if (isset($id) && ($a_gateways[$id]) && ($a_gateways[$id] === $gateway))
+ if (isset($id) && ($a_gateways[$id]) && ($a_gateways[$id] === $gateway)) {
continue;
-
- if (($gateway['name'] <> "") && (in_array($_POST['name'], $gateway)) && ($gateway['attribute'] != "system")) {
- $input_errors[] = "The gateway name \"{$_POST['name']}\" already exists.";
- break;
}
- if (($gateway['gateway'] <> "") && (in_array($_POST['gateway'], $gateway)) && ($gateway['attribute'] != "system")) {
- $input_errors[] = "The gateway IP address \"{$_POST['gateway']}\" already exists.";
- break;
+ if($_POST['name'] <> "") {
+ if (($gateway['name'] <> "") && (in_array($_POST['name'], $gateway)) && ($gateway['attribute'] != "system")) {
+ $input_errors[] = "The gateway name \"{$_POST['name']}\" already exists.";
+ break;
+ }
+ }
+ if(is_ipaddr($_POST['gateway'])) {
+ if (($gateway['gateway'] <> "") && (in_array($_POST['gateway'], $gateway)) && ($gateway['attribute'] != "system")) {
+ $input_errors[] = "The gateway IP address \"{$_POST['gateway']}\" already exists.";
+ break;
+ }
}
- if (($gateway['monitorip'] <> "") && (in_array($_POST['monitor'], $gateway)) && ($gateway['attribute'] != "system")) {
- $input_errors[] = "The monitor IP address \"{$_POST['monitor']}\" is already in use. You must choose a different monitor IP.";
- break;
+ if(is_ipaddr($_POST['monitor'])) {
+ if (($gateway['monitor'] <> "") && (in_array($_POST['monitor'], $gateway)) && ($gateway['attribute'] != "system")) {
+ $input_errors[] = "The monitor IP address \"{$_POST['monitor']}\" is already in use. You must choose a different monitor IP.";
+ break;
+ }
}
}
}
@@ -180,6 +186,7 @@ if ($_POST) {
}
}
+
$pgtitle = array("System","Gateways","Edit gateway");
include("head.inc");
OpenPOWER on IntegriCloud