31 lines
869 B
PHP
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);
|