diff --git a/wiki/auth/anonymous_user.py b/wiki/auth/anonymous_user.py index abffeda1..0222f117 100644 --- a/wiki/auth/anonymous_user.py +++ b/wiki/auth/anonymous_user.py @@ -38,7 +38,7 @@ class AnonymousAuth(BaseAuth): def request(self, request, user_obj, **kw): # authenticated user - if user_obj and user_obj.valid: + if user_obj and user_obj.valid and user_obj.auth_method != self.name and user_obj.name != self.auth_username: return user_obj, True @@ -46,11 +46,15 @@ class AnonymousAuth(BaseAuth): if self.can_view(request): if user_obj and user_obj.valid: return user_obj, True + sys.stderr.write("Authetification anonyme dans %s\n" % self.name) u = user.User(request, auth_username=self.auth_username, auth_method=self.name) + u.auth_username=self.auth_username + u.name=self.auth_username u.valid = True + u.auth_method = self.name u.name = self.auth_username elif user_obj and user_obj.valid: - u = user.User(request, auth_method=self.name) + u=user_obj u.valid = False else: u = user_obj