- New profile.php (display name, password, Discord link/unlink),
reachable from the sidebar; removed the duplicate Discord section
from the dashboard.
- Corrected class names/icon mapping to match the actual bot config
(Beschwörer, Kantor) instead of the guessed German terms used
earlier.
- raids.php now understands the bot's full group model: group 0 is
the bench ("Ersatzbank"), -1 is a decline ("Abgemeldet"), and class
"Ausstehend" marks a pending premade invite (now shown with an
hourglass instead of being silently dropped or mis-rendered). The
"X / max" counter matches the bot's own active-count logic (pending
invites don't count). Signup form also lets a member choose the
bench explicitly.
- A few more inline icons (profile, list) for general visual polish.
Verified grouping/active-count/icon logic with synthetic bench/
declined/pending signups, and the real raids.php flow (profile
update, sidebar nav) against a local DB plus the live raids API.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_once __DIR__ . '/includes/raids_api.php';
|
|
require_permission('raids.view');
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
redirect('/raids.php');
|
|
}
|
|
verify_csrf();
|
|
|
|
$status = (string) ($_POST['status'] ?? 'active');
|
|
if (!in_array($status, RAID_STATUSES, true)) {
|
|
$status = 'active';
|
|
}
|
|
$redirectTo = '/raids.php?status=' . urlencode($status);
|
|
|
|
$user = current_user();
|
|
if (empty($user['discord_id'])) {
|
|
set_flash('error', 'Bitte verknüpfe zuerst deinen Discord-Account.');
|
|
redirect($redirectTo);
|
|
}
|
|
|
|
$raidId = (int) ($_POST['raid_id'] ?? 0);
|
|
$class = trim((string) ($_POST['class'] ?? ''));
|
|
$groupRaw = $_POST['group'] ?? '';
|
|
|
|
if ($raidId <= 0 || $class === '' || !is_numeric($groupRaw) || (int) $groupRaw < 0) {
|
|
set_flash('error', 'Bitte Klasse und Gruppe auswählen.');
|
|
redirect($redirectTo);
|
|
}
|
|
|
|
$group = (int) $groupRaw;
|
|
|
|
try {
|
|
raid_signup($raidId, (int) $user['discord_id'], (string) $user['discord_username'], $class, $group);
|
|
set_flash('success', 'Anmeldung gespeichert.');
|
|
} catch (Throwable $e) {
|
|
set_flash('error', 'Anmeldung fehlgeschlagen: ' . $e->getMessage());
|
|
}
|
|
|
|
redirect($redirectTo);
|