diff --git a/files/helpers/const.py b/files/helpers/const.py index 57aa6144d..e5a991b5b 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1077,7 +1077,7 @@ forced_hats = { "marseyawarded": ("Three Lil Marseys", ":marseynotes: :marseynotes: :I prefer to speak in cats:"), "bite": ("Vampire Mask", "When other little girls wanted to be ballet dancers I kind of wanted to be a vampire."), "rainbow": ("Globohomo", "Homosexuality is no longer optional!"), - "owoify": ("Furry Marsey", "Nuzzles, pounces on you, UwU, you're so warm!.."), + "owoify": ("Cat Ears (wiggly)", "Nuzzles, pounces on you, UwU, you're so warm!.."), "earlylife": ("The Merchant", "SHUT IT DOWN, the goys know!"), "marsify": ("Marsified", "I can't pick my own Marseys, help!"), "is_banned": ("Behind Bars", "This user is banned and needs to do better!"), diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 683cf8ca7..8d9c32028 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -112,6 +112,14 @@ def auth_desired_with_logingate(f): v = get_logged_in_user() if app.config['SETTINGS']['login_required'] and not v: abort(401) + if not v and not request.path.startswith('/logged_out'): + return redirect(f"/logged_out{request.full_path}") + + if v and request.path.startswith('/logged_out'): + redir = request.full_path.replace('/logged_out','') + if not redir: redir = '/' + return redirect(redir) + check_ban_evade(v) return make_response(f(*args, v=v, **kwargs)) diff --git a/files/routes/comments.py b/files/routes/comments.py index b1e08fda4..7d3c44bb9 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -34,9 +34,6 @@ WORDLE_COLOR_MAPPINGS = {-1: "🟥", 0: "🟨", 1: "🟩"} @auth_desired_with_logingate def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): - if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}#context") - if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','') + '#context') - try: cid = int(cid) except: abort(404) diff --git a/files/routes/front.py b/files/routes/front.py index 9c9257e11..fc22ce3fa 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -19,14 +19,6 @@ from files.helpers.awards import award_timers @auth_desired_with_logingate def front_all(v, sub=None, subdomain=None): - if not v and not request.path.startswith('/logged_out'): - return redirect(f"/logged_out{request.full_path}") - - if v and request.path.startswith('/logged_out'): - redir = request.full_path.replace('/logged_out','') - if not redir.startswith('/'): redir = f'/{redir}' - return redirect(redir) - if sub: sub = sub.strip().lower() if sub == 'chudrama' and not (v and v.can_see_chudrama): abort(403) diff --git a/files/routes/posts.py b/files/routes/posts.py index 1ffa53943..d0bf7da53 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -106,9 +106,6 @@ def submit_get(v, sub=None): @auth_desired_with_logingate def post_id(pid, anything=None, v=None, sub=None): - if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) - try: pid = int(pid) except Exception as e: pass diff --git a/files/routes/static.py b/files/routes/static.py index be78b2093..e4d5ebe90 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -71,11 +71,8 @@ def marsey_list(): @app.get('/sidebar') @app.get('/logged_out/rules') @app.get('/logged_out/sidebar') -@auth_desired +@auth_desired_with_logingate def sidebar(v): - if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) - return render_template('sidebar.html', v=v) @@ -184,7 +181,7 @@ def log_item(id, v): return render_template("log.html", v=v, actions=[action], next_exists=False, page=1, action=action, admins=admins, types=types) @app.get("/directory") -@auth_desired +@auth_required def static_megathread_index(v): return render_template("megathread_index.html", v=v) @@ -425,26 +422,11 @@ def transfers(v): else: return render_template("transfers.html", v=v, page=page, comments=comments, standalone=True, next_exists=next_exists) -@app.get("/kb/") -@auth_desired -def knowledgebase(v, page): - if not knowledgebase_page_regex.fullmatch(page): - abort(404) - - template_path = f'kb/{SITE_NAME}/{page}.html' - if not os.path.exists('files/templates/' + template_path): - abort(404) - - return render_template(template_path, v=v) - if not os.path.exists(f'files/templates/donate_{SITE_NAME}.html'): copyfile(f'files/templates/donate_rDrama.html', f'files/templates/donate_{SITE_NAME}.html') @app.get('/donate') -@auth_desired +@auth_required def donate(v): - if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) - return render_template(f'donate_{SITE_NAME}.html', v=v) \ No newline at end of file diff --git a/files/routes/subs.py b/files/routes/subs.py index 1d906ab9e..1893616c5 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -501,7 +501,7 @@ def sub_marsey(v, sub): return redirect(f'/h/{sub}/settings') @app.get("/holes") -@auth_desired_with_logingate +@auth_required def subs(v): subs = g.db.query(Sub, func.count(Submission.sub)).outerjoin(Submission, Sub.name == Submission.sub).group_by(Sub.name).order_by(func.count(Submission.sub).desc()).all() return render_template('sub/subs.html', v=v, subs=subs) diff --git a/files/routes/users.py b/files/routes/users.py index 43d03f504..ecf524c10 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -935,12 +935,6 @@ def visitors(v): @auth_desired_with_logingate def u_username(username, v=None): - if not v and not request.path.startswith('/logged_out'): - return redirect(f"/logged_out{request.full_path}") - - if v and request.path.startswith('/logged_out'): - return redirect(request.full_path.replace('/logged_out','')) - u = get_user(username, v=v, rendered=True) if v and username == v.username: @@ -1042,12 +1036,6 @@ def u_username(username, v=None): @auth_desired_with_logingate def u_username_comments(username, v=None): - if not v and not request.path.startswith('/logged_out'): - return redirect(f"/logged_out{request.full_path}") - - if v and request.path.startswith('/logged_out'): - return redirect(request.full_path.replace('/logged_out','')) - user = get_user(username, v=v, rendered=True) if v and username == v.username: diff --git a/files/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html index 65b6d1d73..1a57f0e40 100644 --- a/files/templates/expanded_image_modal.html +++ b/files/templates/expanded_image_modal.html @@ -6,7 +6,7 @@
- expanded image + expanded image
diff --git a/snappy_rDrama.txt b/snappy_rDrama.txt index 7b12aaedc..c49a78d58 100644 --- a/snappy_rDrama.txt +++ b/snappy_rDrama.txt @@ -2989,8 +2989,6 @@ it's cool if it's not your thing, but don't yuck someone else's yum :) {[para]} https://rdrama.net/videos/16624761306946733.mp4 {[para]} -@joebiden @soren @duck -{[para]} TRANS LIVES MATTER {[para]} ![](/images/16628662340977426.webp)