[wiki/auth] Pas d'inscription hors zone crans
This commit is contained in:
parent
534927e43e
commit
1eb6e67ff1
1 changed files with 3 additions and 3 deletions
|
@ -12,6 +12,7 @@ import urlparse
|
|||
from netaddr import IPNetwork, IPAddress
|
||||
|
||||
from MoinMoin.auth import BaseAuth
|
||||
from MoinMoin.Page import Page
|
||||
from MoinMoin import user
|
||||
from anonymous_user import AnonymousAuth
|
||||
|
||||
|
@ -35,7 +36,7 @@ class IpRange(AnonymousAuth):
|
|||
|
||||
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:
|
||||
if not user_obj or not user_obj.valid:
|
||||
# Are we trying to do a protected action (eg newaccount)
|
||||
action = request.args.get("action", "")
|
||||
if action in self.actions:
|
||||
|
@ -44,8 +45,7 @@ class IpRange(AnonymousAuth):
|
|||
p = urlparse.urlparse(request.url)
|
||||
url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", ""))
|
||||
request.http_redirect(url)
|
||||
return user_obj, True
|
||||
|
||||
return user_obj, False
|
||||
return user_obj, True
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue