[wiki/auth/cas] Problèmes de redirection quand sur une page publique
This commit is contained in:
parent
e8a37fd8d3
commit
ef68b02b2e
1 changed files with 5 additions and 4 deletions
|
@ -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 = _('<p><a href="?action=login_cas">Se connecter via le CAS</a> (vous devez disposer d\'un compte Cr@ns pour cela)</p>')
|
||||
msg = _('<p><a href="%s">Se connecter via le CAS</a> (vous devez disposer d\'un compte Cr@ns pour cela)</p>' % self.cas.login_url(url))
|
||||
return msg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue