From f4af0779fdde338f1f642f4971307b812444ef60 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 2 Jul 2023 22:57:08 +0300 Subject: [PATCH] add error for signatures for non-paypigs --- files/routes/settings.py | 7 +++++-- files/templates/settings/personal.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index f3c1cdbf9..ce9fb8284 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -60,7 +60,7 @@ def upload_custom_background(v): if g.is_tor: abort(403, "Image uploads are not allowed through TOR!") if not v.patron: - abort(403, f"This feature is only available to {patron}s!") + abort(403, f"Custom site backgrounds are only available to {patron}s!") file = request.files["file"] @@ -232,7 +232,10 @@ def settings_personal_post(v): g.db.add(v) return render_template("settings/personal.html", v=v, msg="Your enemies list has been updated!") - elif not updated and v.patron and request.values.get("sig"): + elif not updated and request.values.get("sig"): + if not v.patron: + abort(403, f"Signatures are only available to {patron}s!") + sig = request.values.get("sig")[:200].replace('\n','').replace('\r','') sig_html = sanitize(sig, blackjack="signature") if len(sig_html) > 1000: diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index b6ffacc3d..a17690c48 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -213,7 +213,7 @@ {{common.text_area_section('profile-bio', '/settings/personal', 'bio', 'Bio', v.bio, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Tell the community a bit about yourself.', true, true, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, FEATURES['USERS_PROFILE_BODYTEXT'])}} {{common.text_area_section('profile-friends', '/settings/personal', 'friends', 'Friends', v.friends, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your friends on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}} {{common.text_area_section('profile-enemies', '/settings/personal', 'enemies', 'Enemies', v.enemies, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your enemies on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}} - {{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200, v.patron or v.sig)}} + {{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200, true)}} {# toggle_section(title, id, name, flag, below_text, disabled) #} {{common.toggle_section('Private Mode', 'privateswitch', 'private', v.is_private, 'This will hide your profile page from others.', false)}} {{common.toggle_section('Spider', 'spiderswitch', 'spider', v.spider, 'Have a spider friend accompany you during your journey on the site.', v.spider > 1)}}