LuminaWebsite/pending.php
Maaxxs 27470d0fd7 Accounts: whoever leaves the Discord server is deactivated; on return the account waits for approval again
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>
2026-09-27 23:30:37 +02:00

29 lines
1 KiB
PHP

<?php
require_once __DIR__ . '/includes/bootstrap.php';
require_login();
$user = current_user();
if ($user['status'] !== 'pending') {
redirect('/dashboard.php');
}
$pageTitle = 'Freischaltung ausstehend';
include __DIR__ . '/includes/header.php';
?>
<div class="panel panel-narrow pending-panel">
<?= avatar_html($user, 72) ?>
<h1>Freischaltung ausstehend</h1>
<p>
Hallo <strong><?= e($user['display_name'] !== '' ? $user['display_name'] : $user['username']) ?></strong>,
dein Konto ist noch nicht freigeschaltet.
</p>
<p class="text-muted">
Sobald die Legionsleitung dich freigeschaltet hat, siehst du hier den Mitgliederbereich.
Du musst dafür nichts weiter tun - einfach später noch einmal vorbeischauen.
</p>
<div class="actions pending-actions">
<a class="button" href="/pending.php">Erneut prüfen</a>
<a class="button button-secondary" href="/logout.php">Abmelden</a>
</div>
</div>
<?php include __DIR__ . '/includes/footer.php'; ?>