feat: add e-mail change with confirmation and undo

Page at /email asks for the new address and the current password (shared failure counter with the password page, five requests per hour) and mails a one-hour confirmation link to the new address. Confirming writes the address and mails the old address a 24-hour undo link; undoing restores it, ends every session of the user and notifies the Admin (ADMIN_NOTIFY_EMAIL). Link pages show on GET and apply on POST; tokens are stored only as hashes, single use, and are blanked from every log line. New table owned by profile, German text, tests; review findings logged in the plan.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FocPJ75XPma7TcuYEMy8zm
This commit is contained in:
Ebbe Baß
2026-10-19 10:05:41 +02:00
co-authored by Claude Sonnet 5.5
parent 3fd8f27127
commit 94c1d39c9d
35 changed files with 1792 additions and 14 deletions
+134
View File
@@ -314,3 +314,137 @@ msgstr "Ihre Angaben wurden möglicherweise geändert, aber das Portal konnte ni
msgid "Back to the profile"
msgstr "Zurück zum Profil"
msgid "This is already your e-mail address."
msgstr "Das ist bereits Ihre E-Mail-Adresse."
msgid "This e-mail address is too long."
msgstr "Diese E-Mail-Adresse ist zu lang."
msgid "Please enter a valid e-mail address."
msgstr "Bitte geben Sie eine gültige E-Mail-Adresse ein."
msgid "Change e-mail address"
msgstr "E-Mail-Adresse ändern"
msgid "Announcements and security notices are sent to this address. We send a link to the new address. Your address changes only after you open the link and confirm."
msgstr "Ankündigungen und Sicherheitshinweise werden an diese Adresse gesendet. Wir senden einen Link an die neue Adresse. Ihre Adresse ändert sich erst, wenn Sie den Link öffnen und bestätigen."
msgid "No link was sent."
msgstr "Es wurde kein Link gesendet."
msgid "Current e-mail address"
msgstr "Aktuelle E-Mail-Adresse"
msgid "New e-mail address"
msgstr "Neue E-Mail-Adresse"
msgid "We check it before anything is sent."
msgstr "Wir prüfen es, bevor etwas gesendet wird."
msgid "Send confirmation link"
msgstr "Bestätigungslink senden"
msgid "Confirmation link sent"
msgstr "Bestätigungslink gesendet"
msgid "We sent a link to your new e-mail address. It is valid for one hour."
msgstr "Wir haben einen Link an Ihre neue E-Mail-Adresse gesendet. Er ist eine Stunde gültig."
msgid "Your address has not changed yet. It changes after you open the link and confirm."
msgstr "Ihre Adresse hat sich noch nicht geändert. Sie ändert sich, sobald Sie den Link öffnen und bestätigen."
msgid "Confirm new e-mail address"
msgstr "Neue E-Mail-Adresse bestätigen"
msgid "The e-mail address of your account will change. Nothing changes until you press the button."
msgstr "Die E-Mail-Adresse Ihres Kontos wird geändert. Erst wenn Sie die Schaltfläche drücken, ändert sich etwas."
msgid "A notice with a way to undo the change is sent to the current address."
msgstr "An die aktuelle Adresse wird ein Hinweis mit der Möglichkeit gesendet, die Änderung rückgängig zu machen."
msgid "Confirm change"
msgstr "Änderung bestätigen"
msgid "E-mail address changed"
msgstr "E-Mail-Adresse geändert"
msgid "Your e-mail address was changed."
msgstr "Ihre E-Mail-Adresse wurde geändert."
msgid "A notice with a way to undo the change was sent to your previous address."
msgstr "Ein Hinweis mit der Möglichkeit, die Änderung rückgängig zu machen, wurde an Ihre bisherige Adresse gesendet."
msgid "Undo e-mail change"
msgstr "E-Mail-Änderung rückgängig machen"
msgid "The e-mail address of your account was changed. If you did not do this, undo the change now."
msgstr "Die E-Mail-Adresse Ihres Kontos wurde geändert. Wenn Sie das nicht waren, machen Sie die Änderung jetzt rückgängig."
msgid "Previous e-mail address"
msgstr "Bisherige E-Mail-Adresse"
msgid "Undoing restores the previous address, signs you out on all devices and informs the administrator."
msgstr "Beim Rückgängigmachen wird die bisherige Adresse wiederhergestellt, Sie werden auf allen Geräten abgemeldet und die Administration wird informiert."
msgid "Undo change"
msgstr "Änderung rückgängig machen"
msgid "E-mail change undone"
msgstr "E-Mail-Änderung rückgängig gemacht"
msgid "Your previous e-mail address is back. You were signed out on all devices."
msgstr "Ihre bisherige E-Mail-Adresse ist wieder eingetragen. Sie wurden auf allen Geräten abgemeldet."
msgid "Someone else may have had access to your account. Please change your password now."
msgstr "Möglicherweise hatte jemand anderes Zugriff auf Ihr Konto. Bitte ändern Sie jetzt Ihr Passwort."
msgid "Address changed again"
msgstr "Adresse erneut geändert"
msgid "The e-mail address was changed again since then. Nothing was changed now. If this was not you, contact the administrator."
msgstr "Die E-Mail-Adresse wurde seitdem erneut geändert. Jetzt wurde nichts geändert. Wenn Sie das nicht waren, wenden Sie sich an die Administration."
msgid "Link not valid"
msgstr "Link nicht gültig"
msgid "This link is not valid any more."
msgstr "Dieser Link ist nicht mehr gültig."
msgid "Your e-mail address may have been changed, but the portal could not finish. Please check your profile or contact the administrator."
msgstr "Ihre E-Mail-Adresse wurde möglicherweise geändert, aber das Portal konnte den Vorgang nicht abschließen. Bitte prüfen Sie Ihr Profil oder wenden Sie sich an die Administration."
msgid "Please confirm your new e-mail address"
msgstr "Bitte bestätigen Sie Ihre neue E-Mail-Adresse"
msgid "this e-mail address was entered as the new e-mail address of your portal account. To confirm it, open this link and press the button. The link is valid for one hour:"
msgstr "diese E-Mail-Adresse wurde als neue E-Mail-Adresse Ihres Portal-Kontos angegeben. Um sie zu bestätigen, öffnen Sie diesen Link und drücken Sie die Schaltfläche. Der Link ist eine Stunde gültig:"
msgid "Your address changes only after you confirm. If you did not ask for this, ignore this e-mail. Nothing will change."
msgstr "Ihre Adresse ändert sich erst, wenn Sie bestätigen. Wenn Sie das nicht veranlasst haben, ignorieren Sie diese E-Mail. Es ändert sich nichts."
msgid "Your e-mail address was changed"
msgstr "Ihre E-Mail-Adresse wurde geändert"
#, python-format
msgid "the e-mail address of your portal account was changed on %(when)s (%(zone)s) to %(address)s."
msgstr "die E-Mail-Adresse Ihres Portal-Kontos wurde am %(when)s (%(zone)s) auf %(address)s geändert."
msgid "If you did this, you do not need to do anything. If you did not, open this link to restore this address. The link is valid for 24 hours:"
msgstr "Wenn Sie das waren, müssen Sie nichts tun. Wenn nicht, öffnen Sie diesen Link, um diese Adresse wiederherzustellen. Der Link ist 24 Stunden gültig:"
msgid "Undoing signs you out on all devices and informs the administrator."
msgstr "Beim Rückgängigmachen werden Sie auf allen Geräten abgemeldet und die Administration wird informiert."
msgid "An e-mail change was undone"
msgstr "Eine E-Mail-Änderung wurde rückgängig gemacht"
msgid "Hello,"
msgstr "Guten Tag,"
#, python-format
msgid "the user %(username)s undid an e-mail change on %(when)s (%(zone)s). All sessions of this user were ended."
msgstr "der Benutzer %(username)s hat am %(when)s (%(zone)s) eine E-Mail-Änderung rückgängig gemacht. Alle Sitzungen dieses Benutzers wurden beendet."
msgid "The user may have lost control of the account. Please check it."
msgstr "Der Benutzer hat möglicherweise die Kontrolle über das Konto verloren. Bitte prüfen Sie es."
+42
View File
@@ -83,3 +83,45 @@ msgstr "Ein Wert wurde nicht angenommen. Bitte prüfe deine Eingaben."
msgid "Your details may have been changed, but the portal could not finish. Please open your profile and check them. If they are wrong, contact the administrator."
msgstr "Deine Angaben wurden möglicherweise geändert, aber das Portal konnte nicht abschließen. Bitte öffne dein Profil und prüfe sie. Wenn sie falsch sind, wende dich an die Administration."
msgid "This is already your e-mail address."
msgstr "Das ist bereits deine E-Mail-Adresse."
msgid "Please enter a valid e-mail address."
msgstr "Bitte gib eine gültige E-Mail-Adresse ein."
msgid "Announcements and security notices are sent to this address. We send a link to the new address. Your address changes only after you open the link and confirm."
msgstr "Ankündigungen und Sicherheitshinweise werden an diese Adresse gesendet. Wir senden einen Link an die neue Adresse. Deine Adresse ändert sich erst, wenn du den Link öffnest und bestätigst."
msgid "We sent a link to your new e-mail address. It is valid for one hour."
msgstr "Wir haben einen Link an deine neue E-Mail-Adresse gesendet. Er ist eine Stunde gültig."
msgid "Your address has not changed yet. It changes after you open the link and confirm."
msgstr "Deine Adresse hat sich noch nicht geändert. Das passiert erst, wenn du den Link öffnest und bestätigst."
msgid "The e-mail address of your account will change. Nothing changes until you press the button."
msgstr "Die E-Mail-Adresse deines Kontos wird geändert. Erst wenn du die Schaltfläche drückst, ändert sich etwas."
msgid "Your e-mail address was changed."
msgstr "Deine E-Mail-Adresse wurde geändert."
msgid "A notice with a way to undo the change was sent to your previous address."
msgstr "Ein Hinweis mit der Möglichkeit, die Änderung rückgängig zu machen, wurde an deine bisherige Adresse gesendet."
msgid "The e-mail address of your account was changed. If you did not do this, undo the change now."
msgstr "Die E-Mail-Adresse deines Kontos wurde geändert. Wenn du das nicht warst, mach die Änderung jetzt rückgängig."
msgid "Undoing restores the previous address, signs you out on all devices and informs the administrator."
msgstr "Beim Rückgängigmachen wird die bisherige Adresse wiederhergestellt, du wirst auf allen Geräten abgemeldet und die Administration wird informiert."
msgid "Your previous e-mail address is back. You were signed out on all devices."
msgstr "Deine bisherige E-Mail-Adresse ist wieder eingetragen. Du wurdest auf allen Geräten abgemeldet."
msgid "Someone else may have had access to your account. Please change your password now."
msgstr "Möglicherweise hatte jemand anderes Zugriff auf dein Konto. Bitte ändere jetzt dein Passwort."
msgid "The e-mail address was changed again since then. Nothing was changed now. If this was not you, contact the administrator."
msgstr "Die E-Mail-Adresse wurde seitdem erneut geändert. Jetzt wurde nichts geändert. Wenn du das nicht warst, wende dich an die Administration."
msgid "Your e-mail address may have been changed, but the portal could not finish. Please check your profile or contact the administrator."
msgstr "Deine E-Mail-Adresse wurde möglicherweise geändert, aber das Portal konnte den Vorgang nicht abschließen. Bitte prüfe dein Profil oder wende dich an die Administration."