LuminaWebsite/raid_delete_action.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

31 lines
869 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'] ?? 'archived');
if (!in_array($status, RAID_STATUSES, true)) {
$status = 'archived';
}
$redirectTo = '/raids.php?status=' . urlencode($status);
$raidId = (int) ($_POST['raid_id'] ?? 0);
if ($raidId <= 0) {
redirect($redirectTo);
}
try {
$raidLabel = admin_log_raid($raidId);
delete_raid_permanently($raidId);
admin_log('🗑️ Raid endgültig gelöscht', ['Raid' => $raidLabel], 'danger');
set_flash('success', 'Raid wurde endgültig gelöscht.');
} catch (Throwable $e) {
set_flash('error', 'Löschen fehlgeschlagen: ' . $e->getMessage());
}
redirect($redirectTo);