[wiki/auth] divers
This commit is contained in:
parent
083358deea
commit
1d10ca9d18
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue