summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-05-17 19:00:06 -0400
committerDarren Embry <dse@webonastick.com>2012-05-17 19:00:06 -0400
commit283d78c6321db31df913ad02a57301f698bffa79 (patch)
tree6b1e59946c88b99c0ebc0c8e307d5a7e74ff02b7 /usr/local/www/system_gateways_edit.php
parenta0edece98b120926a5af6d4502e1a2c4c835e52c (diff)
downloadpfsense-283d78c6321db31df913ad02a57301f698bffa79.zip
pfsense-283d78c6321db31df913ad02a57301f698bffa79.tar.gz
bug fix for #2426
Input validaton on interface gateway creation box needs to reject duplicate names
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 3fc6a0a..97fe7de 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -106,7 +106,7 @@ if ($_POST) {
$input_errors[] = gettext("The gateway name must not contain invalid characters.");
}
/* skip system gateways which have been automatically added */
- if (($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($_POST['attribute'] != "system")) && ($_POST['gateway'] != "dynamic")) {
+ if (($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($_POST['attribute'] !== "system")) && ($_POST['gateway'] != "dynamic")) {
$input_errors[] = gettext("A valid gateway IP address must be specified.");
}
@@ -157,26 +157,33 @@ if ($_POST) {
if (isset($_POST['name'])) {
/* check for overlaps */
+ log_error(print_r($a_gateways, true));
foreach ($a_gateways as $gateway) {
+ log_error(print_r($gateway, true));
if (isset($id) && ($a_gateways[$id]) && ($a_gateways[$id] === $gateway)) {
if ($gateway['name'] != $_POST['name'])
$input_errors[] = gettext("Changing name on a gateway is not allowed.");
continue;
}
if($_POST['name'] <> "") {
- if (($gateway['name'] <> "") && ($_POST['name'] == $gateway['name']) && ($gateway['attribute'] != "system")) {
+ log_error("\$_POST['name'] = [{$_POST['name']}]");
+ log_error("name = [{$gateway['name']}]");
+ log_error("attribute = [{$gateway['attribute']}]");
+ if (($gateway['name'] <> "") && ($_POST['name'] == $gateway['name']) && ($gateway['attribute'] !== "system")) {
+ log_error("-> is a dup");
$input_errors[] = sprintf(gettext('The gateway name "%s" already exists.'), $_POST['name']);
break;
}
+ log_error("-> is not a dup");
}
if(is_ipaddr($_POST['gateway'])) {
- if (($gateway['gateway'] <> "") && ($_POST['gateway'] == $gateway['gateway']) && ($gateway['attribute'] != "system")) {
+ if (($gateway['gateway'] <> "") && ($_POST['gateway'] == $gateway['gateway']) && ($gateway['attribute'] !== "system")) {
$input_errors[] = sprintf(gettext('The gateway IP address "%s" already exists.'), $_POST['gateway']);
break;
}
}
if(is_ipaddr($_POST['monitor'])) {
- if (($gateway['monitor'] <> "") && ($_POST['monitor'] == $gateway['monitor']) && ($gateway['attribute'] != "system")) {
+ if (($gateway['monitor'] <> "") && ($_POST['monitor'] == $gateway['monitor']) && ($gateway['attribute'] !== "system")) {
$input_errors[] = sprintf(gettext('The monitor IP address "%s" is already in use. You must choose a different monitor IP.'), $_POST['monitor']);
break;
}
OpenPOWER on IntegriCloud