Verification: allow admins to verify users

master
justcool393 2021-09-05 19:24:27 -07:00
parent 362600c2a1
commit 9b80392c91
2 changed files with 26 additions and 0 deletions

View File

@ -660,6 +660,24 @@ def unshadowban(user_id, v):
return "", 204
@app.post("/admin/verify/<user_id>")
@admin_level_required(6)
@validate_formkey
def verify(user_id, v):
user = g.db.query(User).filter_by(id=user_id).first()
user.verified = True
g.db.add(user)
return "", 204
@app.post("/admin/unverify/<user_id>")
@admin_level_required(6)
@validate_formkey
def verify(user_id, v):
user = g.db.query(User).filter_by(id=user_id).first()
user.verified = False
g.db.add(user)
return "", 204
@app.post("/admin/title_change/<user_id>")
@admin_level_required(6)

View File

@ -308,6 +308,14 @@
<a class="btn btn-danger" href="javascript:void(0)" onclick="post_toast('/shadowban/{{u.id}}')">Shadowban</a>
{% endif %}
<pre></pre>
{% if u.verified %}
<a class="btn btn-danger" href="javasript:void(0)" onclick="post_toast('/admin/unverify/{{u.id}}')">Unverify</a>
{% else %}
<a class="btn btn-success" href="javasript:void(0)" onclick="post_toast('/admin/verify/{{u.id}}')">Verify</a>
{% endif %}
<pre></pre>
<form action="/admin/unnuke_user" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">