From ebcdef55b0ea823ea5c9c97ad8713d702d6c168d Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Sun, 7 Apr 2013 08:59:08 -0700 Subject: [PATCH] CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - shorten value of g_loginCmdText --- ui/scripts/cloud.core.callbacks.js | 4 ++-- ui/scripts/cloudStack.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js index a081294293c..7fd1b4d1244 100644 --- a/ui/scripts/cloud.core.callbacks.js +++ b/ui/scripts/cloud.core.callbacks.js @@ -73,10 +73,10 @@ $(document).ready(function() { } }); } - else if(window.name != null && window.name.indexOf("command=login") != -1) { //from region switching + else if(window.name != null && window.name.indexOf("&domain=") != -1) { //from region switching g_loginCmdText = window.name; $.ajax({ - url: clientApiUrl + "?" + window.name, + url: clientApiUrl + "?command=login" + window.name + "&response=json", dataType: "json", async: false, success: function(json) { diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 499cb833040..faa77899da1 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -250,12 +250,12 @@ else { array1.push("&domain=" + encodeURIComponent("/")); } - - g_loginCmdText = "command=login" + array1.join("") + "&response=json"; + + g_loginCmdText = array1.join(""); $.ajax({ type: "POST", - data: g_loginCmdText, + data: "command=login" + g_loginCmdText + "&response=json", dataType: "json", async: false, success: function(json) { @@ -466,7 +466,7 @@ document.title = 'CloudStack'; if ($.urlParam('loginUrl') != 0 - ||(window.name != null && window.name.indexOf("command=login") != -1)) { + ||(window.name != null && window.name.indexOf("&domain=") != -1)) { // SSO loginArgs.hideLoginScreen = true; }