[anonymous_user.py]: reglages connexion anonyme
This commit is contained in:
parent
d457162767
commit
6b2f41214f
1 changed files with 7 additions and 5 deletions
|
@ -49,6 +49,12 @@ class AnonymousAuth(BaseAuth):
|
||||||
if user_obj and user_obj.valid and user_obj.auth_method != self.name and user_obj.name != self.auth_username:
|
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
|
return user_obj, True
|
||||||
|
|
||||||
|
p = urlparse.urlparse(request.url)
|
||||||
|
# Prevent preference edition when anonymous
|
||||||
|
if action == "userprefs" or action == "quicklink":
|
||||||
|
url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", ""))
|
||||||
|
request.http_redirect(url)
|
||||||
|
|
||||||
|
|
||||||
# anonymous
|
# anonymous
|
||||||
if self.can_view(request):
|
if self.can_view(request):
|
||||||
|
@ -67,11 +73,7 @@ class AnonymousAuth(BaseAuth):
|
||||||
else:
|
else:
|
||||||
u = user_obj
|
u = user_obj
|
||||||
|
|
||||||
p = urlparse.urlparse(request.url)
|
|
||||||
# Impossible to edit preferences
|
|
||||||
if u and u.valid and action == "userprefs":
|
|
||||||
url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", ""))
|
|
||||||
request.http_redirect(url)
|
|
||||||
# If reach anonymous user personnal page, redirect to referer with action=login
|
# If reach anonymous user personnal page, redirect to referer with action=login
|
||||||
if p.path == "/%s" % self.auth_username and action != "login":
|
if p.path == "/%s" % self.auth_username and action != "login":
|
||||||
referer_p = urlparse.urlparse(request.http_referer)
|
referer_p = urlparse.urlparse(request.http_referer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue