modified: app.py
This commit is contained in:
24
app.py
24
app.py
@@ -308,30 +308,6 @@ def global_admin_dashboard():
|
|||||||
return render_template("admin_dashboard.html")
|
return render_template("admin_dashboard.html")
|
||||||
return redirect(url_for("user_landing_page"))
|
return redirect(url_for("user_landing_page"))
|
||||||
|
|
||||||
@app.route("/user_dashboard/<int:guild_id>")
|
|
||||||
def user_dashboard(guild_id):
|
|
||||||
"""Zeigt das User-Dashboard für einen spezifischen Server (guild_id) an."""
|
|
||||||
if "discord_user" in session:
|
|
||||||
user_info = session["discord_user"]
|
|
||||||
user_id = user_info["id"]
|
|
||||||
|
|
||||||
connection = get_db_connection()
|
|
||||||
cursor = connection.cursor(dictionary=True)
|
|
||||||
|
|
||||||
# Hole Benutzerinformationen für den ausgewählten Server
|
|
||||||
cursor.execute("SELECT * FROM user_data WHERE user_id = %s AND guild_id = %s", (user_id, guild_id))
|
|
||||||
user_data = cursor.fetchone()
|
|
||||||
|
|
||||||
cursor.close()
|
|
||||||
connection.close()
|
|
||||||
|
|
||||||
if user_data:
|
|
||||||
return render_template("user_dashboard.html", user_info=user_info, user_data=user_data, guild_id=guild_id)
|
|
||||||
else:
|
|
||||||
return "User data not found", 404
|
|
||||||
|
|
||||||
return redirect(url_for("login"))
|
|
||||||
|
|
||||||
@app.route("/logout")
|
@app.route("/logout")
|
||||||
def logout():
|
def logout():
|
||||||
"""Meldet den Benutzer ab."""
|
"""Meldet den Benutzer ab."""
|
||||||
|
|||||||
Reference in New Issue
Block a user