From 4df958921b6fc3da0819999963ab59d8c9622f87 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 15 Dec 2023 21:23:43 +0700 Subject: [PATCH] Update dl.php --- dl.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dl.php b/dl.php index f7f1eb21..b274c464 100644 --- a/dl.php +++ b/dl.php @@ -158,6 +158,28 @@ if (!$authorised) $datastore->rm('cat_forums'); +// +// Check tor status +// +if (!IS_AM) +{ + $sql = "SELECT tor_status, poster_id FROM " . BB_BT_TORRENTS . " WHERE attach_id = " . (int) $attachment['attach_id']; + + if (!($result = DB()->sql_query($sql))) + { + bb_die('Could not query tor_status information'); + } + + $row = DB()->sql_fetchrow($result); + + if (isset($bb_cfg['tor_frozen'][$row['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$row['tor_status']]) && $userdata['user_id'] === $row['poster_id'])) + { + bb_die($lang['TOR_STATUS_FORBIDDEN'] . $lang['TOR_STATUS_NAME'][$row['tor_status']]); + } + + DB()->sql_freeresult($result); +} + // // Get Information on currently allowed Extensions //