title change permission

master
justcool393 2022-10-05 22:45:44 -07:00
parent 1220d06eab
commit 0c0fa68cb4
3 changed files with 6 additions and 5 deletions

View File

@ -137,6 +137,7 @@ PERMS = { # Minimum admin_level to perform action.
'USER_AGENDAPOSTER': 2, 'USER_AGENDAPOSTER': 2,
'USER_CLUB_ALLOW_BAN': 2, 'USER_CLUB_ALLOW_BAN': 2,
'USER_LINK': 2, 'USER_LINK': 2,
'USER_TITLE_CHANGE': 2,
'POST_TO_CHANGELOG': 1, 'POST_TO_CHANGELOG': 1,
'POST_TO_POLL_THREAD': 2, 'POST_TO_POLL_THREAD': 2,
'POST_BETS': 3, 'POST_BETS': 3,

View File

@ -954,7 +954,7 @@ def unshadowban(user_id, v):
@app.post("/admin/title_change/<user_id>") @app.post("/admin/title_change/<user_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day") @limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2) @admin_level_required(PERMS['USER_TITLE_CHANGE'])
def admin_title_change(user_id, v): def admin_title_change(user_id, v):
user = get_account(user_id) user = get_account(user_id)

View File

@ -273,6 +273,7 @@
{% if v and v.id != u.id and v.admin_level > 1 %} {% if v and v.id != u.id and v.admin_level > 1 %}
<br><br> <br><br>
<div class="body d-lg-flex border-bottom"> <div class="body d-lg-flex border-bottom">
{% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
<div class="w-lg-100"> <div class="w-lg-100">
<form action="/admin/title_change/{{u.id}}" method="post"> <form action="/admin/title_change/{{u.id}}" method="post">
@ -290,7 +291,7 @@
</div> </div>
</form> </form>
</div> </div>
{% endif %}
</div> </div>
<pre></pre> <pre></pre>
<pre></pre> <pre></pre>
@ -646,9 +647,8 @@
<br><br> <br><br>
<div class="body d-lg-flex border-bottom"> <div class="body d-lg-flex border-bottom">
{% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
<div class="w-lg-100"> <div class="w-lg-100">
<form action="/admin/title_change/{{u.id}}" method="post"> <form action="/admin/title_change/{{u.id}}" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}"> <input type="hidden" name="formkey" value="{{v.formkey}}">
<input maxlength=100 autocomplete="off" id="customtitlebody-mobile" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if u.customtitleplain %}{{u.customtitleplain}}{% endif %}"> <input maxlength=100 autocomplete="off" id="customtitlebody-mobile" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if u.customtitleplain %}{{u.customtitleplain}}{% endif %}">
@ -664,7 +664,7 @@
</div> </div>
</form> </form>
</div> </div>
{% endif %}
</div> </div>
<pre></pre> <pre></pre>
<pre></pre> <pre></pre>