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>
14 lines
422 B
PHP
14 lines
422 B
PHP
<?php
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_login();
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
redirect('/dashboard.php');
|
|
}
|
|
verify_csrf();
|
|
|
|
$user = current_user();
|
|
db()->prepare('UPDATE users SET discord_id = NULL, discord_username = NULL, discord_avatar = NULL WHERE id = ?')->execute([$user['id']]);
|
|
|
|
set_flash('success', 'Discord-Verknüpfung wurde entfernt.');
|
|
redirect('/dashboard.php');
|