Removed "make admin" on rdrama.net

master
Aevann1 2022-05-29 20:36:51 +02:00
parent eafa2a2b0a
commit 3e472c74e0
2 changed files with 9 additions and 3 deletions

View File

@ -182,6 +182,8 @@ if SITE_NAME == 'PCM':
@app.post("/@<username>/make_admin") @app.post("/@<username>/make_admin")
@admin_level_required(3) @admin_level_required(3)
def make_admin(v, username): def make_admin(v, username):
if SITE == 'rdrama.net': abort(403)
user = get_user(username) user = get_user(username)
if not user: abort(404) if not user: abort(404)
user.admin_level = 2 user.admin_level = 2

View File

@ -180,7 +180,9 @@
{% endif %} {% endif %}
{% if v.admin_level > 2 %} {% if v.admin_level > 2 %}
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a> {% if SITE != 'rdrama.net' %}
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
{% endif %}
<a id="unadmin" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a> <a id="unadmin" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
@ -486,8 +488,10 @@
<a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</a> <a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</a>
{% endif %} {% endif %}
{% if v.admin_level > 2 %} {% if v.admin_level > 2 %}
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a> {% if SITE != 'rdrama.net' %}
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
{% endif %}
<a id="unadmin2" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a> <a id="unadmin2" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>