diff options
author | Renato Botelho <renato@netgate.com> | 2016-01-22 08:59:59 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-01-22 08:59:59 -0200 |
commit | b824f18c9f14dcae22f9f155bd733df2fd56d44c (patch) | |
tree | 36c570880142eb15abe0acf7494c923d5be4ba87 /src | |
parent | 24049bb6cc494bd0bb367a0af8b1ab495964b1fa (diff) | |
download | pfsense-b824f18c9f14dcae22f9f155bd733df2fd56d44c.zip pfsense-b824f18c9f14dcae22f9f155bd733df2fd56d44c.tar.gz |
Remove redundant alias check and move group check to proper place, fixes #5795
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/interfaces.php | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 3febf6e..465bf2f 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -280,22 +280,6 @@ $pconfig['dhcp_plus'] = isset($wancfg['dhcp_plus']); $pconfig['descr'] = remove_bad_chars($wancfg['descr']); $pconfig['enable'] = isset($wancfg['enable']); -if (is_array($config['aliases']['alias'])) { - foreach ($config['aliases']['alias'] as $alias) { - if ($alias['name'] == $wancfg['descr']) { - $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists. Interfaces cannot have the same name as an alias."), $wancfg['descr']); - } - } -} - -if (is_array($config['ifgroups']['ifgroupentry'])) { - foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) { - if ($ifgroupentry['ifname'] == $wancfg['descr']) { - $input_errors[] = sprintf(gettext("Sorry, an interface group with the name %s already exists. Interfaces cannot have the same name as an interface group."), $wancfg['descr']); - } - } -} - switch ($wancfg['ipaddr']) { case "dhcp": $pconfig['type'] = "dhcp"; @@ -558,6 +542,15 @@ if ($_POST['apply']) { } } + /* 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['descr']) { + $input_errors[] = sprintf(gettext("Sorry, an interface group with the name %s already exists."), $wancfg['descr']); + } + } + } + if (is_numeric($_POST['descr'])) { $input_errors[] = gettext("The interface description cannot contain only numbers."); } |