Commit 8362d0d3 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Auth providers login/logout messages update

parent 5ab572d9
......@@ -80,9 +80,10 @@ class AuthProvider(object):
login_prompt = _('Login using ')
primary_login_prompt = _('Login using ')
login_message = None
logout_message = 'You may still be logged in at "%(provider)s". Consider logging out.'
logout_message = 'You may still be logged in %(provider)s though. Consider logging out from there too.'
remote_authenticate = True
remote_logout_url = None
logout_from_provider_text = None
def get_message(self, msg, **kwargs):
params = kwargs
......@@ -111,8 +112,9 @@ class AuthProvider(object):
self.login_message = self.login_message or self.get_title_display
if self.logout_message and "%" in self.logout_message:
logout_text_display = self.logout_from_provider_text or 'at %s' % self.get_title_display
self.logout_message = self.logout_message % {'provider':
self.get_login_message_display}
logout_text_display}
else:
self.logout_message = self.logout_message or ''
......@@ -193,7 +195,7 @@ class LocalAuthProvider(AuthProvider):
class ShibbolethAuthProvider(AuthProvider):
module = 'shibboleth'
title = _('Academic credentials (Shibboleth)')
title = _('Academic account (Shibboleth)')
add_prompt = _('Allows you to login to your account using your academic '
'account')
details_tpl = _('Shibboleth account \'%(identifier)s\' is connected to your '
......@@ -206,6 +208,7 @@ class ShibbolethAuthProvider(AuthProvider):
login_template = 'im/auth/shibboleth_login.html'
login_prompt_template = 'im/auth/third_party_provider_generic_login_prompt.html'
logout_from_provider_text = ' at your Academic account (shibboleth)'
class TwitterAuthProvider(AuthProvider):
......
......@@ -67,8 +67,9 @@ USER_LEFT_GROUP = 'User %(realname)s left the project.
USER_MEMBERSHIP_REJECTED = 'User\'s %(realname)s request to join the project has been rejected.'
MEMBER_REMOVED = 'User %(realname)s has been successfully removed from the project.'
BILLING_ERROR = 'Service response status: %(status)d'
LOGOUT_SUCCESS = 'You are now logged out from your ~okeanos account.'
LOGIN_SUCCESS = 'You have logged in to your ~okeanos account using "%s".'
LOGOUT_SUCCESS = 'Logged out from ~okeanos.'
LOGIN_SUCCESS = 'You are logged in to ~okeanos with your %s account.'
LOCAL_LOGIN_SUCCESS = 'You are logged in to your ~okeanos account.'
GENERIC_ERROR = 'Hmm... It seems something bad has happened, and we don\'t know the details right now. \
Please contact the administrators by email for more details.'
......
......@@ -120,8 +120,7 @@ def login(request, on_failure='im/login.html'):
messages.error(request, _(astakos_messages.AUTH_PROVIDER_ADD_FAILED))
provider = auth_providers.get_provider('local')
messages.success(request, _(astakos_messages.LOGIN_SUCCESS) %
_(provider.get_login_message_display))
messages.success(request, _(astakos_messages.LOCAL_LOGIN_SUCCESS))
response.set_cookie('astakos_last_login_method', 'local')
return response
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment