diff --git a/classes/script_start.php b/classes/script_start.php index efb14a0a..10a1269f 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -2090,7 +2090,7 @@ function update_tracker($Action, $Updates, $ToIRC = false) { $ResHeader = ''; do { $ResHeader .= fread($File, 1); - } while (!ends_with($ResHeader, "\r\n\r\n")); + } while (!feof($File) && !ends_with($ResHeader, "\r\n\r\n")); $Response = ''; while($Line = fgets($File)) { diff --git a/sections/ajax/request.php b/sections/ajax/request.php index faebbf1c..626bb912 100644 --- a/sections/ajax/request.php +++ b/sections/ajax/request.php @@ -1,5 +1,7 @@ expire_value('thread_'.$TopicID.'_info',3600*24*30); } } + echo "Old threads locked\n"; //------------- Delete dead torrents ------------------------------------// @@ -651,6 +652,7 @@ function next_hour() { OR t.Time < '".time_minus(3600*24*2)."' AND t.last_action = 0"); $TorrentIDs = $DB->to_array(); + echo "Found ".count($TorrentIDs)." inactive torrents to be deleted.\n"; $LogEntries = array(); @@ -680,7 +682,11 @@ function next_hour() { $DeleteNotes[$UserID]['Count']++; ++$i; + if ($i % 500 == 0) { + echo "$i inactive torrents removed.\n"; + } } + echo "$i torrents deleted for inactivity.\n"; foreach($DeleteNotes as $UserID => $MessageInfo){ $Singular = ($MessageInfo['Count'] == 1) ? true : false; @@ -766,7 +772,7 @@ function next_hour() { $AddExtra=''; if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; } if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; } - "FLAC / Lossless / Log (100%) / Cue / CD"; + // "FLAC / Lossless / Log (100%) / Cue / CD"; if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; } if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; } if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; } @@ -851,7 +857,7 @@ function next_hour() { $AddExtra=''; if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; } if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; } - "FLAC / Lossless / Log (100%) / Cue / CD"; + // "FLAC / Lossless / Log (100%) / Cue / CD"; if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; } if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; } if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; } diff --git a/sections/user/takemoderate.php b/sections/user/takemoderate.php index fbe3e25f..535c33fe 100644 --- a/sections/user/takemoderate.php +++ b/sections/user/takemoderate.php @@ -118,7 +118,8 @@ DisableIRC, m.RequiredRatio, m.FLTokens, - i.RatioWatchEnds + i.RatioWatchEnds, + SHA1(i.AdminComment) AS CommentHash FROM users_main AS m JOIN users_info AS i ON i.UserID = m.ID LEFT JOIN permissions AS p ON p.ID=m.PermissionID @@ -129,6 +130,9 @@ } $Cur = $DB->next_record(MYSQLI_ASSOC, false); +if ($_POST['comment_hash'] != $Cur['CommentHash']) { + error("Somebody else has moderated this user since you loaded it. Please go back and refresh the page."); +} //NOW that we know the class of the current user, we can see if one staff member is trying to hax0r us. if(!check_perms('users_mod', $Cur['Class'])) { diff --git a/sections/user/user.php b/sections/user/user.php index 1a26b42e..576b6e73 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -60,7 +60,8 @@ i.DisableIRC, i.DisableRequests, i.HideCountryChanges, - m.FLTokens + m.FLTokens, + SHA1(i.AdminComment) FROM users_main AS m JOIN users_info AS i ON i.UserID = m.ID LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID @@ -72,7 +73,7 @@ header("Location: log.php?search=User+".$UserID); } - list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $JoinDate, $Info, $Avatar, $Country, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisableIRC, $DisableRequests, $DisableCountry, $FLTokens) = $DB->next_record(MYSQLI_NUM, array(8,11)); + list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $JoinDate, $Info, $Avatar, $Country, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisableIRC, $DisableRequests, $DisableCountry, $FLTokens, $CommentHash) = $DB->next_record(MYSQLI_NUM, array(8,11)); } else { // Person viewing is a normal user $DB->query("SELECT m.Username, @@ -913,6 +914,7 @@ function check_paranoia_here($Setting) {
Staff Notes (Edit)
+ Toggle Edit