Empty commit

This commit is contained in:
Git 2013-06-05 08:01:01 +00:00
parent 5252527b74
commit 8016cb4277
7 changed files with 89 additions and 37 deletions

View File

@ -82,6 +82,13 @@
);
$Torrent = $TorrentList[$TorrentID];
$Reports = get_reports($TorrentID);
if (count($Reports) > 0) {
$Torrent['Reported'] = true;
} else {
$Torrent['Reported'] = false;
}
// Convert file list back to the old format
$FileList = explode("\n", $Torrent['FileList']);
foreach ($FileList as &$File) {
@ -92,6 +99,7 @@
$Userinfo = Users::user_info($Torrent['UserID']);
$JsonTorrentList[] = array(
'id' => (int) $Torrent['ID'],
'infoHash' => $Torrent['InfoHash'],
'media' => $Torrent['Media'],
'format' => $Torrent['Format'],
'encoding' => $Torrent['Encoding'],
@ -110,6 +118,7 @@
'leechers' => (int) $Torrent['Leechers'],
'snatched' => (int) $Torrent['Snatched'],
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
'reported' => $Torrent['Reported'],
'time' => $Torrent['Time'],
'description' => $Torrent['Description'],
'fileList' => $FileList,

View File

@ -86,6 +86,12 @@
unset($File);
$FileList = implode('|||', $FileList);
$Userinfo = Users::user_info($Torrent['UserID']);
$Reports = get_reports($Torrent['ID']);
if (count($Reports) > 0) {
$Torrent['Reported'] = true;
} else {
$Torrent['Reported'] = false;
}
$JsonTorrentList[] = array(
'id' => (int) $Torrent['ID'],
'media' => $Torrent['Media'],
@ -106,6 +112,7 @@
'leechers' => (int) $Torrent['Leechers'],
'snatched' => (int) $Torrent['Snatched'],
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
'reported' => $Torrent['Reported'],
'time' => $Torrent['Time'],
'description' => $Torrent['Description'],
'fileList' => $FileList,

View File

@ -4,7 +4,7 @@
$ToID = $_GET['to'];
if ($ToID == $LoggedUser['ID']) {
error('You cannot start a conversation with yourself!');
header('Location: inbox.php');
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
}
}
@ -16,7 +16,10 @@
error(403);
}
$DB->query("SELECT Username FROM users_main WHERE ID='$ToID'");
$DB->query("
SELECT Username
FROM users_main
WHERE ID='$ToID'");
list($Username) = $DB->next_record();
if (!$Username) {
error(404);
@ -46,7 +49,6 @@
</div>
</form>
</div>
<?
View::show_footer();
?>

View File

@ -34,9 +34,12 @@
(UserID, ConvID, InInbox, InSentbox, ReceivedDate)
VALUES ('$ReceiverID', '$ConvID', '1', '0', NOW())
ON DUPLICATE KEY UPDATE ForwardedTo = 0, UnRead = 1");
$DB->query("UPDATE pm_conversations_users SET ForwardedTo='$ReceiverID' WHERE ConvID='$ConvID' AND UserID='$UserID'");
$DB->query("
UPDATE pm_conversations_users
SET ForwardedTo='$ReceiverID'
WHERE ConvID='$ConvID' AND UserID='$UserID'");
$Cache->delete_value('inbox_new_'.$ReceiverID);
header('Location: inbox.php');
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
} else {
error("$StaffIDs[$ReceiverID] already has this conversation in their inbox.");
header('Location: inbox.php?action=viewconv&id='.$ConvID);

View File

@ -7,7 +7,7 @@
if (!isset($_POST['messages']) || !is_array($_POST['messages'])) {
error('You forgot to select messages to delete.');
header('Location: inbox.php');
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
die();
}
@ -40,13 +40,17 @@
WHERE ConvID IN($ConvIDs)
AND UserID=$UserID");
} elseif (isset($_POST['unread'])) {
$DB->query("UPDATE pm_conversations_users SET Unread='1'
$DB->query("
UPDATE pm_conversations_users
SET Unread='1'
WHERE ConvID IN($ConvIDs) AND UserID=$UserID");
} elseif (isset($_POST['read'])) {
$DB->query("UPDATE pm_conversations_users SET Unread='0'
$DB->query("
UPDATE pm_conversations_users
SET Unread='0'
WHERE ConvID IN($ConvIDs) AND UserID=$UserID");
}
$Cache->delete_value('inbox_new_'.$UserID);
header('Location: inbox.php');
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
?>

View File

@ -41,7 +41,7 @@
}
$Body = trim($_POST['body']);
if ($Body === '' || $Body === false) {
$Err = "You can't send a message without a body!";
$Err = "You can't send a message without a body.";
}
if (!empty($Err)) {
@ -55,5 +55,5 @@
$ConvID = Misc::send_pm($ToID, $LoggedUser['ID'], $Subject, $Body, $ConvID);
header('Location: inbox.php');
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
?>

View File

@ -159,9 +159,13 @@
// If we're deleting the user, we can ignore all the other crap
if ($_POST['UserStatus'] == 'delete' && check_perms('users_delete_users')) {
Misc::write_log("User account ".$UserID." (".$Cur['Username'].") was deleted by ".$LoggedUser['Username']);
$DB->query("DELETE FROM users_main WHERE id=".$UserID);
$DB->query("DELETE FROM users_info WHERE UserID=".$UserID);
Misc::write_log("User account $UserID (".$Cur['Username'].") was deleted by ".$LoggedUser['Username']);
$DB->query("
DELETE FROM users_main
WHERE id = $UserID");
$DB->query("
DELETE FROM users_info
WHERE UserID = $UserID");
$Cache->delete_value('user_info_'.$UserID);
Tracker::update_tracker('remove_user', array('passkey' => $Cur['torrent_pass']));
@ -176,9 +180,10 @@
$EditSummary = array();
if ($_POST['ResetRatioWatch'] && check_perms('users_edit_reset_keys')) {
$DB->query("UPDATE users_info
SET RatioWatchEnds='0000-00-00 00:00:00', RatioWatchDownload='0', RatioWatchTimes='0'
WHERE UserID='$UserID'");
$DB->query("
UPDATE users_info
SET RatioWatchEnds='0000-00-00 00:00:00', RatioWatchDownload='0', RatioWatchTimes='0'
WHERE UserID='$UserID'");
$EditSummary[] = 'RatioWatch history reset';
}
@ -196,13 +201,18 @@
if ($_POST['ResetEmailHistory'] && check_perms('users_edit_reset_keys')) {
$DB->query("DELETE FROM users_history_emails WHERE UserID='$UserID'");
if ($_POST['ResetIPHistory']) {
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP)
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','127.0.0.1')");
$DB->query("
INSERT INTO users_history_emails (UserID, Email, Time, IP)
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','127.0.0.1')");
} else {
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP)
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','".$Cur['IP']."')");
$DB->query("
INSERT INTO users_history_emails (UserID, Email, Time, IP)
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','".$Cur['IP']."')");
}
$DB->query("UPDATE users_main SET Email='$Username@".SITE_URL."' WHERE ID='$UserID'");
$DB->query("
UPDATE users_main
SET Email='$Username@".SITE_URL."'
WHERE ID='$UserID'");
$EditSummary[] = 'Email history cleared';
}
@ -236,14 +246,15 @@
}
if ($Logs095 !== 0) {
$TargetScore = $Logs095 === 100 ? 99 : 100;
$Logs = $DB->query("SELECT DISTINCT TorrentID
FROM torrents_logs_new
JOIN torrents ON ID = TorrentID
WHERE Log LIKE 'EAC extraction logfile%'
AND UserID = $UserID
AND Score = $TargetScore
AND (Adjusted = '0' OR Adjusted = '')");
$TargetScore = (($Logs095 === 100) ? 99 : 100);
$Logs = $DB->query("
SELECT DISTINCT TorrentID
FROM torrents_logs_new
JOIN torrents ON ID = TorrentID
WHERE Log LIKE 'EAC extraction logfile%'
AND UserID = $UserID
AND Score = $TargetScore
AND (Adjusted = '0' OR Adjusted = '')");
while (list($TorrentID) = $DB->next_record()) {
$Results = array();
if ($Logs095 === 100) {
@ -253,8 +264,14 @@
$Details = db_string(serialize($Results));
}
$DB->query("UPDATE torrents SET LogScore = $Logs095 WHERE ID = $TorrentID");
$DB->query("UPDATE torrents_logs_new SET Score = $Logs095, Details = '$Details' WHERE TorrentID = $TorrentID");
$DB->query("
UPDATE torrents
SET LogScore = $Logs095
WHERE ID = $TorrentID");
$DB->query("
UPDATE torrents_logs_new
SET Score = $Logs095, Details = '$Details'
WHERE TorrentID = $TorrentID");
$DB->set_query_id($Logs);
}
$EditSummary[] = 'EAC v0.95 logs rescored to '.$Logs095;
@ -281,14 +298,21 @@
}
if ($Username != $Cur['Username'] && check_perms('users_edit_usernames', $Cur['Class'] - 1)) {
$DB->query("SELECT ID FROM users_main WHERE Username = '".$Username."'");
$DB->query("
SELECT ID
FROM users_main
WHERE Username = '$Username'");
if ($DB->next_record() > 0) {
list($UsedUsernameID) = $DB->next_record();
error('Username already in use by <a href="user.php?id='.$UsedUsernameID."\">$Username</a>");
header('Location: user.php?id='.$UserID);
die();
} elseif ($Username == '0' || $Username == '1') {
error('You cannot set a username of "0" or "1".');
header('Location: user.php?id='.$UserID);
die();
} else {
$UpdateSet[] = "Username='".$Username."'";
$UpdateSet[] = "Username='$Username'";
$EditSummary[] = "username changed from ".$Cur['Username']." to ".$Username;
$LightUpdates['Username'] = $Username;
}
@ -297,7 +321,7 @@
if ($Title != db_string($Cur['Title']) && check_perms('users_edit_titles')) {
// Using the unescaped value for the test to avoid confusion
if (strlen($_POST['Title']) > 1024) {
error("Custom titles can be at most 1024 characters.");
error("Custom titles have a maximum length of 1,024 characters.");
header("Location: user.php?id=".$UserID);
die();
} else {
@ -323,7 +347,10 @@
$ClassChanges[] = $Classes[$PermID]['Name'];
}
$EditSummary[] = 'Secondary classes dropped: '.implode(', ',$ClassChanges);
$DB->query("DELETE FROM users_levels WHERE UserID = '$UserID' AND PermissionID IN (".implode(',',$DroppedClasses).")");
$DB->query("
DELETE FROM users_levels
WHERE UserID = '$UserID'
AND PermissionID IN (".implode(',', $DroppedClasses).')');
if (count($SecondaryClasses) > 0) {
$LightUpdates['ExtraClasses'] = array_fill_keys($SecondaryClasses, 1);
} else {
@ -349,7 +376,7 @@
if ($Visible != $Cur['Visible'] && check_perms('users_make_invisible')) {
$UpdateSet[] = "Visible='$Visible'";
$EditSummary[] = "visibility changed";
$EditSummary[] = 'visibility changed';
$LightUpdates['Visible'] = $Visible;
}