summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-12-12 16:24:44 -0200
committerRenato Botelho <renato@netgate.com>2016-12-12 16:43:38 -0200
commit7ec6e2831fe56514e90fcbd2beb5af52b7054ab6 (patch)
treea27762c230ac622ae080ef88950e292ce3690568 /src/usr
parentee5284ceba2e36453a68ff49e84f56b501a03cfb (diff)
downloadpfsense-7ec6e2831fe56514e90fcbd2beb5af52b7054ab6.zip
pfsense-7ec6e2831fe56514e90fcbd2beb5af52b7054ab6.tar.gz
Fix #6976: Make sure interface description, interface name and alias don't have the same name
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/firewall_aliases_edit.php9
-rw-r--r--src/usr/local/www/firewall_aliases_import.php9
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php9
3 files changed, 27 insertions, 0 deletions
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php
index ad34a39..12649c4 100644
--- a/src/usr/local/www/firewall_aliases_edit.php
+++ b/src/usr/local/www/firewall_aliases_edit.php
@@ -170,6 +170,15 @@ if ($_POST) {
}
}
+ /* Is the description already used as an interface group name? */
+ if (is_array($config['ifgroups']['ifgroupentry'])) {
+ foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
+ if ($ifgroupentry['ifname'] == $_POST['name']) {
+ $input_errors[] = gettext("Sorry, an interface group with this name already exists.");
+ }
+ }
+ }
+
$alias = array();
$address = array();
$final_address_details = array();
diff --git a/src/usr/local/www/firewall_aliases_import.php b/src/usr/local/www/firewall_aliases_import.php
index e70c453..81a3329 100644
--- a/src/usr/local/www/firewall_aliases_import.php
+++ b/src/usr/local/www/firewall_aliases_import.php
@@ -90,6 +90,15 @@ if ($_POST['aliasimport'] != "") {
}
}
+ /* Is the description already used as an interface group name? */
+ if (is_array($config['ifgroups']['ifgroupentry'])) {
+ foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
+ if ($ifgroupentry['ifname'] == $_POST['name']) {
+ $input_errors[] = gettext("Sorry, an interface group with this name already exists.");
+ }
+ }
+ }
+
if ($_POST['aliasimport']) {
$tocheck = explode("\n", $_POST['aliasimport']);
$imported_ips = array();
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index 7e96836..5b6e0bd 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -77,6 +77,15 @@ if ($_POST) {
}
}
+ /* Is the description already used as an alias name? */
+ if (is_array($config['aliases']['alias'])) {
+ foreach ($config['aliases']['alias'] as $alias) {
+ if ($alias['name'] == $_POST['ifname']) {
+ $input_errors[] = gettext("An alias with this name already exists.");
+ }
+ }
+ }
+
if (isset($_POST['members'])) {
$members = implode(" ", $_POST['members']);
} else {
OpenPOWER on IntegriCloud