Files
ebbe.bassandClaude Sonnet 5.5 49c7fd4a0b feat: add password change
Password page with the AD policy listed first, ordered service (throttle limit below the lockout threshold, verification, local hints, directory change, ended sessions, audit and confirmation mail in one transaction), plain-language errors, German text and tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3t4WL7bd9bdHHNjEsxzqC
2026-10-18 10:08:17 +02:00

48 lines
2.3 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Change password" %}{% endblock %}
{% block content %}
<h1>{% trans "Change password" %}</h1>
<p class="lead">{% trans "This password applies to every service that uses your account. After the change you are signed out on your other devices and you receive a confirmation by e-mail." %}</p>
{% if throttled %}
<div class="notice" role="alert" tabindex="-1" data-focus-on-load>
<p>{% trans "Too many attempts. Please wait a few minutes." %}</p>
</div>
<p><a class="button" href="{% url 'home' %}">{% trans "Back to the start page" %}</a></p>
{% else %}
{% if form.errors %}
<div class="error-summary" role="alert" tabindex="-1" data-focus-on-load>
<p><strong>{% trans "The password was not changed." %}</strong></p>
<ul>
{% for field in form %}{% for error in field.errors %}
<li><a href="#{{ field.id_for_label }}">{{ error }}</a></li>
{% endfor %}{% endfor %}
</ul>
</div>
{% endif %}
<form method="post" action="{% url 'password' %}" class="card" data-busy-on-submit novalidate>
{% csrf_token %}
{% if rules %}
<div class="rules">
<p class="hint">{% trans "Your new password must follow these rules:" %}</p>
<ul>
{% for rule in rules %}<li>{{ rule }}</li>{% endfor %}
</ul>
{% if partly_known %}<p class="hint">{% trans "A stricter rule may also apply to your account." %}</p>{% endif %}
</div>
{% endif %}
{% trans "Current password" as label %}{% trans "We check it before anything is changed." as hint %}
{% include "profile/_field.html" with field=form.current_password label=label hint=hint autocomplete="current-password" %}
{% trans "New password" as label %}
{% include "profile/_field.html" with field=form.new_password label=label hint="" autocomplete="new-password" %}
{% trans "Repeat new password" as label %}
{% include "profile/_field.html" with field=form.confirm_password label=label hint="" autocomplete="new-password" %}
<p class="actions">
<button type="submit" class="primary"><span class="spinner" aria-hidden="true"></span>{% trans "Change password" %}</button>
<a class="button" href="{% url 'home' %}">{% trans "Cancel" %}</a>
</p>
</form>
<p class="hint">{% trans "Forgotten or expired password? Please contact the administrator." %}</p>
{% endif %}
{% endblock %}