diff --git a/wiki/auth/cas.py b/wiki/auth/cas.py index 5ab2ec93..faed5139 100644 --- a/wiki/auth/cas.py +++ b/wiki/auth/cas.py @@ -129,9 +129,8 @@ class CASAuth(BaseAuth): # authenticated user if not force and user_obj and user_obj.valid: - if self.action == action: + if (action == self.action or (ticket and ticket.startswith('ST-'))) and user_obj.auth_method == self.name: request.http_redirect(url) - return user_obj, True if self.ticket_path and request.method == 'POST': logoutRequest=request.form.get('logoutRequest', None) @@ -144,7 +143,7 @@ class CASAuth(BaseAuth): return user_obj, True # valid ticket on CAS - if ticket: + if ticket and ticket.startswith('ST-'): valid, username = self.cas.validate_ticket(url, ticket) if valid: sys.stderr.write("Authentifiaction de %s sur le CAS\n" % username) @@ -179,6 +178,8 @@ class CASAuth(BaseAuth): def login_hint(self, request): + p = urlparse.urlparse(request.url) + url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", "")) _ = request.getText - msg = _('

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

') + msg = _('

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

' % self.cas.login_url(url)) return msg