Files
ops-Gazelle/sections/torrents/remove_logs.php
2025-08-27 16:44:44 +02:00

22 lines
476 B
PHP

<?php
/** @phpstan-var \Gazelle\User $Viewer */
declare(strict_types=1);
namespace Gazelle;
authorize();
if (!$Viewer->permitted('torrents_delete')) {
Error403::error(
'You are not allowed to delete torrents. Please report the torrent instead.'
);
}
$torrent = new Manager\Torrent()->findById((int)($_GET['torrentid'] ?? 0));
if (is_null($torrent)) {
Error404::error();
}
$torrent->removeAllLogs($Viewer);
header('Location: ' . $torrent->location());