[wiki/auth] Behavior plus adapté en cas de login utilisateur.
This commit is contained in:
parent
613a135334
commit
a4291f50c9
2 changed files with 11 additions and 3 deletions
|
@ -36,6 +36,14 @@ class AnonymousAuth(BaseAuth):
|
|||
raise NotImplementedError
|
||||
|
||||
def request(self, request, user_obj, **kw):
|
||||
action = request.args.get("action", "")
|
||||
# Si l'utilisateur est en train de se connecter
|
||||
# On droppe la pseudo connexion anonyme, si elle
|
||||
# existe bien.
|
||||
if action == 'login':
|
||||
if user_obj:
|
||||
user_obj.valid = False
|
||||
return user_obj, True
|
||||
|
||||
# authenticated user
|
||||
if user_obj and user_obj.valid and user_obj.auth_method != self.name and user_obj.name != self.auth_username:
|
||||
|
@ -59,7 +67,6 @@ class AnonymousAuth(BaseAuth):
|
|||
else:
|
||||
u = user_obj
|
||||
|
||||
action = request.args.get("action", "")
|
||||
p = urlparse.urlparse(request.url)
|
||||
# Impossible to edit preferences
|
||||
if u and u.valid and action == "userprefs":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue