mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Bug #1078: Fix login redirection problems in SelfService
This commit is contained in:
parent
6d4f4903da
commit
f2e8103d35
@ -324,7 +324,7 @@ post '/config' do
|
||||
end
|
||||
|
||||
get '/ui/login' do
|
||||
File.read(File.dirname(__FILE__)+'/ui/templates/login.html')
|
||||
redirect to('ui')
|
||||
end
|
||||
|
||||
post '/ui/login' do
|
||||
|
@ -326,7 +326,14 @@ function onError(request,error_json) {
|
||||
|
||||
//redirect to login if unauthenticated
|
||||
if (error_json.error.http_status=="401") {
|
||||
window.location.href = "login";
|
||||
switch (whichUI()){
|
||||
case "selfservice":
|
||||
window.location.href = "ui";
|
||||
break;
|
||||
default:
|
||||
window.location.href = "login";
|
||||
};
|
||||
|
||||
onError.disabled=false;
|
||||
return false;
|
||||
};
|
||||
|
@ -403,7 +403,7 @@ function setLogin(){
|
||||
case "ozones":
|
||||
username = cookie["ozones-user"];
|
||||
break;
|
||||
case "occi":
|
||||
case "selfservice":
|
||||
username = cookie["occi-user"];
|
||||
break;
|
||||
};
|
||||
@ -420,7 +420,7 @@ function setLogin(){
|
||||
case "ozones":
|
||||
oZones.Auth.logout({success:redirect});
|
||||
break;
|
||||
case "occi":
|
||||
case "selfservice":
|
||||
OCCI.Auth.logout({success:function(){window.location.href = "ui";}});
|
||||
break;
|
||||
}
|
||||
@ -436,7 +436,7 @@ function whichUI(){
|
||||
if (typeof(oZones)!="undefined")
|
||||
return "ozones";
|
||||
if (typeof(OCCI)!="undefined")
|
||||
return "occi";
|
||||
return "selfservice";
|
||||
};
|
||||
|
||||
//Inserts all main tabs in the DOM
|
||||
|
Loading…
x
Reference in New Issue
Block a user