moved debugger auth to access.py
This commit is contained in:
1 parent
410943e2ad
commit
6566729401
3 files changed
+8
-12
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-03-12 12:07:09) dev
|
Version 1.99.7 (2012-03-12 12:12:43) dev
|
||||||
@@ -125,16 +125,6 @@ def detach_debugger():
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def call():
|
def call():
|
||||||
"Entry point. Prevents access to action if not admin password is present"
|
|
||||||
|
|
||||||
basic = request.env.http_authorization
|
|
||||||
if not basic or not basic[:6].lower() == 'basic ':
|
|
||||||
raise HTTP(401,"Wrong credentials")
|
|
||||||
(username, password) = base64.b64decode(basic[6:]).split(':')
|
|
||||||
if not verify_password(password) or not is_manager():
|
|
||||||
time.sleep(10)
|
|
||||||
raise HTTP(403,"Not authorized")
|
|
||||||
|
|
||||||
session.forget()
|
session.forget()
|
||||||
return service()
|
return service()
|
||||||
|
|
||||||
@@ -121,7 +121,13 @@ if session.authorized:
|
|||||||
session.last_time = t0
|
session.last_time = t0
|
||||||
|
|
||||||
if request.controller == "webservices":
|
if request.controller == "webservices":
|
||||||
pass
|
basic = request.env.http_authorization
|
||||||
|
if not basic or not basic[:6].lower() == 'basic ':
|
||||||
|
raise HTTP(401,"Wrong credentials")
|
||||||
|
(username, password) = base64.b64decode(basic[6:]).split(':')
|
||||||
|
if not verify_password(password) or not is_manager():
|
||||||
|
time.sleep(10)
|
||||||
|
raise HTTP(403,"Not authorized")
|
||||||
elif not session.authorized and not \
|
elif not session.authorized and not \
|
||||||
(request.controller == 'default' and \
|
(request.controller == 'default' and \
|
||||||
request.function in ('index','user')):
|
request.function in ('index','user')):
|
||||||
|
|||||||
Reference in new issue
Block a user