LuminaWebsite/pending.php
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

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 wurde über Discord angelegt, ist aber 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'; ?>