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

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