Validate vlan interface before delete it

This commit is contained in:
Renato Botelho 2013-01-22 15:08:32 -02:00
parent eea7eb9984
commit e9b6e032bc

View File

@ -63,6 +63,8 @@ if ($_GET['act'] == "del") {
/* check if still in use */
if (vlan_inuse($_GET['id'])) {
$input_errors[] = gettext("This VLAN cannot be deleted because it is still being used as an interface.");
} elseif (!does_interface_exist($a_vlans[$_GET['id']]['vlanif'])) {
$input_errors[] = gettext("Invalid VLAN interface.");
} else {
mwexec("/sbin/ifconfig " . $a_vlans[$_GET['id']]['vlanif'] . " destroy");
unset($a_vlans[$_GET['id']]);