This commit is contained in:
Aevann1 2021-10-07 08:04:29 +02:00
parent 3201682623
commit 1dc911b3ba
13 changed files with 127 additions and 28 deletions

View file

@ -28,6 +28,7 @@ def truescore(v):
@app.post("/@<username>/revert_actions")
@limiter.limit("1/second")
@admin_level_required(6)
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,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
@ -51,6 +52,7 @@ def revert_actions(v, username):
return {"message": "Admin actions reverted!"}
@app.post("/@<username>/club_allow")
@limiter.limit("1/second")
@admin_level_required(6)
def club_allow(v, username):
@ -81,6 +83,7 @@ def club_allow(v, username):
return {"message": f"@{username} has been allowed into the country club!"}
@app.post("/@<username>/club_ban")
@limiter.limit("1/second")
@admin_level_required(6)
def club_ban(v, username):
@ -110,6 +113,7 @@ def club_ban(v, username):
@app.post("/@<username>/make_admin")
@limiter.limit("1/second")
@admin_level_required(6)
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,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
@ -122,6 +126,7 @@ def make_admin(v, username):
@app.post("/@<username>/remove_admin")
@limiter.limit("1/second")
@admin_level_required(6)
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,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
@ -134,6 +139,7 @@ def remove_admin(v, username):
@app.post("/@<username>/make_fake_admin")
@limiter.limit("1/second")
@admin_level_required(6)
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,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
@ -146,6 +152,7 @@ def make_fake_admin(v, username):
@app.post("/@<username>/remove_fake_admin")
@limiter.limit("1/second")
@admin_level_required(6)
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,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host):
@ -228,6 +235,7 @@ def get_rules(v):
@app.post('/admin/rules')
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def post_rules(v):
@ -331,6 +339,7 @@ def admin_home(v):
return render_template("admin/admin_home.html", v=v, x=x)
@app.post("/admin/disablesignups")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def disablesignups(v):
@ -364,6 +373,7 @@ def badge_grant_get(v):
@app.post("/admin/badge_grant")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def badge_grant_post(v):
@ -592,6 +602,7 @@ def alt_votes_get(v):
@app.post("/admin/link_accounts")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def admin_link_accounts(v):
@ -638,6 +649,7 @@ def admin_removed(v):
@app.post("/admin/image_ban")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def admin_image_ban(v):
@ -693,6 +705,7 @@ def admin_image_ban(v):
@app.post("/agendaposter/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def agendaposter(user_id, v):
@ -746,6 +759,7 @@ def agendaposter(user_id, v):
@app.post("/shadowban/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def shadowban(user_id, v):
@ -771,6 +785,7 @@ def shadowban(user_id, v):
@app.post("/unshadowban/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def unshadowban(user_id, v):
@ -795,6 +810,7 @@ def unshadowban(user_id, v):
return {"message": "User unshadowbanned!"}
@app.post("/admin/verify/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def verify(user_id, v):
@ -805,6 +821,7 @@ def verify(user_id, v):
return {"message": "User verfied!"}
@app.post("/admin/unverify/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def unverify(user_id, v):
@ -816,6 +833,7 @@ def unverify(user_id, v):
@app.post("/admin/title_change/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def admin_title_change(user_id, v):
@ -849,6 +867,7 @@ def admin_title_change(user_id, v):
return redirect(user.url)
@app.post("/ban_user/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def ban_user(user_id, v):
@ -924,6 +943,7 @@ def ban_user(user_id, v):
@app.post("/unban_user/<user_id>")
@limiter.limit("1/second")
@admin_level_required(6)
@validate_formkey
def unban_user(user_id, v):
@ -961,6 +981,7 @@ def unban_user(user_id, v):
@app.post("/ban_post/<post_id>")
@limiter.limit("1/second")
@admin_level_required(3)
@validate_formkey
def ban_post(post_id, v):
@ -1004,6 +1025,7 @@ def ban_post(post_id, v):
@app.post("/unban_post/<post_id>")
@limiter.limit("1/second")
@admin_level_required(3)
@validate_formkey
def unban_post(post_id, v):
@ -1037,6 +1059,7 @@ def unban_post(post_id, v):
@app.post("/distinguish/<post_id>")
@limiter.limit("1/second")
@admin_level_required(1)
@validate_formkey
def api_distinguish_post(post_id, v):
@ -1062,6 +1085,7 @@ def api_distinguish_post(post_id, v):
@app.post("/sticky/<post_id>")
@limiter.limit("1/second")
@admin_level_required(3)
def api_sticky_post(post_id, v):
@ -1085,6 +1109,7 @@ def api_sticky_post(post_id, v):
else: return {"message": "Post unpinned!"}
@app.post("/pin/<post_id>")
@limiter.limit("1/second")
@auth_required
def api_pin_post(post_id, v):
@ -1098,6 +1123,7 @@ def api_pin_post(post_id, v):
else: return {"message": "Post unpinned!"}
@app.post("/ban_comment/<c_id>")
@limiter.limit("1/second")
@admin_level_required(1)
def api_ban_comment(c_id, v):
@ -1121,6 +1147,7 @@ def api_ban_comment(c_id, v):
@app.post("/unban_comment/<c_id>")
@limiter.limit("1/second")
@admin_level_required(1)
def api_unban_comment(c_id, v):
@ -1146,6 +1173,7 @@ def api_unban_comment(c_id, v):
@app.post("/distinguish_comment/<c_id>")
@limiter.limit("1/second")
@auth_required
def admin_distinguish_comment(c_id, v):
@ -1186,6 +1214,7 @@ def admin_banned_domains(v):
return render_template("admin/banned_domains.html", v=v, banned_domains=banned_domains)
@app.post("/admin/banned_domains")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def admin_toggle_ban_domain(v):
@ -1207,6 +1236,7 @@ def admin_toggle_ban_domain(v):
@app.post("/admin/nuke_user")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def admin_nuke_user(v):
@ -1240,6 +1270,7 @@ def admin_nuke_user(v):
@app.post("/admin/unnuke_user")
@limiter.limit("1/second")
@admin_level_required(4)
@validate_formkey
def admin_nunuke_user(v):