add user management

This commit is contained in:
team 1
2026-05-11 14:47:31 +02:00
parent acb1082398
commit e13d584025
13 changed files with 556 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
{% extends 'error/layout.html.twig' %}
{% set status_code = status_code|default(500) %}
{% block title %}Fehler {{ status_code }}{% endblock %}
{% block heading %}Ein Fehler ist aufgetreten{% endblock %}
{% block message %}Die Anfrage konnte nicht verarbeitet werden. Falls der Fehler erneut auftritt, prüfe bitte die System-Logs.{% endblock %}
{% block actions %}
{% if app.user and is_granted('ROLE_CHAT_USER') %}
<a class="btn btn-info" href="{{ path('chat_index') }}">
<i class="bi bi-chat-dots"></i> Zum Chat
</a>
{% endif %}
{% if app.user and is_granted('ROLE_ADMIN_AREA') %}
<a class="btn btn-outline-light" href="{{ path('admin_dashboard') }}">
<i class="bi bi-speedometer2"></i> Zum Adminbereich
</a>
{% endif %}
{% if not app.user %}
<a class="btn btn-info" href="{{ path('chat_login') }}">
<i class="bi bi-box-arrow-in-right"></i> Zur Anmeldung
</a>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,9 @@
{% extends 'error/access_denied.html.twig' %}
{% set status_code = status_code|default(403) %}
{% set area_label = area_label|default('Anwendung') %}
{% set required_role = required_role|default('passende Berechtigung') %}
{% set message = message|default('Für diese Seite fehlen deinem Benutzerkonto die notwendigen Rechte.') %}
{% set current_user_identifier = current_user_identifier|default(app.user ? app.user.userIdentifier : null) %}
{% set home_route = home_route|default(app.user and is_granted('ROLE_CHAT_USER') ? 'chat_index' : (app.user and is_granted('ROLE_ADMIN_AREA') ? 'admin_dashboard' : null)) %}
{% set home_label = home_label|default(home_route == 'chat_index' ? 'Zum Chat' : (home_route == 'admin_dashboard' ? 'Zum Admin-Dashboard' : null)) %}

View File

@@ -0,0 +1,29 @@
{% extends 'error/layout.html.twig' %}
{% set status_code = status_code|default(404) %}
{% block title %}Seite nicht gefunden · Fehler 404{% endblock %}
{% block icon %}<i class="bi bi-signpost-split fs-3 text-info"></i>{% endblock %}
{% block heading %}Seite nicht gefunden{% endblock %}
{% block message %}Die angeforderte Seite existiert nicht oder wurde verschoben.{% endblock %}
{% block actions %}
{% if app.user and is_granted('ROLE_CHAT_USER') %}
<a class="btn btn-info" href="{{ path('chat_index') }}">
<i class="bi bi-chat-dots"></i> Zum Chat
</a>
{% endif %}
{% if app.user and is_granted('ROLE_ADMIN_AREA') %}
<a class="btn btn-outline-light" href="{{ path('admin_dashboard') }}">
<i class="bi bi-speedometer2"></i> Zum Adminbereich
</a>
{% endif %}
{% if not app.user %}
<a class="btn btn-info" href="{{ path('chat_login') }}">
<i class="bi bi-box-arrow-in-right"></i> Zur Chat-Anmeldung
</a>
<a class="btn btn-outline-light" href="{{ path('admin_login') }}">
<i class="bi bi-shield-lock"></i> Zur Admin-Anmeldung
</a>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,27 @@
{% extends 'error/layout.html.twig' %}
{% set status_code = status_code|default(500) %}
{% block title %}Systemfehler · Fehler 500{% endblock %}
{% block icon %}<i class="bi bi-bug fs-3 text-danger"></i>{% endblock %}
{% block heading %}Systemfehler{% endblock %}
{% block message %}Es ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut oder prüfe die System-Logs im Adminbereich.{% endblock %}
{% block actions %}
{% if app.user and is_granted('ROLE_ADMIN_AREA') %}
<a class="btn btn-info" href="{{ path('admin_system_logs_index') }}">
<i class="bi bi-terminal"></i> System-Logs öffnen
</a>
<a class="btn btn-outline-light" href="{{ path('admin_dashboard') }}">
<i class="bi bi-speedometer2"></i> Zum Adminbereich
</a>
{% elseif app.user and is_granted('ROLE_CHAT_USER') %}
<a class="btn btn-info" href="{{ path('chat_index') }}">
<i class="bi bi-chat-dots"></i> Zum Chat
</a>
{% else %}
<a class="btn btn-info" href="{{ path('chat_login') }}">
<i class="bi bi-box-arrow-in-right"></i> Zur Chat-Anmeldung
</a>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,50 @@
{% extends 'error/layout.html.twig' %}
{% block title %}Zugriff verweigert · Fehler {{ status_code|default(403) }}{% endblock %}
{% block icon %}<i class="bi bi-shield-lock fs-3 text-warning"></i>{% endblock %}
{% block heading %}Zugriff verweigert{% endblock %}
{% block message %}
{{ message|default('Für diesen Bereich fehlen deinem Benutzerkonto die notwendigen Rechte.') }}
{% endblock %}
{% block details %}
<div class="alert bg-warning border-secondary text-dark mb-0">
<div class="row g-3 small">
<div class="col-md-6">
<div class="text-dark">Bereich</div>
<div class="fw-semibold">{{ area_label|default('Anwendung') }}</div>
</div>
<div class="col-md-6">
<div class="text-dark">Benötigte Rolle</div>
<code class="text-dark">{{ required_role|default('ROLE_USER') }}</code>
</div>
{% if current_user_identifier|default(null) %}
<div class="col-12">
<div class="text-dark">Angemeldeter Benutzer</div>
<div>{{ current_user_identifier }}</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block actions %}
{% if home_route|default(null) and home_label|default(null) %}
<a class="btn btn-info" href="{{ path(home_route) }}">
<i class="bi bi-arrow-left-circle"></i> {{ home_label }}
</a>
{% endif %}
{% if logout_route|default(null) %}
<a class="btn btn-outline-warning" href="{{ path(logout_route) }}">
<i class="bi bi-box-arrow-right"></i> Abmelden und anderen Benutzer verwenden
</a>
{% elseif login_route|default(null) %}
<a class="btn btn-outline-light" href="{{ path(login_route) }}">
<i class="bi bi-box-arrow-in-right"></i> Zur Anmeldung
</a>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,55 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Fehler {{ status_code|default(500) }}{% endblock %}</title>
<link href="/assets/styles/bootstrap.min.css" rel="stylesheet"/>
<link href="/assets/styles/base.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
<link rel="shortcut icon" href="https://www.mitho-media.de/media/fc/16/42/1667224106/favicon.ico?ts=1767609928">
</head>
<body class="bg-dark text-light min-vh-100 d-flex align-items-center">
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-8 col-xl-7">
<div class="card bg-black border-secondary text-light shadow-lg">
<div class="card-body p-4 p-md-5">
<div class="d-flex align-items-center gap-3 mb-4">
<div class="rounded-circle border border-info d-flex align-items-center justify-content-center"
style="width: 56px; height: 56px;">
{% block icon %}<i class="bi bi-exclamation-triangle fs-3 text-info"></i>{% endblock %}
</div>
<div>
<div class="text-info small text-uppercase fw-semibold">
Fehler {{ status_code|default(500) }}
</div>
<h1 class="h3 mb-0">{% block heading %}Ein Fehler ist aufgetreten{% endblock %}</h1>
</div>
</div>
<p class="lead mb-4">{% block message %}Die Anfrage konnte nicht verarbeitet werden.{% endblock %}</p>
{% block details %}{% endblock %}
<div class="d-flex flex-wrap gap-2 mt-4">
{% block actions %}
<a class="btn btn-info" href="{{ path('chat_index') }}">
<i class="bi bi-chat-dots"></i> Zum Chat
</a>
<a class="btn btn-outline-light" href="{{ path('admin_dashboard') }}">
<i class="bi bi-speedometer2"></i> Zum Adminbereich
</a>
{% endblock %}
</div>
</div>
</div>
<div class="text-center text-secondary small mt-3">
RAG-System · powered by mitho®
</div>
</div>
</div>
</div>
</body>
</html>