Commit graph

14 commits

Author SHA1 Message Date
Maaxxs
e4f23fcde4 Audit log, abuse protection, gallery comments with moderation, safe image uploads, 404 page
- Audit log: every admin_log entry is also stored permanently in the database (admin/audit.php, audit.view)
- Rate limits per account, login throttling per IP (not per account), emergency lock after mass deletions, force logout / lock in user management
- Comments under gallery pictures (picture page, report button, owner can disable them)
- Moderation: new members, links, reported content and a "moderate everything" switch go to the approval list (moderation.php)
- Every uploaded image is re-encoded (strips appended code and EXIF data)
- Custom 404 page, also shown for pages without permission

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 21:57:34 +02:00
Maaxxs
276f80bd7b User management and raids: search field; user management also has status filters and sorting
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 21:03:17 +02:00
Maaxxs
8405855a5c User management: sort by developer, administrator, then highest group
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 20:06:24 +02:00
Maaxxs
0123d4d028 Developer accounts (by Discord ID) always have all permissions and are protected
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 18:58:20 +02:00
Maaxxs
9412a59b72 Per-user administrator flag with all permissions, managed via users.admin
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 18:54:44 +02:00
Maaxxs
ba8cf2a2ef Admin: sync Discord roles on demand
Besides the automatic check every five minutes during a session, the user
list gets "Jetzt mit Discord abgleichen" (all linked accounts, logged in or
not) and the user form "Jetzt abgleichen" (one account), both for users.edit.
They run the same check with the stored token, just without waiting for the
interval, and report how many accounts were synced, left the server, have an
expired Discord login, never logged in via Discord, or could not be reached.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:06:51 +02:00
Maaxxs
f5c7a6f776 Admin: edit and delete as icons in the user and group tables
"Bearbeiten" and "Löschen" become the same pencil/trash icon buttons the
events page already uses, with the text kept as tooltip and aria-label.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:02:18 +02:00
Maaxxs
0eb8816ef8 Admin: switch for unlinking Discord, keep table actions in view
The user list gets a switch "Mitglieder dürfen ihre Discord-Verknüpfung im
Profil lösen" (users.edit, default on). Turned off, the profile shows a note
instead of the button and discord_unlink.php refuses the request. The value
lives in a new settings table, created automatically like the other schema
additions (SCHEMA_VERSION 2).

The user and group tables were wider than the 1100px content column, so the
actions column (edit/delete/approve) scrolled out of view. Both pages now
use the wide container and the actions column sticks to the right edge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:00:06 +02:00
Maaxxs
01719dd958 Login: Discord first, pending approval, groups synced from Discord roles
The login page leads with "Mit Discord einloggen"; username/password stays
available below and can be allowed or refused per user. The Discord login
asks for identify + guilds.members.read, so the site itself can check that
the account is on the legion's server and read its roles - no bot token on
the webspace. Unknown accounts get a new user in the new status "pending",
Discord-only, who sees nothing but a "Freischaltung ausstehend" page and has
no permissions until approved from the user list.

Permission groups can be linked to a Discord role. Linked groups are granted
and revoked from the member's roles at every Discord login and then every
five minutes during a session, using the stored (refreshed) user token;
leaving the server removes them and ends a Discord session. Manual groups are
untouched, and several linked roles simply add up their groups.

New columns are added automatically on first request (includes/schema.php),
since the login page itself needs them; existing accounts keep password login.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 07:49:47 +02:00
Maaxxs
42ebc82e63 Add a role display name, separate from the internal identifier
Roles get a new optional display_name (roles.display_name): everywhere
a role name is shown to users (dashboard badges, member list section
headers/badges, admin user list, role checkboxes in user_form.php),
it's now COALESCE(NULLIF(display_name,''), name) - falls back to the
existing internal name when unset. The name field keeps its original
role as the unique technical identifier; admin/role_form.php's label
now says so explicitly, and admin/roles.php lists both columns since
that's the one screen actually managing the identifier.

Also drops "aktiven" from the member list's count line, since the
page already only lists active accounts without needing to say so.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 15:28:00 +02:00
Maaxxs
77bb1b3ff5 Use real German umlauts instead of ASCII transliterations
Every "oe/ae/ue" spelling throughout the UI text and comments (fuer,
loeschen, koennen, ...) was my own typo, not an encoding bug - the
charset fix in the last commit was unrelated. Replaced all of them
with proper ö/ä/ü across every PHP file and the README.

Also fix table rows rendering inconsistently: `.actions` and the
status badges were applying `display:flex` directly to a <td>, which
fights the table layout model and renders unreliably across browsers.
Moved the flex layout into a wrapper <div> inside each cell instead,
and restyled row-level delete buttons as plain text links so they
match the height of the "Bearbeiten" link exactly. Tables also get a
horizontal-scroll wrapper so narrow viewports scroll instead of
squeezing cell content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 07:16:15 +02:00
Maaxxs
a96fdd1b16 Force a password change on first login for newly created users
New users no longer get a manually typed password: admins get a
random one-time password shown once after creation, and the account
is flagged must_change_password. require_login() redirects anyone
with that flag to the new change_password.php page (except that page
and logout) until they set their own password. Admins can also toggle
the flag when editing an existing user to force a re-change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 06:45:44 +02:00
Maaxxs
6dd68a6264 Remove email from user accounts entirely
Guild members only need a username/password, and nothing in the app
used email for anything (no notifications, no password reset). Drops
the column from the schema, the login lookup, install.php, and the
admin user list/form.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 06:37:04 +02:00
Maaxxs
e57fa0b73c Flatten structure so webroot is the project root instead of public/
Simplifies Plesk/shared-hosting deployment (no need to set a separate
document root subfolder). config.php, includes/ and sql/ are now
protected via .htaccess rules instead of living outside the webroot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 06:06:56 +02:00
Renamed from public/admin/users.php (Browse further)