Commit f7bbaad5 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

astakos: Shibboleth wording improvements

- Customized logout success message
- Customized add prompt message
parent e7760bde
......@@ -46,6 +46,8 @@ from django.conf import settings
from astakos.im import settings as astakos_settings
from astakos.im import messages as astakos_messages
from synnefo_branding import utils as branding_utils
import logging
logger = logging.getLogger(__name__)
......@@ -99,7 +101,10 @@ class AuthProvider(object):
('add_prompt', 'Allows you to login using {title}'),
('login_extra', ''),
('username', '{username}'),
('disabled_for_create', '{title} is not available for signup.'),
('disabled_for_create', 'It seems this is the first time you\'re '
'trying to access {service_name}. '
'Unfortunately, we are not accepting new '
'users at this point.'),
('switch_success', 'Account changed successfully.'),
('cannot_login', '{title} is not available for login. '
'Please use one of your other available methods '
......@@ -286,7 +291,7 @@ class AuthProvider(object):
self.provider_details['info'] = \
json.loads(self.provider_details['info'])
for key, val in self.provider_details['info'].iteritems():
params['provider_info_%s' % key.lower()] = val
params['provider_info_%s' % key.lower()] = val
# resolve username, handle unexisting defined username key
if self.user and self.username_key in params:
......@@ -294,6 +299,10 @@ class AuthProvider(object):
else:
params['username'] = self.identifier
branding_params = dict(map(lambda k: (k[0].lower(), k[1]),
branding_utils.get_branding_dict().iteritems()))
params.update(branding_params)
if not self.message_tpls_compiled:
for key, message_tpl in self.message_tpls.iteritems():
msg = self.messages.get(key, self.message_tpls.get(key))
......@@ -440,8 +449,8 @@ class AuthProvider(object):
})
if self.identifier and self._instance:
urls.update({
'switch': reverse(self.login_view) + '?switch_from=%d' % \
self._instance.pk,
'switch': reverse(self.login_view) + '?switch_from=%d' %
self._instance.pk,
'remove': reverse('remove_auth_provider',
kwargs={'pk': self._instance.pk})
})
......@@ -597,9 +606,13 @@ class ShibbolethAuthProvider(AuthProvider):
'title': _('Academic'),
'login_description': _('If you are a student, professor or researcher'
' you can login using your academic account.'),
'add_prompt': _('Allows you to login using your Academic '
'account'),
'method_details': 'Account: {username}',
'logout_extra': _('Please close all browser windows to complete '
'logout from your Academic account, too.')
'logout_success_extra': _('You may still be logged in at your Academic'
' account though. Consider logging out '
'from there too by closing all browser '
'windows')
}
......
......@@ -213,7 +213,7 @@ PENDING_APPLICATION_LIMIT_MODIFY = \
# Auth providers messages
AUTH_PROVIDER_LOGIN_SUCCESS = "Logged in successfully, using {method_prompt}."
AUTH_PROVIDER_LOGOUT_SUCCESS = "Logged out successfully."
AUTH_PROVIDER_LOGOUT_SUCCESS = "Logged out successfully from {service_name}."
AUTH_PROVIDER_LOGOUT_SUCCESS_EXTRA = "You may still be logged in at {title} though. Consider logging out from there too."
AUTH_PROVIDER_NOT_ACTIVE = "'{method_prompt}' is disabled."
AUTH_PROVIDER_ADD_DISABLED = "{method_prompt} is disabled for your account."
......
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