[Kimchi-devel] [PATCH 2/3] Issue 294 The auto logout leaves action menu on page - add classes

Adam King rak at linux.vnet.ibm.com
Mon Mar 10 16:21:23 UTC 2014


When the user session ends, content that should no longer be visible
to the unauthenticated user is left in the DOM. The issue as written
notes that the guest action menu is displayed above the login window,
leading to a buggy user experience. Information about the users
guests, storage pools, networks, etc may also be left visible in the
browser.

This patch uses classes remove-when-logged-off and empty-when-logged-off
to mark those parts of the DOM that should no longer be available to
the user after the session has ended.

Signed-off-by: Adam King <rak at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.window.js        | 2 +-
 ui/pages/kimchi-ui.html.tmpl      | 2 +-
 ui/pages/tabs/guests.html.tmpl    | 2 +-
 ui/pages/tabs/host.html.tmpl      | 2 +-
 ui/pages/tabs/network.html.tmpl   | 2 +-
 ui/pages/tabs/storage.html.tmpl   | 2 +-
 ui/pages/tabs/templates.html.tmpl | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ui/js/src/kimchi.window.js b/ui/js/src/kimchi.window.js
index c2af63e..29bd6e1 100644
--- a/ui/js/src/kimchi.window.js
+++ b/ui/js/src/kimchi.window.js
@@ -33,7 +33,7 @@ kimchi.window = (function() {
         _listeners[windowID] = settings['close'];
         var windowNode = $('<div></div>', {
             id: windowID,
-            'class': settings['class'] ? settings['class'] + ' bgmask' : 'bgmask'
+            'class': settings['class'] ? settings['class'] + ' bgmask remove-when-logged-off' : 'bgmask remove-when-logged-off'
         });
 
         $(windowNode).css(settings['style'] || '');
diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl
index abc67c3..eb3cd9d 100644
--- a/ui/pages/kimchi-ui.html.tmpl
+++ b/ui/pages/kimchi-ui.html.tmpl
@@ -72,7 +72,7 @@
         <li>
             <div id="user" class="popable">
                 <span id="user-icon"></span>
-                <span id="user-name"></span>
+                <span id="user-name" class="empty-when-logged-off"></span>
                 <span class="arrow"></span>
                 <div class="action-panel popover right-side">
                     <a id="btn-help" class="user-menu-item" href="javascript:void(0);">$_("Help")</a>
diff --git a/ui/pages/tabs/guests.html.tmpl b/ui/pages/tabs/guests.html.tmpl
index 8ab51b3..3aa2fdd 100644
--- a/ui/pages/tabs/guests.html.tmpl
+++ b/ui/pages/tabs/guests.html.tmpl
@@ -41,7 +41,7 @@
             <li class="guest-tile">$_("Livetile")</li>
             <li class="guest-actions">$_("Actions")</li>
         </ul>
-        <ul id="guestList" class="list-vm">
+        <ul id="guestList" class="list-vm empty-when-logged-off">
         </ul>
     </div>
     <div id="noGuests" class="list-no-result" style="display: none;">
diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl
index 23b9853..52f849b 100644
--- a/ui/pages/tabs/host.html.tmpl
+++ b/ui/pages/tabs/host.html.tmpl
@@ -27,7 +27,7 @@
         <div class="tools">
         </div>
     </div>
-    <div id="host-content-container"></div>
+    <div id="host-content-container" class="empty-when-logged-off"></div>
 </div>
 
 <script id="host-tmpl" type="kimchi/template">
diff --git a/ui/pages/tabs/network.html.tmpl b/ui/pages/tabs/network.html.tmpl
index f298516..2397fd4 100644
--- a/ui/pages/tabs/network.html.tmpl
+++ b/ui/pages/tabs/network.html.tmpl
@@ -40,7 +40,7 @@
      --><span class="column column-space">$_("Address Space")</span><!--
      --><span class="column">$_("Actions")</span>
         </div>
-        <div id="networkBody"></div>
+        <div id="networkBody" class="empty-when-logged-off"></div>
     </div>
     <div id="networkConfig" class="network-config">
         <div class="section-container">
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index c20c954..c3a992e 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -39,7 +39,7 @@
         <li class="title-allocate">$_("Allocated")</li>
         <li class="title-actions">$_("Actions")</li>
     </div>
-    <ul id="storagepoolsList" class="list-storage"></ul>
+    <ul id="storagepoolsList" class="list-storage empty-when-logged-off"></ul>
 </div>
 <script id="storageTmpl" type="html/text">
     <li id="{name}">
diff --git a/ui/pages/tabs/templates.html.tmpl b/ui/pages/tabs/templates.html.tmpl
index 5fc3173..b6edbaf 100644
--- a/ui/pages/tabs/templates.html.tmpl
+++ b/ui/pages/tabs/templates.html.tmpl
@@ -34,7 +34,7 @@
         $_("No templates found.")
     </div>
 
-    <ul id="templateList"></ul>
+    <ul id="templateList" class="empty-when-logged-off"></ul>
 
     <script id="templateTmpl" type="html/text">
 
-- 
1.8.1.4




More information about the Kimchi-devel mailing list