- calendar.php: raids and events live from the bot API (no duplicate data), recurring events projected forward, agenda list, mobile view with dots - Optionally public (without login, titles and times only), linked on the homepage - Members add their own entries (calendar_entries), participants via "I'm in", same protections as comments (filter, approval, report button, rate limit) - Moderation also covers calendar entries Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
require_once __DIR__ . '/../includes/bootstrap.php';
|
|
require_login();
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
redirect('/dashboard.php');
|
|
}
|
|
verify_csrf();
|
|
|
|
$key = (string) ($_POST['setting'] ?? '');
|
|
if (!array_key_exists($key, SETTINGS_DEFAULTS) || !isset(SETTINGS_ACCESS[$key])) {
|
|
set_flash('error', 'Unbekannte Einstellung.');
|
|
redirect('/dashboard.php');
|
|
}
|
|
|
|
// Jede Einstellung gehoert zu einem Bereich und braucht dessen Recht.
|
|
[$permission, $returnTo] = SETTINGS_ACCESS[$key];
|
|
require_permission($permission);
|
|
|
|
// Bisher gibt es nur Ja/Nein-Einstellungen: angehakt = "1", sonst "0".
|
|
setting_set($key, isset($_POST['value']) ? '1' : '0');
|
|
|
|
$settingLabels = [
|
|
'discord_unlink_allowed' => 'Mitglieder dürfen ihre Discord-Verknüpfung lösen',
|
|
'contributions_history_public' => 'Lumipunkte-Verlauf für alle sichtbar',
|
|
'moderation_all' => 'Alle neuen Bilder und Kommentare manuell freigeben',
|
|
'calendar_public' => 'Kalender öffentlich (ohne Anmeldung)',
|
|
];
|
|
admin_log('⚙️ Einstellung geändert', [
|
|
'Einstellung' => $settingLabels[$key] ?? $key,
|
|
'Neuer Wert' => isset($_POST['value']) ? 'an' : 'aus',
|
|
]);
|
|
|
|
set_flash('success', 'Einstellung gespeichert.');
|
|
redirect($returnTo);
|