You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2014/11/05 11:45:01 UTC
[07/50] [abbrv] git commit: updated refs/heads/master to 4c5f792
CLOUDSTACK-7809: UI > remove usage of g_mySession which is unnecessary.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/58455c08
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/58455c08
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/58455c08
Branch: refs/heads/master
Commit: 58455c08c4ff40f7aaa632e5014700444cb7aa9a
Parents: 070e689
Author: Jessica Wang <je...@apache.org>
Authored: Wed Oct 29 11:14:58 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Oct 29 11:14:58 2014 -0700
----------------------------------------------------------------------
ui/scripts/cloudStack.js | 31 +++----------------------------
ui/scripts/sharedFunctions.js | 2 +-
2 files changed, 4 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58455c08/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 49af7f7..c5aa89c 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -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);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58455c08/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 8ec88b3..cba6fc6 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -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;