mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
22 lines
476 B
PHP
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());
|