modified: web/blueprints/auth.py

modified:   web/blueprints/group_admin.py
	modified:   web/blueprints/panel.py
	modified:   web/blueprints/site_admin.py
	modified:   web/templates/admin/base.html
	modified:   web/templates/admin/dashboard.html
	modified:   web/templates/admin/group_edit.html
	modified:   web/templates/admin/group_members.html
	modified:   web/templates/admin/groups.html
	modified:   web/templates/admin/user_edit.html
	modified:   web/templates/admin/users.html
	modified:   web/templates/auth/admin_login.html
	modified:   web/templates/auth/login.html
	modified:   web/templates/base.html
	modified:   web/templates/group_admin/base.html
	modified:   web/templates/group_admin/dashboard.html
	modified:   web/templates/group_admin/database.html
	modified:   web/templates/group_admin/member_edit.html
	modified:   web/templates/group_admin/members.html
	modified:   web/templates/panel/no_db.html
This commit is contained in:
SimolZimol
2026-04-01 02:55:32 +02:00
parent 93999d1c0d
commit c9c684f97a
21 changed files with 4633 additions and 184 deletions

View File

@@ -17,17 +17,17 @@ def login():
if request.method == "POST":
user = check_login(request.form.get("username", ""), request.form.get("password", ""))
if user and user["is_site_admin"]:
flash("Bitte nutze den Site-Admin-Login.", "warning")
flash("Please use the Site Admin login.", "warning")
return redirect(url_for("auth.admin_login"))
if user:
groups = get_user_groups(user["id"])
if not groups:
error = "Du bist keiner Gruppe zugewiesen. Wende dich an einen Admin."
error = "You are not assigned to any group. Please contact an admin."
else:
_set_user_session(user, groups)
return redirect(url_for("panel.dashboard"))
else:
error = "Falscher Benutzername oder Passwort."
error = "Incorrect username or password."
return render_template("auth/login.html", error=error)
@@ -46,9 +46,9 @@ def admin_login():
session["permissions"] = {}
return redirect(url_for("site_admin.dashboard"))
elif user:
error = "Keine Site-Admin-Berechtigung."
error = "No Site Admin privileges."
else:
error = "Falscher Benutzername oder Passwort."
error = "Incorrect username or password."
return render_template("auth/admin_login.html", error=error)
@@ -66,7 +66,7 @@ def switch_group(group_id):
groups = get_user_groups(user_id)
target = next((g for g in groups if g["id"] == group_id), None)
if not target:
flash("Gruppe nicht gefunden oder kein Zugriff.", "danger")
flash("Group not found or no access.", "danger")
return redirect(url_for("panel.dashboard"))
_apply_group(target)
return redirect(url_for("panel.dashboard"))