MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / admin_panel

Function admin_panel

Scripts/ButSystem.py:12009–12040  ·  view source on GitHub ↗

admin_panel. Admin-only route handler. This docstring was expanded to make future maintenance easier. Returns: Varies.

()

Source from the content-addressed store, hash-verified

12007 title="Settings",
12008 prefs=prefs,
12009 accent_choices=ACCENT_CHOICES,
12010 font_choices=FONT_CHOICES,
12011 ui_theme_choices=UI_THEME_CHOICES,
12012 )
12013
12014@app.route("/settings/appearance", methods=["POST"])
12015@login_required
12016def settings_appearance():
12017 """Update UI appearance settings (theme style, accent color, font) for the current user."""
12018 me = current_user()
12019 accent = (request.form.get("accent") or "").strip()
12020 font = (request.form.get("font") or "").strip()
12021 ui_theme = (request.form.get("ui_theme") or "").strip()
12022 set_user_prefs(me, accent, font, ui_theme)
12023 flash("Appearance updated.")
12024 return redirect(url_for("settings_appearance_page"))
12025
12026@app.route("/recover", methods=["GET", "POST"])
12027def recover():
12028 """recover.
12029
12030Internal helper function.
12031
12032This docstring was added automatically to improve maintainability.
12033
12034Returns:
12035 Varies.
12036"""
12037 # Password recovery using security questions
12038 if request.method == "GET":
12039 return render_template("recover.html", title="Recover")
12040
12041 ip = _client_ip() or "?"
12042 if _rate_limit_hit("recover_post", ip, limit=10, window_sec=1800):
12043 flash("Too many recovery attempts. Try again later.")

Callers

nothing calls this directly

Calls 4

require_adminFunction · 0.70
db_connectFunction · 0.70
ObjClass · 0.70
current_userFunction · 0.70

Tested by

no test coverage detected