Asked for: "wenn ein mitglied die legion verlässt, soll das benutzerprofil deaktiviert werden" - decided: leaving the
Discord server (also kick or ban) counts as leaving the legion; a returning member goes back to "Wartet auf
Freischaltung".
- includes/discord_auth.php: discord_member_left() disables active/pending accounts (status disabled, users.left_server_at,
session_epoch + 1, Discord groups removed, log entry "Automatisch (...)"); developers stay untouched.
discord_member_returned() puts such accounts back to pending (left_server_at cleared); accounts disabled by hand
stay locked. discord_live_check() calls both, so the session check and "Jetzt mit Discord abgleichen" deactivate too.
- bot_api.php for the new bot cog (cogs/legion_members.py): member_left, member_joined, legion_accounts (Discord IDs of
active/pending accounts) and legion_sync (the ones the bot misses on the server). Other guilds are ignored; a sync
that would disable more than half of the accounts is refused with a warning in the log (at most once a day).
- discord_callback.php: a Discord login of a returned member puts the account back to pending instead of "gesperrt".
- includes/auth.php: logout message says the account was deactivated.
- Admin: users list shows "Discord verlassen am ...", the user form a hint; setting the status by hand clears the mark.
- Schema version 67 (users.left_server_at); account deletion clears it.
- Privacy page (automatic deactivation, bot sync), patch note, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asked for: share a build with a link or build code, and an import tool that takes such a code.
- "Teilen" on an own set creates a link (gear.php?build=CODE) and the same code as build code: 10
characters without 0/O and 1/I/L, shown as K7QX2-M9FRT, stored in gear_sets.share_code (schema
version 59, unique; also in sql/schema.sql). Whoever opens it sees the set even if it is not on the
profile, always in its current state; the session remembers the code so tabs, slots and compare
work, and a renewed or withdrawn code ends that access. "Neuen Code erzeugen" and "Nicht mehr
teilen" invalidate the old one. The dialog reopens after creating (#teilen) with copy buttons.
- "Build importieren" on "Meine Sets" takes the code (with or without dash, any case) or the whole
link; viewing someone else's set (shared or on the profile) offers "In meine Sets übernehmen".
Both copy the set with gear, skills, macros and all planner pages via gear_set_copy() (also used
by "Kopieren" now); the copy is neither shared nor on the profile. Errors reopen the dialog (#import).
- Members only (gear.view). Opening any page without being logged in now brings you back to it after
the login (auth_login_return_target) - only for page views in the browser, not for background
requests like live updates or autosave.
- Privacy policy (shared sets), patch notes and README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Data export (Art. 15/20 GDPR, includes/data_export.php): ZIP with daten.json, LIESMICH.txt and the
member's own images (avatar, characters, gallery, bug reports). It covers every table related to the
account plus, via the bot API, raid sign-ups, premades, created events and activity checks. Password hash,
tokens and player reports (they name the reporters) are left out. The ZIP is written by data_export_zip(),
so the PHP zip extension is not needed.
- Members find export and deletion under "Mein Profil" at the very bottom in a collapsed "Konto & Daten"
section (data_export.php, account_delete.php).
- Leadership: new icon "Daten & Löschung" in the user admin (admin/user_export.php, permission users.export).
It downloads the export or creates a download link for someone without access (datenauskunft.php?t=...,
7 days, 5 downloads, only the SHA-256 hash stored in data_export_links). The link page shows a button first,
so link previews don't use up downloads. It also works in maintenance mode.
- Account deletion (includes/account_deletion.php): the account is anonymized instead of removed.
- Deleted: profile, avatar, characters, gallery, gear sets, private tactics, groups, tokens, calendar
participations and bug report images.
- Contributions remain as "Ehemaliges Mitglied" without name or Discord ID.
- Requested by the member (type LÖSCHEN) or by the leadership (users.delete, also immediately).
- Executed after 7 days by account_deletion_run_due(); logging in before that cancels it and tells the member.
- The user admin shows "Löschung am ..." and "Gelöscht (unkenntlich)". Privacy policy, README and a
leadership patch note are updated. Schema v44 (users.deletion_scheduled_at, users.deleted_at, data_export_links).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Discord sync (login and live check) stores every class role of a member in users.classes (role names match the classes, German and English names are recognised); users.class_name is the main class: the one chosen in the profile (users.main_class) while the member still has it, otherwise the highest class role; no class role means no class
- The guild role list is fetched once per request and kept when the bot is briefly unreachable (it used to be emptied); nothing is changed while the role list is unknown
- Profile: the manual class select is gone; new "Klassen" card with the detected classes, main class choice for members with several classes and a "Jetzt mit Discord abgleichen" button (at most every 30 s and 10 per hour, new security bucket discord_sync with a log entry)
- Main class first on the profile page, in the member list (the class filter also finds secondary classes), in the raid signup and premade class pickers (own classes first, main preselected for new raid signups)
- Berechtigungsgruppen shows which Discord roles count as classes
- Schema version 36 (users.classes filled from class_name until the first sync, users.main_class), patch notes, README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Moderation page with tabs: approval, all comments (critical/suspicious flags, search, filters), swear word filter (mark / hold / block, maintained by mods, detects leetspeak)
- Discord-style emoji reactions on gallery pictures and comments (without reloading)
- Member list and profile: "last active" / online dot, sortable
- Map: all marker categories hidden at start
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- 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>
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>
Drops the Discord-derived avatar entirely (discord_avatar,
discord_refresh_token, discord_avatar_synced_at and the background
refresh via OAuth refresh token) in favor of members uploading their
own picture. "Mein Profil" now shows a larger (120px) avatar with a
pencil button pinned to its top-right corner; picking a file uploads
it immediately. Uploads are validated by actual image content
(getimagesize, not the original filename/extension) and stored under
a randomly generated name in assets/uploads/avatars/, which ships
with its own .htaccess disabling script execution so a disguised
upload can never run as PHP. Falls back to the existing letter
placeholder when no picture is set.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Previously the stored Discord identity only updated when a member
manually unlinked and relinked their account, so a changed Discord
avatar never showed up. The OAuth exchange now also captures the
refresh_token; discord_sync_avatar_if_stale() uses it to silently
pull the current username/avatar (throttled to once per hour) and is
called from profile.php, so opening "Mein Profil" keeps it current
without any re-consent flow. Adds discord_refresh_token and
discord_avatar_synced_at columns.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a discord_avatar column (captured from Discord's OAuth /users/@me
response and stored alongside discord_id/discord_username) and a new
avatar_html() helper: it renders the linked Discord avatar when one is
set, otherwise a circular placeholder with the display name's first
letter on a color picked deterministically per user from a palette
tuned for the dark/gold Lumina theme. Shown on the Startseite hero for
logged-in members and next to "Angemeldet als" in the sidebar footer.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Class name on raid signups now shows only as an icon tooltip instead
of trailing text (falls back to text when no icon matches).
- Discord OAuth2 linking (discord_login.php/discord_callback.php,
includes/discord.php): members connect their Discord account from
the dashboard, storing discord_id/discord_username so raid signups
can be attributed to their real Discord identity. Needs a Discord
application's client_id/client_secret in config.php.
- raids.php gets self-service signup/withdraw controls (class + group
picker, upsert semantics) for members with a linked Discord account,
plus archive/restore controls gated behind a new raids.manage
permission. New action scripts raid_signup.php, raid_unsignup.php,
raid_archive.php, raid_restore.php call the corresponding
includes/raids_api.php functions.
- Archive/restore already work today (verified live against the bot's
API - archived and restored the one active raid, signups intact).
Signup/withdraw are fully wired on the website side but need two new
bot-side endpoints (POST .../signup, DELETE .../signup/{user_id})
that don't exist yet - contract documented in the README.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
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>
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>
Provides PHP/MySQL-based auth (sessions, CSRF), a permission-and-role
system (permission groups with per-permission keys), and an admin-only
user management area. Homepage left as a placeholder for later.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>