feat(playback_m3u.php): Added checking auth to download (#1848)

This commit is contained in:
Roman Kelesidis 2025-03-12 00:04:04 +07:00 committed by GitHub
parent af2403f191
commit 0b8d8a5210
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,7 @@ if (!$topic_id) {
}
// Getting torrent info from database
$sql = 'SELECT attach_id, info_hash, info_hash_v2
$sql = 'SELECT attach_id, forum_id, info_hash, info_hash_v2
FROM ' . BB_BT_TORRENTS . '
WHERE topic_id = ' . $topic_id . '
LIMIT 1';
@ -49,6 +49,15 @@ if (!$m3uFile = $torrServer->getM3UPath($row['attach_id'])) {
bb_die($lang['ERROR_NO_ATTACHMENT']);
}
$forum_id = $row['forum_id'];
set_die_append_msg($forum_id, $topic_id);
// Check rights
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
if (!$is_auth['auth_download']) {
bb_die($lang['SORRY_AUTH_VIEW_ATTACH']);
}
// Parse M3U file
$m3uParser = new M3uParser\M3uParser();
$m3uParser->addDefaultTags();