Add invite-code registration and admin user management
Open registration let anyone with the URL create an account. Two
changes address that:
- REGISTRATION_CODE (.env, optional): when set, registration requires
entering it correctly. Empty/unset keeps registration open, so
existing installs are unaffected until configured.
- is_admin flag on User: the first account ever created on an install
becomes admin automatically (existing installs get their oldest
account promoted via the startup migration, so nobody is locked
out of user management after upgrading).
Admins get a new "Benutzerverwaltung" panel in Einstellungen listing
every account (email, link/prompt counts, join date) with a delete
button per account — deleting cascades to that user's links and
prompts via the existing relationship cascade. Deleting your own
account through this page is blocked (redirects with an error) to
avoid accidental admin lockout. Non-admins get a 403 on the
/settings/users routes.
Also fixes several pre-existing German pluralization bugs found while
writing the new counts ("2 Linke" -> "2 Links", "Kontoen"/"Konton" ->
"Konten") — irregular plurals need a full word swap, not a suffix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,10 @@ Datenbank, per Menü umschaltbar.
|
||||
exportieren, SQL-Dump auch wieder importieren.
|
||||
- 🌗 **Dark/Light-Modus** über den Umschalter im Kopfbereich.
|
||||
- 👥 **Mehrbenutzer** – Registrierung/Login, jeder Nutzer sieht nur seine
|
||||
eigenen Links und Prompts.
|
||||
eigenen Links und Prompts. Registrierung optional per Einladungscode
|
||||
schützbar (`REGISTRATION_CODE` in der `.env`); das zuerst angelegte Konto
|
||||
wird automatisch Admin und kann unter Einstellungen → Benutzerverwaltung
|
||||
weitere Konten einsehen und löschen.
|
||||
|
||||
Die Fußzeile zeigt Autor, Version und den Hostnamen des Servers. Die Version
|
||||
lässt sich über `APP_VERSION` in der `.env` setzen.
|
||||
|
||||
Reference in New Issue
Block a user