diff options
author | Renato Botelho <renato@netgate.com> | 2016-12-12 16:24:44 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-12-12 16:44:18 -0200 |
commit | f6e519ec4b4eb21ed123e154a78aa763757a2ad8 (patch) | |
tree | 7c590e416c8320aa559802c14137b6e1fda52ab3 /src | |
parent | e4830f024bc06c4fad9a545c3ead724b82a6b803 (diff) | |
download | pfsense-f6e519ec4b4eb21ed123e154a78aa763757a2ad8.zip pfsense-f6e519ec4b4eb21ed123e154a78aa763757a2ad8.tar.gz |
Fix #6976: Make sure interface description, interface name and alias don't have the same name
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/firewall_aliases_edit.php | 9 | ||||
-rw-r--r-- | src/usr/local/www/firewall_aliases_import.php | 9 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_groups_edit.php | 9 |
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 c1ae2f1..dfc1557 100644 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -202,6 +202,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 c4fe8a6..aa941d1 100644 --- a/src/usr/local/www/firewall_aliases_import.php +++ b/src/usr/local/www/firewall_aliases_import.php @@ -122,6 +122,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 0411ecd..214e31b 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -109,6 +109,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 { |