r1384 + bugfix: Live VLANs displayed VLANs missing from switch table improperly
authorDenis Ovsienko <infrastation@yandex.ru>
Thu, 13 Dec 2007 17:56:29 +0000 (17:56 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 13 Dec 2007 17:56:29 +0000 (17:56 +0000)
ChangeLog
inc/interface.php

index 87e4b4ebc37371dd6972c05939f3796b7b380b87..891f7f4c5a90a932175e3758ee3df68a7cdb67ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
        bugfix: Cisco connector: tolerate switch ports in suspended state
        bugfix: nameless object in link list could not be clicked
        bugfix: fix SQL tables structure
+       bugfix: Live VLANs displayed VLANs missing from switch table improperly
        update: corrected some dictionary entries
        update: better layout for Live VLANs tab
        new feature: UI option to control asset tag warning
index 38b4e22781f9657bc50ae163514b0330bc964813..ffffa7be4092b3b1e7cbb00ad87561e3890a93d8 100644 (file)
@@ -3075,13 +3075,21 @@ function renderVLANMembership ($object_id = 0)
                else
                {
                        echo "<select name=vlanid_${portno}>";
+                       // A port may belong to a VLAN, which is absent from the VLAN table, this is normal.
+                       // We must be able to render its SELECT properly at least.
+                       $in_table = FALSE;
                        foreach ($vlanlist as $v => $d)
                        {
                                echo "<option value=${v}";
                                if ($v == $port['vlanid'])
+                               {
                                        echo ' selected';
-                               echo ">${v}</option>";
+                                       $in_table = TRUE;
+                               }
+                               echo ">${v}</option>\n";
                        }
+                       if (!$in_table)
+                               echo "<option value=${port['vlanid']} selected>${port['vlanid']}</option>\n";
                        echo "</select>";
                }
                $portno++;