Commit 9560cf0b authored by Valentin Samir's avatar Valentin Samir

[wiki/categorie_public] Redirection vers la page de login si nécessaire

parent e4541a63
......@@ -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))
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment