From 1ca626e7b824cbff5d1aa87c4e416373fcc1a2d9 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 12 Aug 2013 18:16:18 +0000 Subject: [PATCH] Prevent assigned vlans from being changed the tag. --- usr/local/www/interfaces_vlan_edit.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/local/www/interfaces_vlan_edit.php b/usr/local/www/interfaces_vlan_edit.php index 524f9f3f0c..ced86114aa 100755 --- a/usr/local/www/interfaces_vlan_edit.php +++ b/usr/local/www/interfaces_vlan_edit.php @@ -83,6 +83,12 @@ if ($_POST) { if (!does_interface_exist($_POST['if'])) $input_errors[] = gettext("Interface supplied as parent is invalid"); + if (isset($id)) { + if ($_POST['tag'] && $_POST['tag'] != $a_vlans[$id]['tag']) { + if (!empty($a_vlans[$id]['vlanif']) && convert_real_interface_to_friendly_interface_name($a_vlans[$id]['vlanif']) != NULL) + $input_errors[] = gettext("Interface is assigned and you cannot change the VLAN tag while assigned."); + } + } foreach ($a_vlans as $vlan) { if (isset($id) && ($a_vlans[$id]) && ($a_vlans[$id] === $vlan)) continue;