- Django 5.2 + PostgreSQL 17 via docker compose (app + db, volumes, healthcheck on /healthz, test profile running pytest against Postgres) - Custom e-mail user model with user/admin roles - Invitation-only registration with single-use, hashed, expiring links - Admin area: invitations, role changes, deactivation, password reset via one-time link or temporary password (forced change on login) - First admin created from ADMIN_EMAIL/ADMIN_PASSWORD on startup - Login rate limiting per e-mail and IP (DB-backed, worker-safe) - Proxy middleware honouring X-Forwarded-* only from TRUSTED_PROXIES, optional CLIENT_IP_HEADER (e.g. CF-Connecting-IP) - Security headers (CSP, HSTS, Permissions-Policy), secure __Host- cookies - Mobile-first German UI, CLAUDE.md, README, init-env script - 65 tests for auth, permissions, proxy handling and rate limiting Co-Authored-By: Claude Opus 5.5 <[email protected]>
39 lines
2.1 KiB
HTML
39 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Nutzer verwalten{% endblock %}
|
|
{% block content %}
|
|
<h1>Nutzer</h1>
|
|
<p><a class="button" href="{% url 'accounts:admin_invitations' %}">Neue Einladung</a></p>
|
|
<ul class="list">
|
|
{% for u in users %}
|
|
<li class="card{% if not u.is_active %} inactive{% endif %}">
|
|
<div class="row-head">
|
|
<strong>{{ u.display_name }}</strong>
|
|
<span class="badge">{{ u.get_role_display }}</span>
|
|
{% if not u.is_active %}<span class="badge badge-muted">deaktiviert</span>{% endif %}
|
|
{% if u.must_change_password %}<span class="badge badge-muted">temp. Passwort</span>{% endif %}
|
|
</div>
|
|
<div class="muted">{{ u.email }} · seit {{ u.date_joined|date:"d.m.Y" }}</div>
|
|
<details class="actions">
|
|
<summary>Aktionen</summary>
|
|
<div class="action-buttons">
|
|
{% if u.is_active %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'reset_link' %}">{% csrf_token %}<button class="button secondary">Reset-Link erzeugen</button></form>
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'temp_password' %}">{% csrf_token %}<button class="button secondary">Temporäres Passwort</button></form>
|
|
{% if u != user %}
|
|
{% if u.role == "admin" %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'make_user' %}">{% csrf_token %}<button class="button secondary">Zu Nutzer machen</button></form>
|
|
{% else %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'make_admin' %}">{% csrf_token %}<button class="button secondary">Zu Admin machen</button></form>
|
|
{% endif %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'deactivate' %}">{% csrf_token %}<button class="button danger">Deaktivieren</button></form>
|
|
{% endif %}
|
|
{% else %}
|
|
<form method="post" action="{% url 'accounts:admin_user_action' u.pk 'activate' %}">{% csrf_token %}<button class="button secondary">Aktivieren</button></form>
|
|
{% endif %}
|
|
</div>
|
|
</details>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %}
|