Swap remote user logout to actually follow galaxy internal logout procedure and then redirect. Also fix logic for user dropdown -- it was preventing users from seeing stuff that was actually available before.

This commit is contained in:
Dannon Baker
2014-08-20 12:55:32 -04:00
parent 6f6ad216a9
commit 930fe2fa61
3 changed files with 26 additions and 39 deletions
@@ -616,11 +616,14 @@ class User( BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Creat
if biostar_url:
# TODO: It would be better if we automatically logged this user out of biostar
message += '<br>To logout of Biostar, please click <a href="%s" target="_blank">here</a>.' % ( biostar_url )
return trans.fill_template( '/user/logout.mako',
refresh_frames=refresh_frames,
message=message,
status='done',
active_view="user" )
if trans.app.config.use_remote_user and trans.app.config.remote_user_logout_href:
trans.response.send_redirect(trans.app.config.remote_user_logout_href)
else:
return trans.fill_template('/user/logout.mako',
refresh_frames=refresh_frames,
message=message,
status='done',
active_view="user" )
@web.expose
def create( self, trans, cntrller='user', redirect_url='', refresh_frames=[], **kwd ):
+17 -27
View File
@@ -289,34 +289,24 @@ var GalaxyMenu = Backbone.Model.extend(
title : "Logged in as " + this.options.user.email
});
// remote user
if (this.options.use_remote_user && this.options.remote_user_logout_href)
{
tab_user.add({
title : "Logout",
content : this.options.remote_user_logout_href,
target : "_top"
});
} else {
tab_user.add({
title : "Preferences",
content : "user?cntrller=user",
target : "galaxy_main"
});
tab_user.add({
title : "Preferences",
content : "user?cntrller=user",
target : "galaxy_main"
});
tab_user.add({
title : "Custom Builds",
content : "user/dbkeys",
target : "galaxy_main"
});
tab_user.add({
title : "Logout",
content : "user/logout",
target : "_top",
divider : true
});
}
tab_user.add({
title : "Custom Builds",
content : "user/dbkeys",
target : "galaxy_main"
});
tab_user.add({
title : "Logout",
content : "user/logout",
target : "_top",
divider : true
});
// default tabs
tab_user.add({
+1 -7
View File
@@ -19,13 +19,7 @@
%if trans.app.config.enable_openid and not trans.app.config.use_remote_user:
<li><a href="${h.url_for( controller='user', action='openid_manage', cntrller=cntrller )}">${_('Manage OpenIDs')}</a> linked to your account</li>
%endif
%if trans.app.config.use_remote_user:
%if trans.app.config.remote_user_logout_href:
<li><a href="${trans.app.config.remote_user_logout_href}" target="_top">${_('Logout')}</a></li>
%endif
%else:
<li><a href="${h.url_for( controller='user', action='logout', logout_all=True )}" target="_top">${_('Logout')}</a> ${_('of all user sessions')}</li>
%endif
<li><a href="${h.url_for( controller='user', action='logout', logout_all=True )}" target="_top">${_('Logout')}</a> ${_('of all user sessions')}</li>
%else:
<li><a href="${h.url_for( controller='user', action='manage_user_info', cntrller=cntrller )}">${_('Manage your information')}</a></li>
<li><a href="${h.url_for( controller='user', action='api_keys', cntrller=cntrller )}">${_('Manage your API keys')}</a></li>