CLOUDSTACK-7809: UI > remove usage of g_mySession which is unnecessary.

This commit is contained in:
Jessica Wang 2014-10-29 11:14:58 -07:00
parent 070e689c4f
commit 58455c08c4
2 changed files with 4 additions and 29 deletions

View File

@ -93,26 +93,6 @@
message: parseXMLHttpResponse(data),
clickAction: clickAction
});
},
beforeSend: function(XMLHttpRequest) {
if (g_mySession == $.cookie("JSESSIONID")) {
return true;
} else {
var clickAction = function() {
$('#user-options a').eq(0).trigger('click');
};
if ($('.notification-box:visible').size()) {
$('.notification-box, div.overlay:first').remove();
}
cloudStack.dialog.notice({
message: _l('label.session.expired'),
clickAction: clickAction
}).closest('.ui-dialog').overlay();
return false;
}
}
});
@ -137,7 +117,6 @@
}
return cookieValue;
};
g_mySession = $.cookie('JSESSIONID');
g_sessionKey = unBoxCookieValue('sessionKey');
g_role = unBoxCookieValue('role');
g_userid = unBoxCookieValue('userid');
@ -147,7 +126,6 @@
g_userfullname = unBoxCookieValue('userfullname');
g_timezone = unBoxCookieValue('timezone');
} else { //single-sign-on (bypass login screen)
g_mySession = $.cookie('JSESSIONID');
g_sessionKey = encodeURIComponent(g_loginResponse.sessionkey);
g_role = g_loginResponse.type;
g_username = g_loginResponse.username;
@ -238,8 +216,7 @@
async: false,
success: function(json) {
var loginresponse = json.loginresponse;
g_mySession = $.cookie('JSESSIONID');
g_sessionKey = encodeURIComponent(loginresponse.sessionkey);
g_role = loginresponse.type;
g_username = loginresponse.username;
@ -335,8 +312,7 @@
$.ajax({
url: createURL('logout'),
async: false,
success: function() {
g_mySession = null;
success: function() {
g_sessionKey = null;
g_username = null;
g_account = null;
@ -347,8 +323,7 @@
g_kvmsnapshotenabled = null;
g_regionsecondaryenabled = null;
g_loginCmdText = null;
$.cookie('JSESSIONID', null);
$.cookie('sessionKey', null);
$.cookie('username', null);
$.cookie('account', null);

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
var g_mySession = null;
var g_sessionKey = null;
var g_role = null; // roles - root, domain-admin, ro-admin, user
var g_username = null;