Project

General

Profile

« Previous | Next » 

Revision 7ec6e283

Added by Renato Botelho over 8 years ago

Fix #6976: Make sure interface description, interface name and alias don't have the same name

View differences:

src/usr/local/www/firewall_aliases_edit.php
170 170
		}
171 171
	}
172 172

  
173
	/* Is the description already used as an interface group name? */
174
	if (is_array($config['ifgroups']['ifgroupentry'])) {
175
		foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
176
			if ($ifgroupentry['ifname'] == $_POST['name']) {
177
				$input_errors[] = gettext("Sorry, an interface group with this name already exists.");
178
			}
179
		}
180
	}
181

  
173 182
	$alias = array();
174 183
	$address = array();
175 184
	$final_address_details = array();
src/usr/local/www/firewall_aliases_import.php
90 90
		}
91 91
	}
92 92

  
93
	/* Is the description already used as an interface group name? */
94
	if (is_array($config['ifgroups']['ifgroupentry'])) {
95
		foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) {
96
			if ($ifgroupentry['ifname'] == $_POST['name']) {
97
				$input_errors[] = gettext("Sorry, an interface group with this name already exists.");
98
			}
99
		}
100
	}
101

  
93 102
	if ($_POST['aliasimport']) {
94 103
		$tocheck = explode("\n", $_POST['aliasimport']);
95 104
		$imported_ips = array();
src/usr/local/www/interfaces_groups_edit.php
77 77
		}
78 78
	}
79 79

  
80
	/* Is the description already used as an alias name? */
81
	if (is_array($config['aliases']['alias'])) {
82
		foreach ($config['aliases']['alias'] as $alias) {
83
			if ($alias['name'] == $_POST['ifname']) {
84
				$input_errors[] = gettext("An alias with this name already exists.");
85
			}
86
		}
87
	}
88

  
80 89
	if (isset($_POST['members'])) {
81 90
		$members = implode(" ", $_POST['members']);
82 91
	} else {

Also available in: Unified diff