Bug #1078: Fix login redirection problems in SelfService

This commit is contained in:
Hector Sanjuan authored and Ruben S. Montero committed 2012-01-23 16:51:20 +01:00
1 parent 6d4f4903da
commit f2e8103d35
3 files changed
+12 -5

No files matched your search

+1 -1
View File
@@ -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
+8 -1
View File
@@ -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;
};
+3 -3
View File
@@ -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