owner can download torrent when approval not allow

This commit is contained in:
xiaomlove
2023-02-06 15:35:53 +08:00
parent 59b7a2916e
commit e9c48e89b1

View File

@@ -108,7 +108,7 @@ if (filesize($fn) == 0) {
httperr();
}
$approvalNotAllowed = $row['approval_status'] != \App\Models\Torrent::APPROVAL_STATUS_ALLOW && get_setting('torrent.approval_status_none_visible') == 'no';
$allowOwnerDownload = $row['owner'] == $CURUSER['id'] && \App\Models\Snatch::query()->where('torrentid', $id)->count() == 0;
$allowOwnerDownload = $row['owner'] == $CURUSER['id'];
$canSeedBanned = user_can('seebanned');
$canAccessTorrent = can_access_torrent($row);
if ((($row['banned'] == 'yes' || ($approvalNotAllowed && !$allowOwnerDownload)) && !$canSeedBanned) || !$canAccessTorrent) {