[PATCH 0/4] Issue 294: The auto logout leaves action menu on page

The defect reported that the kimchi UI overlays the login form over whatever is being displayed when the session becomes invalid. The defect describes how open menus are left above part of the login overlay in the zOrder, leaving an undesirable visual mashup. Additionally, information about the userID and the defined VMs remained visible (if grayed), representing a potential security exposure. This patch series removes any information from the UI that could be deemed sensitive whenever the session times out, defines a message to be displayed when the host can't be reached, and corrects the error flow to propagate all available information to the final error handler. Adam King (4): Create new error message to be displayed when we get an unexpeted ajax error Fix formatting of the requestJSON function Pass ajaxError information on to original requester on ajaxError event Issue 294 The auto logout leaves action menu on page po/en_US.po | 19 ++++++++++++++++++- po/kimchi.pot | 19 ++++++++++++++++++- po/pt_BR.po | 23 ++++++++++++++++++++++- po/zh_CN.po | 19 ++++++++++++++++++- ui/js/src/kimchi.api.js | 2 +- ui/js/src/kimchi.guest_main.js | 9 +++++++-- ui/js/src/kimchi.main.js | 6 +++++- ui/pages/i18n.html.tmpl | 1 + ui/pages/kimchi-ui.html.tmpl | 2 +- ui/pages/tabs/guests.html.tmpl | 2 +- 10 files changed, 92 insertions(+), 10 deletions(-) -- 1.8.1.4

While recreating and testing issue 294, I discovered that we were not handling and reporting ajax failures that did not include a JSON response. This happens when the server is unreachable due to network connectivity or the server being down. This patch added a message to be displayed in this case. Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- po/en_US.po | 19 ++++++++++++++++++- po/kimchi.pot | 19 ++++++++++++++++++- po/pt_BR.po | 23 ++++++++++++++++++++++- po/zh_CN.po | 19 ++++++++++++++++++- ui/pages/i18n.html.tmpl | 1 + 5 files changed, 77 insertions(+), 4 deletions(-) diff --git a/po/en_US.po b/po/en_US.po index aeff16e..6ea4181 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-25 15:23-0300\n" +"POT-Creation-Date: 2014-02-26 19:06-0500\n" "PO-Revision-Date: 2013-07-11 17:32-0400\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: English\n" @@ -151,6 +151,11 @@ msgstr "" msgid "options needed." msgstr "" +msgid "" +"Can not contact the host system. Verify the host system is up and that you " +"have network connectivity to it. HTTP request response %1. " +msgstr "" + msgid "Delete Confirmation" msgstr "Delete Confirmation" @@ -947,6 +952,18 @@ msgstr "" #, python-format msgid "" +"Unable to activate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" +"Unable to deactivate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" "Unable to deactivate pool %(name)s as it is associated with some templates" msgstr "" diff --git a/po/kimchi.pot b/po/kimchi.pot index abb7219..5ab87a8 100755 --- a/po/kimchi.pot +++ b/po/kimchi.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-25 15:23-0300\n" +"POT-Creation-Date: 2014-02-26 19:06-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -151,6 +151,11 @@ msgstr "" msgid "options needed." msgstr "" +msgid "" +"Can not contact the host system. Verify the host system is up and that you " +"have network connectivity to it. HTTP request response %1. " +msgstr "" + msgid "Delete Confirmation" msgstr "" @@ -935,6 +940,18 @@ msgstr "" #, python-format msgid "" +"Unable to activate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" +"Unable to deactivate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" "Unable to deactivate pool %(name)s as it is associated with some templates" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index db7c579..21f781b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-25 15:23-0300\n" +"POT-Creation-Date: 2014-02-26 19:06-0500\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: Aline Manera <alinefm@br.ibm.com>\n" @@ -169,6 +169,11 @@ msgstr "" msgid "options needed." msgstr "" +msgid "" +"Can not contact the host system. Verify the host system is up and that you " +"have network connectivity to it. HTTP request response %1. " +msgstr "" + msgid "Delete Confirmation" msgstr "Confirmação de remoção" @@ -344,10 +349,14 @@ msgstr "Gerar um novo relatório de depuração" msgid "Report Name" msgstr "Nome do Relatório" +#, fuzzy msgid "" "The name used to identify the report. If omitted, a name will be chosen " "based on current time. Name can contain: letters, digits and hyphen (\"-\")." msgstr "" +"O nome usado para identificar o relatório. Se omitido, o nome será escolhido " +"baseado no horário. O nome pode conter: letras, números, \"-\", \"_\", ou \"." +"\"." msgid "Define a New Storage Pool" msgstr "Definir novo Storage Pool" @@ -962,6 +971,18 @@ msgstr "" #, python-format msgid "" +"Unable to activate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" +"Unable to deactivate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" "Unable to deactivate pool %(name)s as it is associated with some templates" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 0439b04..622f435 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-25 15:23-0300\n" +"POT-Creation-Date: 2014-02-26 19:06-0500\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" "Language-Team: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" @@ -167,6 +167,11 @@ msgstr "" msgid "options needed." msgstr "" +msgid "" +"Can not contact the host system. Verify the host system is up and that you " +"have network connectivity to it. HTTP request response %1. " +msgstr "" + msgid "Delete Confirmation" msgstr "删除确认" @@ -951,6 +956,18 @@ msgstr "" #, python-format msgid "" +"Unable to activate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" +"Unable to deactivate NFS storage pool %(name)s. NFS server %(server)s is " +"unreachable." +msgstr "" + +#, python-format +msgid "" "Unable to deactivate pool %(name)s as it is associated with some templates" msgstr "" diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl index b17bd7a..d713687 100644 --- a/ui/pages/i18n.html.tmpl +++ b/ui/pages/i18n.html.tmpl @@ -50,6 +50,7 @@ var i18n = { 'KCHAPI6004E': "$_("This is not a valid URL.")", 'KCHAPI6005E': "$_("No such data exsit.")", 'KCHAPI6006E': "$_("options needed.")", + 'KCHAPI6007E': "$_("Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. ")", 'KCHAPI6001M': "$_("Delete Confirmation")", 'KCHAPI6002M': "$_("OK")", -- 1.8.1.4

Fix formatting of the requestJSON function to match the other functions defined in kimchi.api.js. Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js index fdd9cfc..a0ef62d 100644 --- a/ui/js/src/kimchi.api.js +++ b/ui/js/src/kimchi.api.js @@ -37,7 +37,7 @@ var kimchi = { * user clicking the tab again. * Default to false. */ - requestJSON: function(settings) { + requestJSON : function(settings) { settings['originalError'] = settings['error']; settings['error'] = null; settings['kimchi'] = true; -- 1.8.1.4

The previous implementation on the ajaxError event did not pass along all the available information to the original caller. Corrected with this patch. Updated guest vms processing to use the additional information. Corrected the error handler to show the JSON response reason when available, and show the new error message whenever a response is not avail. Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 9 +++++++-- ui/js/src/kimchi.main.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bbc8051..74bf7ad 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -148,8 +148,13 @@ kimchi.listVmsAuto = function() { } kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000); - }, function(err) { - kimchi.message.error(err.responseJSON.reason); + }, function(errorResponse, textStatus, errorThrown) { + if(errorResponse.responseJSON && errorResponse.responseJSON.reason) { + kimchi.message.error(errorResponse.responseJSON.reason); + } + else { + kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", errorResponse.state())); + } kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000); }); }; diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index c9d56e4..6bae95f 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -163,7 +163,9 @@ kimchi.main = function() { return; } - ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR); + if(ajaxSettings['originalError']) { + jqXHR.fail(ajaxSettings['originalError']); + } }); kimchi.user.showUser(true); -- 1.8.1.4

On 02/27/2014 08:47 AM, Adam King wrote:
The previous implementation on the ajaxError event did not pass along all the available information to the original caller. Corrected with this patch. Updated guest vms processing to use the additional information. Corrected the error handler to show the JSON response reason when available, and show the new error message whenever a response is not avail.
Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 9 +++++++-- ui/js/src/kimchi.main.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bbc8051..74bf7ad 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -148,8 +148,13 @@ kimchi.listVmsAuto = function() { }
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000); - }, function(err) { - kimchi.message.error(err.responseJSON.reason); + }, function(errorResponse, textStatus, errorThrown) {
+ if(errorResponse.responseJSON && errorResponse.responseJSON.reason) { + kimchi.message.error(errorResponse.responseJSON.reason); + } + else { + kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", errorResponse.state())); + } Good point to include network failure here! Though seems need improvement. Consider this: server encounters an internal error which will cause a 5xx response code and our code will run into else{} block, because response body has no responseJSON defined for 5xx error. And in your last patch,
KCHAPI6007E tells user "Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. " which is wrong. Kimchi runs well and network is connected. In this case, user should be told "Some internal error occurs." or something likewise. In fact, I considered the error message improvement at a global viewpoint but still have no time to work on it. It's should be handled in every Ajax requests including this listVMsAuto() function. You can put this kind of code into the global Ajax error listener $(document).bind('ajaxError', ...) which is in kimchi.main.js as you touched below.
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000);
As we've known there's error with this part, why do we still continuously send this request that will continuously tell the user the same error message? Suggest not include this line as previous logic does.
}); }; diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index c9d56e4..6bae95f 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -163,7 +163,9 @@ kimchi.main = function() { return; }
- ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR);
+ if(ajaxSettings['originalError']) { + jqXHR.fail(ajaxSettings['originalError']); + } Seems it's unnecessary to make this change. Take a look at this whole block:
$(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { // ... code above ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR); }); It will run into this block only when some Ajax error occurs that we bind "ajaxError" event. So we only need to run the error callback directly without to bind it again to jqXHR.fail() function. it's a redundancy. Suggest keep this code without any change.
});
kimchi.user.showUser(true);

Thanks for taking the time to review.... A few comment responses inline below. On 2/26/2014 9:15 PM, Hongliang Wang wrote:
On 02/27/2014 08:47 AM, Adam King wrote:
The previous implementation on the ajaxError event did not pass along all the available information to the original caller. Corrected with this patch. Updated guest vms processing to use the additional information. Corrected the error handler to show the JSON response reason when available, and show the new error message whenever a response is not avail.
Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 9 +++++++-- ui/js/src/kimchi.main.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bbc8051..74bf7ad 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -148,8 +148,13 @@ kimchi.listVmsAuto = function() { }
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000); - }, function(err) { - kimchi.message.error(err.responseJSON.reason); + }, function(errorResponse, textStatus, errorThrown) {
+ if(errorResponse.responseJSON && errorResponse.responseJSON.reason) { + kimchi.message.error(errorResponse.responseJSON.reason); + } + else { + kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", errorResponse.state())); + } Good point to include network failure here! Though seems need improvement. Consider this: server encounters an internal error which will cause a 5xx response code and our code will run into else{} block, because response body has no responseJSON defined for 5xx error. And in your last patch,
KCHAPI6007E tells user "Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. " which is wrong. Kimchi runs well and network is connected. In this case, user should be told "Some internal error occurs." or something likewise.
In fact, I considered the error message improvement at a global viewpoint but still have no time to work on it. It's should be handled in every Ajax requests including this listVMsAuto() function. You can put this kind of code into the global Ajax error listener $(document).bind('ajaxError', ...) which is in kimchi.main.js as you touched below.
A good point. We do need to improve the overall error handling.
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000);
As we've known there's error with this part, why do we still continuously send this request that will continuously tell the user the same error message?
Suggest not include this line as previous logic does.
}); }; diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index c9d56e4..6bae95f 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -163,7 +163,9 @@ kimchi.main = function() { return; }
- ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR);
+ if(ajaxSettings['originalError']) { + jqXHR.fail(ajaxSettings['originalError']); + } Seems it's unnecessary to make this change. Take a look at this whole block:
$(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { // ... code above
ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR); });
It will run into this block only when some Ajax error occurs that we bind "ajaxError" event. So we only need to run the error callback directly without to bind it again to jqXHR.fail() function. it's a redundancy.
Suggest keep this code without any change. I see how it looks redundant, but it isn't. The previous code only
I thought about leaving it out, or altering the retry interval. I ultimately decided to keep it as is because it allows the user to begin using the server again almost as soon as it comes back up. The flashing error message is annoying, but I put that under the heading of improved error feedback. Its no worse than the other error feedback, just no better. We should probably think about improving error feedback on two axes: 1) improving the errors we can detect and the messages that describe them 2) improving how we communicate errors to the user. passed the single argument to the original error handler. If the response were not back, you are correct it would rebind the error handler. In this situation the response is back, so the original error handler is called immediately, but all the parameters are passed.
});
kimchi.user.showUser(true);
-- Adam King <rak@linux.vnet.ibm.com> IBM C&SI

On 02/27/2014 10:44 AM, Adam King wrote:
Thanks for taking the time to review.... A few comment responses inline below.
On 2/26/2014 9:15 PM, Hongliang Wang wrote:
On 02/27/2014 08:47 AM, Adam King wrote:
The previous implementation on the ajaxError event did not pass along all the available information to the original caller. Corrected with this patch. Updated guest vms processing to use the additional information. Corrected the error handler to show the JSON response reason when available, and show the new error message whenever a response is not avail.
Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_main.js | 9 +++++++-- ui/js/src/kimchi.main.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js index bbc8051..74bf7ad 100644 --- a/ui/js/src/kimchi.guest_main.js +++ b/ui/js/src/kimchi.guest_main.js @@ -148,8 +148,13 @@ kimchi.listVmsAuto = function() { }
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000); - }, function(err) { - kimchi.message.error(err.responseJSON.reason); + }, function(errorResponse, textStatus, errorThrown) {
+ if(errorResponse.responseJSON && errorResponse.responseJSON.reason) { + kimchi.message.error(errorResponse.responseJSON.reason); + } + else { + kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", errorResponse.state())); + } Good point to include network failure here! Though seems need improvement. Consider this: server encounters an internal error which will cause a 5xx response code and our code will run into else{} block, because response body has no responseJSON defined for 5xx error. And in your last patch,
KCHAPI6007E tells user "Can not contact the host system. Verify the host system is up and that you have network connectivity to it. HTTP request response %1. " which is wrong. Kimchi runs well and network is connected. In this case, user should be told "Some internal error occurs." or something likewise.
In fact, I considered the error message improvement at a global viewpoint but still have no time to work on it. It's should be handled in every Ajax requests including this listVMsAuto() function. You can put this kind of code into the global Ajax error listener $(document).bind('ajaxError', ...) which is in kimchi.main.js as you touched below.
A good point. We do need to improve the overall error handling.
kimchi.vmTimeout = window.setTimeout("kimchi.listVmsAuto();", 5000);
As we've known there's error with this part, why do we still continuously send this request that will continuously tell the user the same error message?
Suggest not include this line as previous logic does.
I thought about leaving it out, or altering the retry interval. I ultimately decided to keep it as is because it allows the user to begin using the server again almost as soon as it comes back up. The flashing error message is annoying, but I put that under the heading of improved error feedback. Its no worse than the other error feedback, just no better.
}); }; diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index c9d56e4..6bae95f 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -163,7 +163,9 @@ kimchi.main = function() { return; }
- ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR);
+ if(ajaxSettings['originalError']) { + jqXHR.fail(ajaxSettings['originalError']); + } Seems it's unnecessary to make this change. Take a look at this whole block:
$(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { // ... code above
ajaxSettings['originalError'] && ajaxSettings['originalError'](jqXHR); });
It will run into this block only when some Ajax error occurs that we bind "ajaxError" event. So we only need to run the error callback directly without to bind it again to jqXHR.fail() function. it's a redundancy.
Suggest keep this code without any change. I see how it looks redundant, but it isn't. The previous code only
We should probably think about improving error feedback on two axes: 1) improving the errors we can detect and the messages that describe them 2) improving how we communicate errors to the user. passed the single argument to the original error handler. If the response were not back, you are correct it would rebind the error handler. In this situation the response is back, so the original error handler is called immediately, but all the parameters are passed. OK. I see. It should be:
ajaxSettings['originalError'](jqXHR, textStatus, errorThrown);
});
kimchi.user.showUser(true);

The kimchi UI overlays the login form over whatever is being displayed when the session becomes invalid. The defect describes how open menus are left above part of the login overlay in the zOrder, leaving an undesirable visual mashup. Additionally, information about the userID and the defined VMs remained visible if grayed, representing a potential security exposure. This patch removes any information form the UI that could be deemed sensitive whenever the session times out. Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.main.js | 2 ++ ui/pages/kimchi-ui.html.tmpl | 2 +- ui/pages/tabs/guests.html.tmpl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index 6bae95f..80c49c0 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -156,6 +156,8 @@ kimchi.main = function() { if (jqXHR['status'] === 401) { kimchi.user.showUser(false); kimchi.previousAjax = ajaxSettings; + //$(".empty-when-logged-off").empty(function() {$(this).empty()}); + $(".empty-when-logged-off").empty(); kimchi.window.open({ url: 'login-window.html', id: 'login-window-wrapper' 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;"> -- 1.8.1.4

On 02/26/2014 09:47 PM, Adam King wrote:
The kimchi UI overlays the login form over whatever is being displayed when the session becomes invalid. The defect describes how open menus are left above part of the login overlay in the zOrder, leaving an undesirable visual mashup. Additionally, information about the userID and the defined VMs remained visible if grayed, representing a potential security exposure.
This patch removes any information form the UI that could be deemed sensitive whenever the session times out.
Signed-off-by: Adam King <rak@linux.vnet.ibm.com> --- ui/js/src/kimchi.main.js | 2 ++ ui/pages/kimchi-ui.html.tmpl | 2 +- ui/pages/tabs/guests.html.tmpl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index 6bae95f..80c49c0 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -156,6 +156,8 @@ kimchi.main = function() { if (jqXHR['status'] === 401) { kimchi.user.showUser(false); kimchi.previousAjax = ajaxSettings; + //$(".empty-when-logged-off").empty(function() {$(this).empty()});
You can remove the commented line above
+ $(".empty-when-logged-off").empty(); kimchi.window.open({ url: 'login-window.html', id: 'login-window-wrapper' 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;">
participants (3)
-
Adam King
-
Aline Manera
-
Hongliang Wang