master
Aevann1 2021-10-12 08:00:24 +02:00
parent ec768f5d22
commit 1f8cf9fc1c
3 changed files with 10 additions and 17 deletions

View File

@ -111,8 +111,7 @@ def auth_required(f):
v = get_logged_in_user()
if not v:
abort(401)
if not v: abort(401)
check_ban_evade(v)
@ -131,8 +130,7 @@ def is_not_banned(f):
v = get_logged_in_user()
if not v:
abort(401)
if not v: abort(401)
check_ban_evade(v)
@ -156,20 +154,16 @@ def admin_level_required(x):
v = get_logged_in_user()
if not v:
abort(401)
if not v: abort(401)
if v.admin_level < x:
abort(403)
if v.admin_level < x: abort(403)
g.v = v
response = f(*args, v=v, **kwargs)
if isinstance(response, tuple):
resp = make_response(response[0])
else:
resp = make_response(response)
if isinstance(response, tuple): resp = make_response(response[0])
else: resp = make_response(response)
return resp
@ -186,9 +180,9 @@ def validate_formkey(f):
submitted_key = request.values.get("formkey", None)
# if not submitted_key: abort(401)
if not submitted_key: abort(401)
# elif not v.validate_formkey(submitted_key): abort(401)
elif not v.validate_formkey(submitted_key): abort(401)
return f(*args, v=v, **kwargs)

View File

@ -236,8 +236,7 @@ def sign_up_post(v):
form_formkey = request.values.get("formkey", "none")
submitted_token = session.get("signup_token", "")
if not submitted_token:
abort(400)
if not submitted_token: abort(400)
correct_formkey_hashstr = form_timestamp + submitted_token + agent

View File

@ -194,7 +194,7 @@
</div>
{% endif %}
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}context{% endif %} comment {% if standalone and level==1 %} mt-0{% endif %}{% if c.collapse_for_user(v) or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}" style="border-left: 2px solid #{{c.author.namecolor}}; {% if c.unread %}padding: 10px 10px 10px !important;{% endif %}">
<div id="comment-{{c.id}}" class="anchor {% if c.unread %}context{% endif %} comment {% if standalone and level==1 %} mt-0{% endif %}{% if c.collapse_for_user(v) or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}" style="border-left: 2px solid #{{c.author.namecolor}} !important; {% if c.unread %}padding: 10px 10px 10px !important;{% endif %}">
<span class="comment-collapse-desktop d-none d-md-block" {% if not c.unread %}style="border-left: 2px solid #{{c.author.namecolor}};"{% endif %} onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body">