forked from rDrama/rDrama
fix 500 error ????
parent
73a78f0e97
commit
89816775aa
|
@ -60,9 +60,7 @@ def get_logged_in_user():
|
||||||
if lo_user:
|
if lo_user:
|
||||||
id = int(lo_user)
|
id = int(lo_user)
|
||||||
v = get_account(id, graceful=True)
|
v = get_account(id, graceful=True)
|
||||||
if not v:
|
if v:
|
||||||
session.pop("lo_user")
|
|
||||||
else:
|
|
||||||
nonce = session.get("login_nonce", 0)
|
nonce = session.get("login_nonce", 0)
|
||||||
if nonce < v.login_nonce or v.id != id:
|
if nonce < v.login_nonce or v.id != id:
|
||||||
session.pop("lo_user")
|
session.pop("lo_user")
|
||||||
|
@ -71,8 +69,10 @@ def get_logged_in_user():
|
||||||
if v and request.method != "GET":
|
if v and request.method != "GET":
|
||||||
submitted_key = request.values.get("formkey")
|
submitted_key = request.values.get("formkey")
|
||||||
if not validate_formkey(v, submitted_key): abort(401)
|
if not validate_formkey(v, submitted_key): abort(401)
|
||||||
|
|
||||||
v.client = None
|
v.client = None
|
||||||
|
else:
|
||||||
|
session.pop("lo_user")
|
||||||
|
|
||||||
g.is_api_or_xhr = bool((v and v.client) or request.headers.get("xhr"))
|
g.is_api_or_xhr = bool((v and v.client) or request.headers.get("xhr"))
|
||||||
|
|
||||||
if request.method.lower() != "get" and get_setting('Read-only mode') and not (v and v.admin_level >= PERMS['SITE_BYPASS_READ_ONLY_MODE']):
|
if request.method.lower() != "get" and get_setting('Read-only mode') and not (v and v.admin_level >= PERMS['SITE_BYPASS_READ_ONLY_MODE']):
|
||||||
|
|
Loading…
Reference in New Issue