Commit c36d3f07 authored by Remi Oudin's avatar Remi Oudin

Quelques réparations sur le wiki.

La méthode encodePassword prends 2 arguments depuis l'utilisation de
passlib dans MoinMoin (version 1.9.7)

Un soucis de logging faisait aussi planter certains appels dans
l'authentification par CAS.
parent d8cdece6
......@@ -51,7 +51,7 @@ def do_register(request):
# Encode password
if password and not password.startswith('{SHA}'):
try:
theuser.enc_password = user.encodePassword(password)
theuser.enc_password = user.encodePassword(request.cfg, password)
except UnicodeError, err:
# Should never happen
return "invalid password %s" % str(err)
......
......@@ -72,7 +72,6 @@ class PyCAS(object):
valid = f.readline()
valid = valid.strip() == 'yes'
user = f.readline().strip()
user = user.decode(self.coding)
return valid, user
class CASAuth(BaseAuth):
......@@ -137,15 +136,15 @@ class CASAuth(BaseAuth):
if self.ticket_path and request.method == 'POST':
logoutRequest=request.form.get('logoutRequest', None)
if logoutRequest is not None:
sys.stderr.write("Tentative de déconnexion du CAS : %s\n" % logoutRequest.decode('ascii', 'ignore'))
sys.stderr.write(u"Tentative de déconnexion du CAS : %s\n" % logoutRequest.decode('ascii', 'ignore'))
self.cas.singlesignout(logout_user, logoutRequest)
# valid ticket on CAS
if ticket and ticket.startswith('ST-'):
valid, username = self.cas.validate_ticket(url, ticket)
if valid:
sys.stderr.write("Authentifiction de %s sur le CAS\n" % username)
u = user.User(request, auth_username=username, auth_method=self.name)
sys.stderr.write(u"Authentifiction de %s sur le CAS\n" % username.decode("ascii", "ignore"))
u = user.User(request, auth_username=username.decode(self.cas.coding), auth_method=self.name)
# auto create user ?
if self.create_user:
u.valid = valid
......
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