Empty commit

This commit is contained in:
Git 2016-01-28 08:00:28 +00:00
parent 565ac11cdb
commit 2ae321dfee
3 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,8 @@
CHANGE LOG
2016-01-27 by newman
Fix downloading torrents via wget or other utilities when account is locked. This should prevent plugins like autodl-irssi from downloading torrents after an account becomes locked
2016-01-23 by newman
Add confirmation for deleting poll options. Don't load all news and blogs when editing one. Don't load all news when writing a new post, instead load 5 and add the "click to view more" link, similar to the homepage. Add "Replies" column to staffpm.php and Staff PMs on user profiles. Add better.php header link

View File

@ -13,21 +13,27 @@
$UserInfo = $Cache->get_value('user_'.$_REQUEST['torrent_pass']);
if (!is_array($UserInfo)) {
$DB->query("
SELECT ID, DownloadAlt
SELECT ID, DownloadAlt, la.UserID
FROM users_main AS m
INNER JOIN users_info AS i ON i.UserID = m.ID
LEFT JOIN locked_accounts AS la ON la.UserID = m.ID
WHERE m.torrent_pass = '".db_string($_REQUEST['torrent_pass'])."'
AND m.Enabled = '1'");
$UserInfo = $DB->next_record();
$Cache->cache_value('user_'.$_REQUEST['torrent_pass'], $UserInfo, 3600);
}
$UserInfo = array($UserInfo);
list($UserID, $DownloadAlt) = array_shift($UserInfo);
list($UserID, $DownloadAlt, $Locked) = array_shift($UserInfo);
if (!$UserID) {
error(0);
}
$TorrentPass = $_REQUEST['torrent_pass'];
$AuthKey = $_REQUEST['authkey'];
if ($Locked == $UserID) {
header('HTTP/1.1 403 Forbidden');
die();
}
}
$TorrentID = $_REQUEST['id'];

View File

@ -192,11 +192,13 @@
if ($Cur['Type']) {
$DB->query("DELETE FROM locked_accounts WHERE UserID = '" . $UserID . "'");
$EditSummary[] = 'Account unlocked';
$Cache->delete_value('user_' . $Cur['torrent_pass']);
}
} else if (!$Cur['Type'] || $Cur['Type'] != $LockType) {
$DB->query("INSERT INTO locked_accounts (UserID, Type)
VALUES ('" . $UserID . "', '" . $LockType . "')
ON DUPLICATE KEY UPDATE Type = '" . $LockType . "'");
$Cache->delete_value('user_' . $Cur['torrent_pass']);
if ($Cur['Type'] != $LockType) {
$EditSummary[] = 'Account lock reason changed to ' . $LockType;