[wiki/categorie_public] Redirection vers la page de login si nécessaire
This commit is contained in:
parent
e4541a6340
commit
9560cf0bf3
1 changed files with 11 additions and 0 deletions
|
@ -63,3 +63,14 @@ class PublicCategories(AnonymousAuth):
|
||||||
sys.stderr.write("%r n'est pas dans la page %r, %r\n" % (cat, p.path[1:], categories))
|
sys.stderr.write("%r n'est pas dans la page %r, %r\n" % (cat, p.path[1:], categories))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def request(self, request, user_obj, **kw):
|
||||||
|
user_obj, cont = AnonymousAuth.request(self, request, user_obj, **kw)
|
||||||
|
if user_obj and not user_obj.valid and user_obj.auth_method == self.name:
|
||||||
|
p = urlparse.urlparse(request.url)
|
||||||
|
url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", ""))
|
||||||
|
action = request.args.get("action", "")
|
||||||
|
if action != "login":
|
||||||
|
request.http_redirect(url + "?action=login")
|
||||||
|
return user_obj, cont
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue