mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
feat(playback_m3u.php): Added checking auth to download (#1848)
This commit is contained in:
parent
af2403f191
commit
0b8d8a5210
1 changed files with 10 additions and 1 deletions
|
@ -34,7 +34,7 @@ if (!$topic_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getting torrent info from database
|
// 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 . '
|
FROM ' . BB_BT_TORRENTS . '
|
||||||
WHERE topic_id = ' . $topic_id . '
|
WHERE topic_id = ' . $topic_id . '
|
||||||
LIMIT 1';
|
LIMIT 1';
|
||||||
|
@ -49,6 +49,15 @@ if (!$m3uFile = $torrServer->getM3UPath($row['attach_id'])) {
|
||||||
bb_die($lang['ERROR_NO_ATTACHMENT']);
|
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
|
// Parse M3U file
|
||||||
$m3uParser = new M3uParser\M3uParser();
|
$m3uParser = new M3uParser\M3uParser();
|
||||||
$m3uParser->addDefaultTags();
|
$m3uParser->addDefaultTags();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue