From f986184ece5f45eeb60b758c3af056e009e4134a Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 15 Jun 2013 01:34:48 +0200 Subject: [PATCH] [wiki/auth/cas] Affichage du lien vers le cas sur la page de login --- wiki/auth/cas.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wiki/auth/cas.py b/wiki/auth/cas.py index 1734c412..ca9b9e69 100644 --- a/wiki/auth/cas.py +++ b/wiki/auth/cas.py @@ -21,6 +21,7 @@ logging = log.getLogger(__name__) from MoinMoin.auth import BaseAuth from MoinMoin import user, wikiutil +from MoinMoin.theme import load_theme_fallback class PyCAS(object): """A class for working with a CAS server.""" @@ -75,7 +76,7 @@ class PyCAS(object): class CASAuth(BaseAuth): """ handle login from CAS """ name = 'CAS' - login_inputs = ['username', 'password'] + login_inputs = [] logout_possible = True def __init__(self, auth_server, login_path="/login", logout_path="/logout", validate_path="/validate", action="login_cas", create_user=False, fallback_url=None, ticket_path=None): @@ -130,6 +131,8 @@ class CASAuth(BaseAuth): if not force and user_obj and user_obj.valid: if self.action == action: request.http_redirect(url) + if ticket: + request.http_redirect(url) return user_obj, True if self.ticket_path and request.method == 'POST': @@ -156,6 +159,7 @@ class CASAuth(BaseAuth): request.http_redirect("%s?action=%s&wiki_url=%s" % (self.fallback_url, self.action, url)) if u.valid: store_ticket(ticket, username) + load_theme_fallback(request, u.theme_name) return u, True # login @@ -174,3 +178,7 @@ class CASAuth(BaseAuth): return user_obj, False + def login_hint(self, request): + _ = request.getText + msg = _('

Se connecter via le CAS (vous devez disposer d\'un compte Cr@ns pour cela)

') + return msg