LuminaWebsite/raid_restore.php
Maaxxs 338a00c21f Log all administrative website actions to the Discord log channel via the bot API
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 19:16:54 +02:00

30 lines
827 B
PHP

<?php
require_once __DIR__ . '/includes/bootstrap.php';
require_once __DIR__ . '/includes/raids_api.php';
require_permission('raids.manage');
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);
$raidId = (int) ($_POST['raid_id'] ?? 0);
if ($raidId <= 0) {
redirect($redirectTo);
}
try {
restore_raid($raidId);
admin_log('♻️ Raid wiederhergestellt', ['Raid' => admin_log_raid($raidId)], 'success');
set_flash('success', 'Raid wurde wiederhergestellt.');
} catch (Throwable $e) {
set_flash('error', 'Wiederherstellen fehlgeschlagen: ' . $e->getMessage());
}
redirect($redirectTo);