This commit is contained in:
maaa 2023-07-10 19:25:08 +02:00
parent 8330a8a5be
commit 7470ea2c98
3 changed files with 16 additions and 6 deletions

9
main
View File

@ -337,8 +337,7 @@ def apipost():
if not user["banned"] == "0":
return {
"error": "banned",
"reason": user["banned"]
"error": "banned"
}, 403
conn = get_db_connection()
@ -391,8 +390,7 @@ def post():
user = get_user(userCookie["id"])
if not user["banned"] == "0":
flash("Your account has been banned. Reason: " +
user["banned"])
flash("Your account has been banned. You may no longer perform this action.")
return redirect(url_for("post"))
filename = secure_filename(file.filename)
@ -438,8 +436,7 @@ def comment():
if not user["banned"] == "0":
return {
"error": "banned",
"reason": user["banned"]
"error": "banned"
}, 403
conn = get_db_connection()

View File

@ -163,6 +163,13 @@ body {
text-decoration: none;
}
.warning {
width: 100%;
background-color: #f1b739;
color: black;
padding: 10px;
}
.hidden {
display: none;
}

View File

@ -29,6 +29,12 @@
</script>
<div class="postDiv">
{% if userdata %}
{% if userdata.banned == "0" %}
{% else %}
<p class="warning">Your account has been banned. Reason: "{{ userdata.banned }}". <a href="/settings/logout">Log out</a></p>
{% endif %}
{% endif %}
{% for post in posts %}
<div class="post" id="post">
<p><a href='/@{{ getUser(post["creator"])["username"] }}' class="username usernamelink">{{ getUser(post["creator"])["username"] }}</a></p>