Auth use request.requires_https, thanks Yarin
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.9 (2012-10-04 21:51:53) dev
|
Version 2.0.9 (2012-10-05 07:18:29) dev
|
||||||
|
|||||||
+1
-1
@@ -128,7 +128,7 @@ class Request(Storage):
|
|||||||
and secure the session.
|
and secure the session.
|
||||||
"""
|
"""
|
||||||
if not global_settings.cronjob and not self.is_https:
|
if not global_settings.cronjob and not self.is_https:
|
||||||
session.forget()
|
current.session.forget()
|
||||||
redirect(URL(scheme='https', args=self.args, vars=self.vars))
|
redirect(URL(scheme='https', args=self.args, vars=self.vars))
|
||||||
|
|
||||||
current.session.secure()
|
current.session.secure()
|
||||||
|
|||||||
+2
-3
@@ -1070,9 +1070,8 @@ class Auth(object):
|
|||||||
session = current.session
|
session = current.session
|
||||||
auth = session.auth
|
auth = session.auth
|
||||||
self.user_groups = auth and auth.user_groups or {}
|
self.user_groups = auth and auth.user_groups or {}
|
||||||
if secure and not request.is_https:
|
if secure:
|
||||||
session.secure()
|
request.requires_https()
|
||||||
redirect(URL(args=request.args,vars=request.vars,scheme='http'))
|
|
||||||
if auth and auth.last_visit and auth.last_visit + \
|
if auth and auth.last_visit and auth.last_visit + \
|
||||||
datetime.timedelta(days=0, seconds=auth.expiration) > request.now:
|
datetime.timedelta(days=0, seconds=auth.expiration) > request.now:
|
||||||
self.user = auth.user
|
self.user = auth.user
|
||||||
|
|||||||
Reference in New Issue
Block a user