forked from rDrama/rDrama
master
parent
6f10415966
commit
df66febb5c
|
@ -27,7 +27,7 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||||
@app.post("/@<username>/revert_actions")
|
@app.post("/@<username>/revert_actions")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def revert_actions(v, username):
|
def revert_actions(v, username):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ def toggle_club_ban(v, username):
|
||||||
@app.post("/@<username>/make_admin")
|
@app.post("/@<username>/make_admin")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def make_admin(v, username):
|
def make_admin(v, username):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
user.admin_level = 6
|
user.admin_level = 6
|
||||||
|
@ -81,7 +81,7 @@ def make_admin(v, username):
|
||||||
@app.post("/@<username>/remove_admin")
|
@app.post("/@<username>/remove_admin")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def remove_admin(v, username):
|
def remove_admin(v, username):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
user.admin_level = 0
|
user.admin_level = 0
|
||||||
|
@ -92,7 +92,7 @@ def remove_admin(v, username):
|
||||||
@app.post("/@<username>/make_fake_admin")
|
@app.post("/@<username>/make_fake_admin")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def make_fake_admin(v, username):
|
def make_fake_admin(v, username):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
user.admin_level = 1
|
user.admin_level = 1
|
||||||
|
@ -103,7 +103,7 @@ def make_fake_admin(v, username):
|
||||||
@app.post("/@<username>/remove_fake_admin")
|
@app.post("/@<username>/remove_fake_admin")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def remove_fake_admin(v, username):
|
def remove_fake_admin(v, username):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
user.admin_level = 0
|
user.admin_level = 0
|
||||||
|
@ -115,7 +115,7 @@ def remove_fake_admin(v, username):
|
||||||
@limiter.limit("1/day")
|
@limiter.limit("1/day")
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def monthly(v):
|
def monthly(v):
|
||||||
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
|
||||||
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
||||||
_awards = []
|
_awards = []
|
||||||
for u in g.db.query(User).filter(User.patron > 0).all():
|
for u in g.db.query(User).filter(User.patron > 0).all():
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
{% if v.id in [1,12,28,29,747,995] %}
|
{% if v.id in [1,12,28,29,747,995,1480] %}
|
||||||
<div><a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/admin/monthly')">Grant Monthly Awards</a></div>
|
<div><a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/admin/monthly')">Grant Monthly Awards</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -201,7 +201,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995] %}
|
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995,1480] %}
|
||||||
<a id="admin" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
|
<a id="admin" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
|
||||||
<a id="unadmin" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
|
<a id="unadmin" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995] %}
|
{% if 'rdrama' in request.host and v.id in [1,12,28,29,747,995,1480] %}
|
||||||
<a id="admin2" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
|
<a id="admin2" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
|
||||||
<a id="unadmin2" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>
|
<a id="unadmin2" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue