mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
f328752fb9
commit
14e0880c47
@ -64,7 +64,8 @@ public static function valid_host($Host) {
|
||||
*/
|
||||
public static function blacklisted($Url, $ShowError = true) {
|
||||
foreach (self::$Blacklist as &$Value) {
|
||||
if (stripos($Url, $Value)) {
|
||||
$Blacklisted = stripos($Url, $Value);
|
||||
if ($Blacklisted !== false) {
|
||||
$ParsedUrl = parse_url($Url);
|
||||
if ($ShowError) {
|
||||
error($ParsedUrl['host'] . ' is not an allowed image host. Please use a different host.');
|
||||
@ -92,7 +93,7 @@ private static function thumbnailable($Url) {
|
||||
*/
|
||||
private static function valid_extension($Ext) {
|
||||
// return @self::$Extensions[$Ext] === true;
|
||||
return !empty(self::$Extensions[$Ext]) && self::$Extensions[$Ext] === true;
|
||||
return !empty(self::$Extensions[$Ext]) && (self::$Extensions[$Ext] === true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,7 +152,6 @@
|
||||
case 'Tags':
|
||||
$FileName = 'tags.class';
|
||||
break;
|
||||
|
||||
case 'TEXTAREA_PREVIEW':
|
||||
$FileName = 'textarea_preview.class';
|
||||
break;
|
||||
|
@ -212,10 +212,10 @@ public function local_url ($Str) {
|
||||
if (empty($URLInfo['port']) && preg_match('/(\S+\.)*'.NONSSL_SITE_URL.'/', $Host)) {
|
||||
$URL = $URLInfo['path'];
|
||||
if (!empty($URLInfo['query'])) {
|
||||
$URL.='?'.$URLInfo['query'];
|
||||
$URL .= '?'.$URLInfo['query'];
|
||||
}
|
||||
if (!empty($URLInfo['fragment'])) {
|
||||
$URL.='#'.$URLInfo['fragment'];
|
||||
$URL .= '#'.$URLInfo['fragment'];
|
||||
}
|
||||
return $URL;
|
||||
} else {
|
||||
@ -376,9 +376,9 @@ private function parse ($Str) {
|
||||
|
||||
$InOpenRegex = '/\[('.$TagName.')';
|
||||
if ($MaxAttribs > 0) {
|
||||
$InOpenRegex.="(=[^\n'\"\[\]]+)?";
|
||||
$InOpenRegex .= "(=[^\n'\"\[\]]+)?";
|
||||
}
|
||||
$InOpenRegex.='\]/i';
|
||||
$InOpenRegex .= '\]/i';
|
||||
|
||||
|
||||
// Every time we find an internal open tag of the same type, search for the next close tag
|
||||
@ -460,7 +460,7 @@ private function parse ($Str) {
|
||||
case 'pre':
|
||||
case 'code':
|
||||
case 'plain':
|
||||
$Block = strtr($Block, array('[inlineurl]'=>''));
|
||||
$Block = strtr($Block, array('[inlineurl]' => ''));
|
||||
|
||||
$Callback = function ($matches) {
|
||||
$n = $matches[2];
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?
|
||||
class UserAgent {
|
||||
var $Browsers = array(
|
||||
static private $Browsers = array(
|
||||
//Less popular
|
||||
'Shiira' => 'Shiira',
|
||||
'Songbird' => 'Songbird',
|
||||
@ -15,7 +15,7 @@ class UserAgent {
|
||||
'Links' => 'Links',
|
||||
'libcurl' => 'cURL',
|
||||
'midori' => 'Midori',
|
||||
'Blackberry' => 'Blackberry Browser',
|
||||
'Blackberry' => 'BlackBerry Browser',
|
||||
//Big names
|
||||
'Firefox' => 'Firefox',
|
||||
'Chrome' => 'Chrome',
|
||||
@ -43,7 +43,7 @@ class UserAgent {
|
||||
*/
|
||||
);
|
||||
|
||||
var $OperatingSystems = array(
|
||||
static private $OperatingSystems = array(
|
||||
//Mobile
|
||||
'SymbianOS' => 'Symbian',
|
||||
'blackberry' => 'BlackBerry',
|
||||
@ -123,12 +123,12 @@ public static function operating_system(&$UserAgentString) {
|
||||
}
|
||||
|
||||
public static function mobile(&$UserAgentString) {
|
||||
if (strpos($UserAgentString, 'iPad')) {
|
||||
if (strpos($UserAgentString, 'iPad') !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Mobi catches Mobile
|
||||
if (/*strpos($UserAgentString, 'Mobile') || */strpos($UserAgentString, 'Device') || strpos($UserAgentString, 'Mobi') || strpos($UserAgentString, 'Mini') || strpos($UserAgentString, 'webOS')) {
|
||||
// "Mobi" catches "Mobile" too
|
||||
if (strpos($UserAgentString, 'Device') || strpos($UserAgentString, 'Mobi') || strpos($UserAgentString, 'Mini') || strpos($UserAgentString, 'webOS')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1,5 +1,12 @@
|
||||
CHANGELOG
|
||||
|
||||
2013-06-24 by Ajax
|
||||
Added user recents to API. ajax.php?action=user_recents&userid=<ID>&limit=<LIMIT> the limit defaults to 15 if empty and maxes out at 50
|
||||
|
||||
2013-06-23 by alderaan
|
||||
The "Torrent options" section when editing user profiles now follows Microsoft's UI design guidelines, which has been adopted as something we will try to follow in the future. For an overview of what this generally entails, refer to this example document:
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511452.aspx
|
||||
|
||||
2013-06-19 by alderaan
|
||||
UI revisions on the artist and torrent group edit pages, with the most significant changes occurring in the artist aliases section%
|
||||
|
||||
|
18
irc_raw.php
18
irc_raw.php
@ -1,13 +1,13 @@
|
||||
<?// This is a very primitive IRC bot
|
||||
<? // This is a very primitive IRC bot
|
||||
if (!isset($argv)) {
|
||||
die('CLI Only.');
|
||||
}
|
||||
|
||||
define('SERVER','irc.what.cd');
|
||||
define('PORT',6667);
|
||||
define('NICK','RawBot');
|
||||
define('WATCH','#raw-input');
|
||||
define('RELAY','#raw-output');
|
||||
define('SERVER', 'irc.what.cd');
|
||||
define('PORT', 6667);
|
||||
define('NICK', 'RawBot');
|
||||
define('WATCH', '#raw-input');
|
||||
define('RELAY', '#raw-output');
|
||||
|
||||
$Socket = fsockopen(SERVER, PORT);
|
||||
fwrite($Socket, "USER ".NICK." * * :".NICK."\n");
|
||||
@ -28,12 +28,12 @@
|
||||
}
|
||||
|
||||
// Example command
|
||||
if(stripos('!mode', $Line)) {
|
||||
fwrite($Socket, "PRIVMSG ".RELAY." :Mode command used\n");
|
||||
if (stripos('!mode', $Line) !== false) {
|
||||
fwrite($Socket, "PRIVMSG ".RELAY." :Mode command used\n");
|
||||
fwrite($Socket, "MODE WhatMan\n");
|
||||
fwrite($Socket, "WHOIS WhatMan\n");
|
||||
fwrite($Socket, "MODE Orbulon\n");
|
||||
}
|
||||
|
||||
fwrite($Socket, "PRIVMSG ".RELAY." : -----".$Line."\n");
|
||||
fwrite($Socket, 'PRIVMSG '.RELAY." : -----$Line\n");
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
/* AJAX_LIMIT = array(x,y) = 'x' requests every 'y' seconds.
|
||||
e.g. array(5,10) = 5 requests every 10 seconds */
|
||||
$AJAX_LIMIT = array(5,10);
|
||||
$LimitedPages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup','news_ajax');
|
||||
$LimitedPages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup','news_ajax','user_recents');
|
||||
|
||||
// These users aren't rate limited.
|
||||
// This array should contain user IDs.
|
||||
@ -155,6 +155,9 @@
|
||||
case 'community_stats':
|
||||
require(SERVER_ROOT . '/sections/ajax/community_stats.php');
|
||||
break;
|
||||
case 'user_recents':
|
||||
require(SERVER_ROOT . '/sections/ajax/user_recents.php');
|
||||
break;
|
||||
default:
|
||||
// If they're screwing around with the query string
|
||||
json_die("failure");
|
||||
|
@ -44,7 +44,7 @@
|
||||
inviter.username
|
||||
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
|
||||
LEFT JOIN permissions AS p ON p.ID = m.PermissionID
|
||||
LEFT JOIN users_main AS inviter ON i.Inviter = inviter.ID
|
||||
LEFT JOIN forums_posts AS posts ON posts.AuthorID = m.ID
|
||||
WHERE m.ID = $UserID
|
||||
@ -54,7 +54,7 @@
|
||||
json_die("failure", "no such user");
|
||||
}
|
||||
|
||||
list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass, $DisableLeech, $JoinDate, $Info, $Avatar, $Country, $Donor, $Warned, $ForumPosts, $InviterID, $DisableInvites, $InviterName, $RatioWatchEnds, $RatioWatchDownload) = $DB->next_record(MYSQLI_NUM, array(9,11));
|
||||
list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass, $DisableLeech, $JoinDate, $Info, $Avatar, $Country, $Donor, $Warned, $ForumPosts, $InviterID, $DisableInvites, $InviterName, $RatioWatchEnds, $RatioWatchDownload) = $DB->next_record(MYSQLI_NUM, array(9, 11));
|
||||
|
||||
$Paranoia = unserialize($Paranoia);
|
||||
if (!is_array($Paranoia)) {
|
||||
@ -63,7 +63,7 @@
|
||||
$ParanoiaLevel = 0;
|
||||
foreach ($Paranoia as $P) {
|
||||
$ParanoiaLevel++;
|
||||
if (strpos($P, '+')) {
|
||||
if (strpos($P, '+') !== false) {
|
||||
$ParanoiaLevel++;
|
||||
}
|
||||
}
|
||||
@ -81,8 +81,8 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT FriendID
|
||||
FROM friends
|
||||
WHERE UserID='$LoggedUser[ID]'
|
||||
AND FriendID='$UserID'");
|
||||
WHERE UserID = '$LoggedUser[ID]'
|
||||
AND FriendID = '$UserID'");
|
||||
if ($DB->record_count() != 0) {
|
||||
$Friend = true;
|
||||
}
|
||||
@ -91,7 +91,7 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(DISTINCT r.ID), SUM(rv.Bounty)
|
||||
FROM requests AS r
|
||||
LEFT JOIN requests_votes AS rv ON r.ID=rv.RequestID
|
||||
LEFT JOIN requests_votes AS rv ON r.ID = rv.RequestID
|
||||
WHERE r.FillerID = $UserID");
|
||||
list($RequestsFilled, $TotalBounty) = $DB->next_record();
|
||||
$DB->query("
|
||||
@ -103,7 +103,7 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(ID)
|
||||
FROM torrents
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
list($Uploads) = $DB->next_record();
|
||||
} else {
|
||||
$RequestsVoted = 0;
|
||||
@ -113,7 +113,7 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(ID)
|
||||
FROM torrents
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
list($Uploads) = $DB->next_record();
|
||||
} else {
|
||||
$Uploads = null;
|
||||
@ -180,8 +180,8 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(x.uid), COUNT(DISTINCT x.fid)
|
||||
FROM xbt_snatched AS x
|
||||
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE x.uid='$UserID'");
|
||||
INNER JOIN torrents AS t ON t.ID = x.fid
|
||||
WHERE x.uid = '$UserID'");
|
||||
list($Snatched, $UniqueSnatched) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(ID)
|
||||
FROM torrents_comments
|
||||
WHERE AuthorID='$UserID'");
|
||||
WHERE AuthorID = '$UserID'");
|
||||
list($NumComments) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -197,8 +197,8 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(ID)
|
||||
FROM collages
|
||||
WHERE Deleted='0'
|
||||
AND UserID='$UserID'");
|
||||
WHERE Deleted = '0'
|
||||
AND UserID = '$UserID'");
|
||||
list($NumCollages) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -207,8 +207,8 @@ function check_paranoia_here($Setting) {
|
||||
SELECT COUNT(DISTINCT CollageID)
|
||||
FROM collages_torrents AS ct
|
||||
JOIN collages ON CollageID = ID
|
||||
WHERE Deleted='0'
|
||||
AND ct.UserID='$UserID'");
|
||||
WHERE Deleted = '0'
|
||||
AND ct.UserID = '$UserID'");
|
||||
list($NumCollageContribs) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -243,9 +243,9 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(x.uid)
|
||||
FROM xbt_files_users AS x
|
||||
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE x.uid='$UserID'
|
||||
AND x.remaining=0");
|
||||
INNER JOIN torrents AS t ON t.ID = x.fid
|
||||
WHERE x.uid = '$UserID'
|
||||
AND x.remaining = 0");
|
||||
list($Seeding) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -253,9 +253,9 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(x.uid)
|
||||
FROM xbt_files_users AS x
|
||||
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE x.uid='$UserID'
|
||||
AND x.remaining>0");
|
||||
INNER JOIN torrents AS t ON t.ID = x.fid
|
||||
WHERE x.uid = '$UserID'
|
||||
AND x.remaining > 0");
|
||||
list($Leeching) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT COUNT(UserID)
|
||||
FROM users_info
|
||||
WHERE Inviter='$UserID'");
|
||||
WHERE Inviter = '$UserID'");
|
||||
list($Invited) = $DB->next_record();
|
||||
}
|
||||
|
||||
@ -352,4 +352,3 @@ function check_paranoia_here($Setting) {
|
||||
)
|
||||
));
|
||||
?>
|
||||
|
||||
|
74
sections/ajax/user_recents.php
Normal file
74
sections/ajax/user_recents.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?
|
||||
$UserID = (int) $_GET['userid'];
|
||||
$Limit = (int) $_GET['limit'];
|
||||
|
||||
if (empty($UserID) || $Limit > 50) {
|
||||
json_die("failure", "bad parameters");
|
||||
}
|
||||
if (empty($Limit)) {
|
||||
$Limit = 15;
|
||||
}
|
||||
$Results = array();
|
||||
if (check_paranoia_here('snatched')) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.WikiImage
|
||||
FROM xbt_snatched AS s
|
||||
INNER JOIN torrents AS t ON t.ID = s.fid
|
||||
INNER JOIN torrents_group AS g ON t.GroupID = g.ID
|
||||
WHERE s.uid = '$UserID'
|
||||
AND g.CategoryID = '1'
|
||||
AND g.WikiImage != ''
|
||||
GROUP BY g.ID
|
||||
ORDER BY s.tstamp DESC
|
||||
LIMIT $Limit");
|
||||
$RecentSnatches = $DB->to_array(false, MYSQLI_ASSOC);
|
||||
$Artists = Artists::get_artists($DB->collect('ID'));
|
||||
foreach ($RecentSnatches as $Key => $SnatchInfo) {
|
||||
$RecentSnatches[$Key]['artists'][] = $Artists[$SnatchInfo['ID']];
|
||||
$RecentSnatches[$Key]['ID'] = (int) $RecentSnatches[$Key]['ID'];
|
||||
|
||||
}
|
||||
$Results['snatches'] = $RecentSnatches;
|
||||
} else {
|
||||
$Results['snatches'] = "hidden";
|
||||
}
|
||||
|
||||
if (check_paranoia_here('uploads')) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.WikiImage
|
||||
FROM torrents_group AS g
|
||||
INNER JOIN torrents AS t ON t.GroupID = g.ID
|
||||
WHERE t.UserID = '$UserID'
|
||||
AND g.CategoryID = '1'
|
||||
AND g.WikiImage != ''
|
||||
GROUP BY g.ID
|
||||
ORDER BY t.Time DESC
|
||||
LIMIT $Limit");
|
||||
$RecentUploads = $DB->to_array(false, MYSQLI_ASSOC);
|
||||
$Artists = Artists::get_artists($DB->collect('ID'));
|
||||
foreach ($RecentUploads as $Key => $UploadInfo) {
|
||||
$RecentUploads[$Key]['artists'][] = $Artists[$UploadInfo['ID']];
|
||||
$RecentUploads[$Key]['ID'] = (int) $RecentUploads[$Key]['ID'];
|
||||
|
||||
}
|
||||
$Results['uploads'] = $RecentUploads;
|
||||
} else {
|
||||
$Results['uploads'] = "hidden";
|
||||
}
|
||||
|
||||
json_die("success", $Results);
|
||||
|
||||
function check_paranoia_here($Setting) {
|
||||
global $Paranoia, $Class, $UserID, $Preview;
|
||||
if ($Preview == 1) {
|
||||
return check_paranoia($Setting, $Paranoia, $Class);
|
||||
} else {
|
||||
return check_paranoia($Setting, $Paranoia, $Class, $UserID);
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@
|
||||
$NeedCue = (strpos($LogCue, 'Cue') !== false);
|
||||
$NeedLog = (strpos($LogCue, 'Log') !== false);
|
||||
if ($NeedLog) {
|
||||
if (strpos($LogCue, '%')) {
|
||||
if (strpos($LogCue, '%') !== false) {
|
||||
preg_match('/\d+/', $LogCue, $Matches);
|
||||
$MinLogScore = (int) $Matches[0];
|
||||
}
|
||||
@ -116,8 +116,8 @@
|
||||
GROUP_CONCAT(t.Name SEPARATOR ', '),
|
||||
tg.CategoryID
|
||||
FROM torrents_group AS tg
|
||||
JOIN torrents_tags AS tt ON tt.GroupID=tg.ID
|
||||
JOIN tags AS t ON t.ID=tt.TagID
|
||||
JOIN torrents_tags AS tt ON tt.GroupID = tg.ID
|
||||
JOIN tags AS t ON t.ID = tt.TagID
|
||||
WHERE tg.ID = ".$_GET['groupid']);
|
||||
if (list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
|
||||
$GroupID = trim($_REQUEST['groupid']);
|
||||
@ -248,7 +248,7 @@
|
||||
$DB->query('
|
||||
SELECT Name
|
||||
FROM tags
|
||||
WHERE TagType=\'genre\'
|
||||
WHERE TagType = \'genre\'
|
||||
ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
|
||||
@ -257,7 +257,7 @@
|
||||
<select id="genre_tags" name="genre_tags" onchange="add_tag();return false;" >
|
||||
<option>---</option>
|
||||
<? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
|
||||
<option value="<?=$Genre ?>"><?=$Genre ?></option>
|
||||
<option value="<?=$Genre?>"><?=$Genre?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
<input type="text" id="tags" name="tags" size="45" value="<?=(!empty($Tags) ? display_str($Tags) : '')?>" />
|
||||
@ -356,7 +356,7 @@
|
||||
<td class="label">Torrent group</td>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$GroupID?>">https://<?=SSL_SITE_URL?>/torrents.php?id=<?=$GroupID?></a><br />
|
||||
This request <?=($NewRequest?'will be':'is')?> associated with the above torrent group.
|
||||
This request <?=($NewRequest ? 'will be' : 'is')?> associated with the above torrent group.
|
||||
<? if (!$NewRequest) { ?>
|
||||
If this is incorrect, please <a href="reports.php?action=report&type=request&id=<?=$RequestID?>">report this request</a> so that staff can fix it.
|
||||
<? } ?>
|
||||
@ -385,7 +385,7 @@
|
||||
<input type="hidden" id="current_downloaded" value="<?=$LoggedUser['BytesDownloaded']?>" />
|
||||
If you add the entered <strong><span id="new_bounty">100.00 MB</span></strong> of bounty, your new stats will be: <br />
|
||||
Uploaded: <span id="new_uploaded"><?=Format::get_size($LoggedUser['BytesUploaded'])?></span>
|
||||
Ratio: <span id="new_ratio"><?=Format::get_ratio_html($LoggedUser['BytesUploaded'],$LoggedUser['BytesDownloaded'])?></span>
|
||||
Ratio: <span id="new_ratio"><?=Format::get_ratio_html($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded'])?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -105,11 +105,11 @@
|
||||
}*/
|
||||
|
||||
//WEB has no ripping log. Ditto Vinyl - Actually ditto everything but CD
|
||||
//$WEBOverride = ((strpos($MediaList, 'WEB') !== false) && $Media == "WEB");
|
||||
//$VinylOverride = ((strpos($MediaList, 'Vinyl') !== false) && $Media == "Vinyl");
|
||||
//$WEBOverride = (strpos($MediaList, 'WEB') !== false && $Media == "WEB");
|
||||
//$VinylOverride = (strpos($MediaList, 'Vinyl') !== false && $Media == "Vinyl");
|
||||
//if ($Format == 'FLAC' && $LogCue && !$WEBOverride && !$VinylOverride) {
|
||||
if ($Format == 'FLAC' && $LogCue && $Media == 'CD') {
|
||||
if (strpos($LogCue, 'Log') && !$HasLog) {
|
||||
if (strpos($LogCue, 'Log') !== false && !$HasLog) {
|
||||
$Err = 'This request requires a log.';
|
||||
}
|
||||
|
||||
@ -117,11 +117,11 @@
|
||||
* Removed due to rule 2.2.15.6 rendering some requests unfillable
|
||||
*/
|
||||
|
||||
//if (strpos($LogCue, "Cue") && !$HasCue) {
|
||||
// $Err = "This request requires a cue.";
|
||||
//if (strpos($LogCue, 'Cue') !== false && !$HasCue) {
|
||||
// $Err = 'This request requires a cue.';
|
||||
//}
|
||||
|
||||
if (strpos($LogCue, '%')) {
|
||||
if (strpos($LogCue, '%') !== false) {
|
||||
preg_match('/\d+/', $LogCue, $Matches);
|
||||
if ((int) $LogScore < (int) $Matches[0]) {
|
||||
$Err = 'This torrent\'s log score is too low.';
|
||||
@ -130,19 +130,20 @@
|
||||
}
|
||||
|
||||
if ($BitrateList === 'Other') {
|
||||
if ($Bitrate === 'Lossless' || $Bitrate === 'APS (VBR)' || $Bitrate === 'V2 (VBR)' || $Bitrate === 'V1 (VBR)' || $Bitrate === '256' || $Bitrate === 'APX (VBR)' || $Bitrate === 'V0 (VBR)' || $Bitrate === 'q8.x (VBR)' || $Bitrate === '320' || $Bitrate === '24bit Lossless')
|
||||
if ($Bitrate === 'Lossless' || $Bitrate === 'APS (VBR)' || $Bitrate === 'V2 (VBR)' || $Bitrate === 'V1 (VBR)' || $Bitrate === '256' || $Bitrate === 'APX (VBR)' || $Bitrate === 'V0 (VBR)' || $Bitrate === 'q8.x (VBR)' || $Bitrate === '320' || $Bitrate === '24bit Lossless') {
|
||||
$Err = "$Bitrate is not an allowed bitrate for this request.";
|
||||
}
|
||||
} elseif ($BitrateList && $BitrateList != 'Any') {
|
||||
if (strpos($BitrateList, $Bitrate) === false) {
|
||||
$Err = "$Bitrate is not an allowed bitrate for this request.";
|
||||
}
|
||||
}
|
||||
if ($FormatList && $FormatList != "Any") {
|
||||
if ($FormatList && $FormatList != 'Any') {
|
||||
if (strpos($FormatList, $Format) === false) {
|
||||
$Err = "$Format is not an allowed format for this request.";
|
||||
}
|
||||
}
|
||||
if ($MediaList && $MediaList != "Any") {
|
||||
if ($MediaList && $MediaList != 'Any') {
|
||||
if (strpos($MediaList, $Media) === false) {
|
||||
$Err = "$Media is not allowed media for this request.";
|
||||
}
|
||||
@ -170,7 +171,10 @@
|
||||
$FullName = $Title;
|
||||
}
|
||||
|
||||
$DB->query("SELECT UserID FROM requests_votes WHERE RequestID = $RequestID");
|
||||
$DB->query("
|
||||
SELECT UserID
|
||||
FROM requests_votes
|
||||
WHERE RequestID = $RequestID");
|
||||
$UserIDs = $DB->to_array();
|
||||
foreach ($UserIDs as $User) {
|
||||
list($VoterID) = $User;
|
||||
@ -196,13 +200,16 @@
|
||||
|
||||
|
||||
|
||||
$DB->query("SELECT ArtistID FROM requests_artists WHERE RequestID = $RequestID");
|
||||
$DB->query("
|
||||
SELECT ArtistID
|
||||
FROM requests_artists
|
||||
WHERE RequestID = $RequestID");
|
||||
$ArtistIDs = $DB->to_array();
|
||||
foreach ($ArtistIDs as $ArtistID) {
|
||||
$Cache->delete_value("artists_requests_$ArtistID");
|
||||
}
|
||||
|
||||
$SS->UpdateAttributes('requests', array('torrentid','fillerid'), array($RequestID => array((int)$TorrentID,(int)$FillerID)));
|
||||
$SS->UpdateAttributes('requests', array('torrentid', 'fillerid'), array($RequestID => array((int)$TorrentID, (int)$FillerID)));
|
||||
Requests::update_sphinx_requests($RequestID);
|
||||
|
||||
header('Location: requests.php?action=view&id='.$RequestID);
|
||||
|
@ -218,7 +218,6 @@ function compare($X, $Y) {
|
||||
|
||||
</div>
|
||||
<?
|
||||
|
||||
if ($Categories[$GroupCategoryID - 1] == 'Music') {
|
||||
$ShownWith = false;
|
||||
?>
|
||||
|
@ -256,17 +256,7 @@ function checked($Checked) {
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <strip> -->
|
||||
<? if(check_perms("users_mod")) { ?>
|
||||
<tr>
|
||||
<td class="label"><strong>TehConnection integration</strong></td>
|
||||
<td>
|
||||
<input type="checkbox" name="films" id="films" <?=!isset($SiteOptions['Films']) || $SiteOptions['Films'] == true ? "checked='checked'" : ""?>/>
|
||||
<label for="films">Show movie posters and link to TehConnection on movie soundtracks</label>
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<!-- </strip> -->
|
||||
|
||||
<tr>
|
||||
<td class="label"><strong>Torrent search</strong></td>
|
||||
<td>
|
||||
|
@ -214,7 +214,7 @@ function user_dupes_table($UserID) {
|
||||
$DupeInfo = Users::user_info($DupeID);
|
||||
?>
|
||||
<td align="left"><?=Users::format_username($DupeID, true, true, true, true)?>
|
||||
<a href="user.php?action=dupes&dupeaction=remove&auth=<?=$LoggedUser['AuthKey']?>&userid=<?=$UserID?>&removeid=<?=$DupeID?>" onclick="return confirm('Are you sure you wish to remove <?=$DupeInfo['Username']?> from this group?');" class="brackets">x</a>
|
||||
<a href="user.php?action=dupes&dupeaction=remove&auth=<?=$LoggedUser['AuthKey']?>&userid=<?=$UserID?>&removeid=<?=$DupeID?>" onclick="return confirm('Are you sure you wish to remove <?=$DupeInfo['Username']?> from this group?');" class="brackets" title="Remove linked account">X</a>
|
||||
</td>
|
||||
<?
|
||||
if ($i == 5) {
|
||||
@ -238,12 +238,14 @@ function user_dupes_table($UserID) {
|
||||
<div id="editdupecomments" class="<?=($DupeCount ? 'hidden' : '')?>">
|
||||
<textarea name="dupecomments" onkeyup="resize('dupecommentsbox');" id="dupecommentsbox" cols="65" rows="5" style="width: 98%;"><?=display_str($Comments)?></textarea>
|
||||
</div>
|
||||
<span style="float: right; font-style: italic;"><a href="#" onclick="$('#dupecomments').gtoggle(); $('#editdupecomments').gtoggle(); resize('dupecommentsbox'); return false;" class="brackets">Edit linked account comments</a></span>
|
||||
<span style="float: right;"><a href="#" onclick="$('#dupecomments').gtoggle(); $('#editdupecomments').gtoggle(); resize('dupecommentsbox'); return false;" class="brackets">Edit linked account comments</a></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pad hidden linkedaccounts">
|
||||
<label for="target">Link this user with: </label><input type="text" name="target" id="target" /><input type="submit" value="Update" id="submitlink" />
|
||||
<label for="target">Link this user with: </label>
|
||||
<input type="text" name="target" id="target" />
|
||||
<input type="submit" value="Update" id="submitlink" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -216,7 +216,6 @@
|
||||
$Options['ShowSnatched'] = (!empty($_POST['showsnatched']) ? 1 : 0);
|
||||
$Options['DisableAutoSave'] = (!empty($_POST['disableautosave']) ? 1 : 0);
|
||||
$Options['NoVoteLinks'] = (!empty($_POST['novotelinks']) ? 1 : 0);
|
||||
|
||||
$Options['CoverArt'] = (int) !empty($_POST['coverart']);
|
||||
$Options['ShowExtraCovers'] = (int) !empty($_POST['show_extra_covers']);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
$DB->query("
|
||||
SELECT COUNT(ID)
|
||||
FROM users_main
|
||||
WHERE Enabled='1'");
|
||||
WHERE Enabled = '1'");
|
||||
list($UserCount) = $DB->next_record();
|
||||
$Cache->cache_value('stats_user_count', $UserCount, 0);
|
||||
}
|
||||
@ -20,11 +20,17 @@
|
||||
WHERE ID = $UserID");
|
||||
list($CanLeech) = $DB->next_record();
|
||||
|
||||
if ($LoggedUser['RatioWatch'] ||
|
||||
!$CanLeech ||
|
||||
$LoggedUser['DisableInvites'] == '1'||
|
||||
$LoggedUser['Invites'] == 0 && !check_perms('site_send_unlimited_invites') ||
|
||||
($UserCount >= USER_LIMIT && USER_LIMIT != 0 && !check_perms('site_can_invite_always'))) {
|
||||
if ($LoggedUser['RatioWatch']
|
||||
|| !$CanLeech
|
||||
|| $LoggedUser['DisableInvites'] == '1'
|
||||
|| $LoggedUser['Invites'] == 0
|
||||
&& !check_perms('site_send_unlimited_invites')
|
||||
|| (
|
||||
$UserCount >= USER_LIMIT
|
||||
&& USER_LIMIT != 0
|
||||
&& !check_perms('site_can_invite_always')
|
||||
)
|
||||
) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
@ -35,7 +41,7 @@
|
||||
$InviteExpires = time_plus(60 * 60 * 24 * 3); // 3 days
|
||||
|
||||
//MultiInvite
|
||||
if (strpos($Email, '|') && check_perms('site_send_unlimited_invites')) {
|
||||
if (strpos($Email, '|') !== false && check_perms('site_send_unlimited_invites')) {
|
||||
$Emails = explode('|', $Email);
|
||||
} else {
|
||||
$Emails = array($Email);
|
||||
@ -87,14 +93,14 @@
|
||||
if (!check_perms('site_send_unlimited_invites')) {
|
||||
$DB->query("
|
||||
UPDATE users_main
|
||||
SET Invites=GREATEST(Invites,1)-1
|
||||
WHERE ID='$LoggedUser[ID]'");
|
||||
SET Invites = GREATEST(Invites, 1) - 1
|
||||
WHERE ID = '$LoggedUser[ID]'");
|
||||
$Cache->begin_transaction('user_info_heavy_'.$LoggedUser['ID']);
|
||||
$Cache->update_row(false, array('Invites'=>'-1'));
|
||||
$Cache->update_row(false, array('Invites' => '-1'));
|
||||
$Cache->commit_transaction(0);
|
||||
}
|
||||
|
||||
Misc::send_email($CurEmail, 'You have been invited to '.SITE_NAME, $Message,'noreply');
|
||||
Misc::send_email($CurEmail, 'You have been invited to '.SITE_NAME, $Message, 'noreply');
|
||||
|
||||
|
||||
}
|
||||
|
@ -130,13 +130,13 @@
|
||||
GROUP_CONCAT(l.PermissionID SEPARATOR ',') AS SecondaryClasses
|
||||
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
|
||||
LEFT JOIN permissions AS p ON p.ID = m.PermissionID
|
||||
LEFT JOIN users_levels AS l ON l.UserID = m.ID
|
||||
WHERE m.ID = $UserID
|
||||
GROUP BY m.ID");
|
||||
|
||||
if ($DB->record_count() == 0) { // If user doesn't exist
|
||||
header("Location: log.php?search=User+".$UserID);
|
||||
if (!$DB->record_count()) { // If user doesn't exist
|
||||
header("Location: log.php?search=User+$UserID");
|
||||
}
|
||||
|
||||
$Cur = $DB->next_record(MYSQLI_ASSOC, false);
|
||||
@ -180,69 +180,93 @@
|
||||
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'");
|
||||
SET RatioWatchEnds = '0000-00-00 00:00:00', RatioWatchDownload='0', RatioWatchTimes='0'
|
||||
WHERE UserID = '$UserID'");
|
||||
$EditSummary[] = 'RatioWatch history reset';
|
||||
}
|
||||
|
||||
if ($_POST['ResetIPHistory'] && check_perms('users_edit_reset_keys')) {
|
||||
|
||||
$DB->query("DELETE FROM users_history_ips WHERE UserID='$UserID'");
|
||||
$DB->query("UPDATE users_main SET IP='127.0.0.1' WHERE ID='$UserID'");
|
||||
$DB->query("UPDATE xbt_snatched SET IP = '' WHERE uid='$UserID'");
|
||||
$DB->query("UPDATE users_history_passwords SET ChangerIP = '' WHERE UserID = ".$UserID);
|
||||
$DB->query("UPDATE users_history_passkeys SET ChangerIP = '' WHERE UserID = ".$UserID);
|
||||
$DB->query("
|
||||
DELETE FROM users_history_ips
|
||||
WHERE UserID = '$UserID'");
|
||||
$DB->query("
|
||||
UPDATE users_main
|
||||
SET IP = '127.0.0.1'
|
||||
WHERE ID = '$UserID'");
|
||||
$DB->query("
|
||||
UPDATE xbt_snatched
|
||||
SET IP = ''
|
||||
WHERE uid = '$UserID'");
|
||||
$DB->query("
|
||||
UPDATE users_history_passwords
|
||||
SET ChangerIP = ''
|
||||
WHERE UserID = $UserID");
|
||||
$DB->query("
|
||||
UPDATE users_history_passkeys
|
||||
SET ChangerIP = ''
|
||||
WHERE UserID = $UserID");
|
||||
|
||||
$EditSummary[] = 'IP history cleared';
|
||||
}
|
||||
|
||||
if ($_POST['ResetEmailHistory'] && check_perms('users_edit_reset_keys')) {
|
||||
$DB->query("DELETE FROM users_history_emails WHERE UserID='$UserID'");
|
||||
$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')");
|
||||
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']."')");
|
||||
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'");
|
||||
SET Email = '$Username@".SITE_URL."'
|
||||
WHERE ID = '$UserID'");
|
||||
$EditSummary[] = 'Email history cleared';
|
||||
}
|
||||
|
||||
if ($_POST['ResetSnatchList'] && check_perms('users_edit_reset_keys')) {
|
||||
$DB->query("DELETE FROM xbt_snatched WHERE uid='$UserID'");
|
||||
$DB->query("
|
||||
DELETE FROM xbt_snatched
|
||||
WHERE uid = '$UserID'");
|
||||
$EditSummary[] = 'Snatch list cleared';
|
||||
}
|
||||
|
||||
if ($_POST['ResetDownloadList'] && check_perms('users_edit_reset_keys')) {
|
||||
$DB->query("DELETE FROM users_downloads WHERE UserID='$UserID'");
|
||||
$DB->query("
|
||||
DELETE FROM users_downloads
|
||||
WHERE UserID = '$UserID'");
|
||||
$EditSummary[] = 'Download list cleared';
|
||||
}
|
||||
|
||||
if (($_POST['ResetSession'] || $_POST['LogOut']) && check_perms('users_logout')) {
|
||||
$Cache->delete_value('user_info_'.$UserID);
|
||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||
$Cache->delete_value('user_stats_'.$UserID);
|
||||
$Cache->delete_value('enabled_'.$UserID);
|
||||
$Cache->delete_value("user_info_$UserID");
|
||||
$Cache->delete_value("user_info_heavy_$UserID");
|
||||
$Cache->delete_value("user_stats_$UserID");
|
||||
$Cache->delete_value("enabled_$UserID");
|
||||
|
||||
if ($_POST['LogOut']) {
|
||||
$DB->query("
|
||||
SELECT SessionID
|
||||
FROM users_sessions
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
while (list($SessionID) = $DB->next_record()) {
|
||||
$Cache->delete_value('session_'.$UserID.'_'.$SessionID);
|
||||
$Cache->delete_value("session_{$UserID}_$SessionID");
|
||||
}
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
$Cache->delete_value("users_sessions_$UserID");
|
||||
|
||||
$DB->query("
|
||||
DELETE FROM users_sessions
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
|
||||
}
|
||||
}
|
||||
@ -282,10 +306,13 @@
|
||||
|
||||
|
||||
// Start building SQL query and edit summary
|
||||
if ($Classes[$Class]['Level'] != $Cur['Class'] && (
|
||||
($Classes[$Class]['Level'] < $LoggedUser['Class'] && check_perms('users_promote_below', $Cur['Class']))
|
||||
|| ($Classes[$Class]['Level'] <= $LoggedUser['Class'] && check_perms('users_promote_to', $Cur['Class'] - 1)))) {
|
||||
$UpdateSet[] = "PermissionID='$Class'";
|
||||
if ($Classes[$Class]['Level'] != $Cur['Class']
|
||||
&& (
|
||||
($Classes[$Class]['Level'] < $LoggedUser['Class'] && check_perms('users_promote_below', $Cur['Class']))
|
||||
|| ($Classes[$Class]['Level'] <= $LoggedUser['Class'] && check_perms('users_promote_to', $Cur['Class'] - 1))
|
||||
)
|
||||
) {
|
||||
$UpdateSet[] = "PermissionID = '$Class'";
|
||||
$EditSummary[] = 'class changed to '.Users::make_class_string($Class);
|
||||
$LightUpdates['PermissionID'] = $Class;
|
||||
$DeleteKeys = true;
|
||||
@ -318,8 +345,8 @@
|
||||
header('Location: user.php?id='.$UserID);
|
||||
die();
|
||||
} else {
|
||||
$UpdateSet[] = "Username='$Username'";
|
||||
$EditSummary[] = "username changed from ".$Cur['Username']." to ".$Username;
|
||||
$UpdateSet[] = "Username = '$Username'";
|
||||
$EditSummary[] = "username changed from ".$Cur['Username']." to $Username";
|
||||
$LightUpdates['Username'] = $Username;
|
||||
}
|
||||
}
|
||||
@ -331,20 +358,20 @@
|
||||
header("Location: user.php?id=".$UserID);
|
||||
die();
|
||||
} else {
|
||||
$UpdateSet[] = "Title='$Title'";
|
||||
$UpdateSet[] = "Title = '$Title'";
|
||||
$EditSummary[] = "title changed to $Title";
|
||||
$LightUpdates['Title'] = $_POST['Title'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($Donor != $Cur['Donor'] && check_perms('users_give_donor')) {
|
||||
$UpdateSet[] = "Donor='$Donor'";
|
||||
$UpdateSet[] = "Donor = '$Donor'";
|
||||
$EditSummary[] = 'donor status changed';
|
||||
$LightUpdates['Donor'] = $Donor;
|
||||
}
|
||||
|
||||
// Secondary classes
|
||||
$OldClasses = $Cur['SecondaryClasses']?explode(',', $Cur['SecondaryClasses']):array();
|
||||
$OldClasses = $Cur['SecondaryClasses'] ? explode(',', $Cur['SecondaryClasses']) : array();
|
||||
$DroppedClasses = array_diff($OldClasses, $SecondaryClasses);
|
||||
$AddedClasses = array_diff($SecondaryClasses, $OldClasses);
|
||||
if (count($DroppedClasses) > 0) {
|
||||
@ -352,7 +379,7 @@
|
||||
foreach ($DroppedClasses as $PermID) {
|
||||
$ClassChanges[] = $Classes[$PermID]['Name'];
|
||||
}
|
||||
$EditSummary[] = 'Secondary classes dropped: '.implode(', ',$ClassChanges);
|
||||
$EditSummary[] = 'Secondary classes dropped: '.implode(', ', $ClassChanges);
|
||||
$DB->query("
|
||||
DELETE FROM users_levels
|
||||
WHERE UserID = '$UserID'
|
||||
@ -375,39 +402,41 @@
|
||||
$Values[] = "($UserID, $PermID)";
|
||||
|
||||
}
|
||||
$DB->query("INSERT INTO users_levels (UserID, PermissionID) VALUES ".implode(', ',$Values));
|
||||
$DB->query("
|
||||
INSERT INTO users_levels (UserID, PermissionID)
|
||||
VALUES ".implode(', ', $Values));
|
||||
//$LightUpdates['ExtraClasses'] = array_fill_keys($SecondaryClasses, 1);
|
||||
$DeleteKeys = true;
|
||||
}
|
||||
|
||||
if ($Visible != $Cur['Visible'] && check_perms('users_make_invisible')) {
|
||||
$UpdateSet[] = "Visible='$Visible'";
|
||||
$UpdateSet[] = "Visible = '$Visible'";
|
||||
$EditSummary[] = 'visibility changed';
|
||||
$LightUpdates['Visible'] = $Visible;
|
||||
}
|
||||
|
||||
if ($Uploaded != $Cur['Uploaded'] && $Uploaded != $_POST['OldUploaded'] && (check_perms('users_edit_ratio')
|
||||
|| (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
|
||||
$UpdateSet[] = "Uploaded='".$Uploaded."'";
|
||||
$EditSummary[] = "uploaded changed from ".Format::get_size($Cur['Uploaded'])." to ".Format::get_size($Uploaded);
|
||||
$Cache->delete_value('users_stats_'.$UserID);
|
||||
$UpdateSet[] = "Uploaded = '$Uploaded'";
|
||||
$EditSummary[] = "uploaded changed from ".Format::get_size($Cur['Uploaded']).' to '.Format::get_size($Uploaded);
|
||||
$Cache->delete_value("users_stats_$UserID");
|
||||
}
|
||||
|
||||
if ($Downloaded != $Cur['Downloaded'] && $Downloaded != $_POST['OldDownloaded'] && (check_perms('users_edit_ratio')
|
||||
|| (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
|
||||
$UpdateSet[] = "Downloaded='$Downloaded'";
|
||||
$EditSummary[] = "downloaded changed from ".Format::get_size($Cur['Downloaded'])." to ".Format::get_size($Downloaded);
|
||||
$Cache->delete_value('users_stats_'.$UserID);
|
||||
$UpdateSet[] = "Downloaded = '$Downloaded'";
|
||||
$EditSummary[] = "downloaded changed from ".Format::get_size($Cur['Downloaded']).' to '.Format::get_size($Downloaded);
|
||||
$Cache->delete_value("users_stats_$UserID");
|
||||
}
|
||||
|
||||
if ($FLTokens != $Cur['FLTokens'] && (check_perms('users_edit_ratio') || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
|
||||
$UpdateSet[] = "FLTokens=".$FLTokens;
|
||||
$EditSummary[] = "Freeleech Tokens changed from ".$Cur['FLTokens']." to ".$FLTokens;
|
||||
$UpdateSet[] = "FLTokens = $FLTokens";
|
||||
$EditSummary[] = "Freeleech Tokens changed from ".$Cur['FLTokens']." to $FLTokens";
|
||||
$HeavyUpdates['FLTokens'] = $FLTokens;
|
||||
}
|
||||
|
||||
if ($Invites != $Cur['Invites'] && check_perms('users_edit_invites')) {
|
||||
$UpdateSet[] = "invites='$Invites'";
|
||||
$UpdateSet[] = "invites = '$Invites'";
|
||||
$EditSummary[] = "number of invites changed to $Invites";
|
||||
$HeavyUpdates['Invites'] = $Invites;
|
||||
}
|
||||
@ -415,16 +444,16 @@
|
||||
if ($Warned == 1 && $Cur['Warned'] == '0000-00-00 00:00:00' && check_perms('users_warn')) {
|
||||
$Weeks = 'week' . (($WarnLength == 1) ? '' : 's');
|
||||
Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=https://".SSL_SITE_URL."/wiki.php?action=article&id=218]warned for $WarnLength {$Weeks}[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
$UpdateSet[] = "Warned='".sqltime()."' + INTERVAL $WarnLength WEEK";
|
||||
$UpdateSet[] = "Warned = '".sqltime()."' + INTERVAL $WarnLength WEEK";
|
||||
$Msg = "warned for $WarnLength $Weeks";
|
||||
if ($WarnReason) {
|
||||
$Msg.=" for $WarnReason";
|
||||
$Msg .= " for $WarnReason";
|
||||
}
|
||||
$EditSummary[] = db_string($Msg);
|
||||
$LightUpdates['Warned'] = time_plus(3600 * 24 * 7 * $WarnLength);
|
||||
|
||||
} elseif ($Warned == 0 && $Cur['Warned'] != '0000-00-00 00:00:00' && check_perms('users_warn')) {
|
||||
$UpdateSet[] = "Warned='0000-00-00 00:00:00'";
|
||||
$UpdateSet[] = "Warned = '0000-00-00 00:00:00'";
|
||||
$EditSummary[] = 'warning removed';
|
||||
$LightUpdates['Warned'] = '0000-00-00 00:00:00';
|
||||
|
||||
@ -432,15 +461,15 @@
|
||||
$Weeks = 'week' . (($ExtendWarning == 1) ? '' : 's');
|
||||
Misc::send_pm($UserID, 0, 'Your warning has been extended', "Your warning has been extended by $ExtendWarning $Weeks by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
|
||||
$UpdateSet[] = "Warned=Warned + INTERVAL $ExtendWarning WEEK";
|
||||
$UpdateSet[] = "Warned = Warned + INTERVAL $ExtendWarning WEEK";
|
||||
$DB->query("
|
||||
SELECT Warned + INTERVAL $ExtendWarning WEEK
|
||||
FROM users_info
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
list($WarnedUntil) = $DB->next_record();
|
||||
$Msg = "warning extended by $ExtendWarning $Weeks to $WarnedUntil";
|
||||
if ($WarnReason) {
|
||||
$Msg.=" for $WarnReason";
|
||||
$Msg .= " for $WarnReason";
|
||||
}
|
||||
$EditSummary[] = db_string($Msg);
|
||||
$LightUpdates['Warned'] = $WarnedUntil;
|
||||
@ -448,47 +477,47 @@
|
||||
} elseif ($Warned == 1 && $ExtendWarning == '---' && $ReduceWarning != '---' && check_perms('users_warn')) {
|
||||
$Weeks = 'week' . (($ReduceWarning == 1) ? '' : 's');
|
||||
Misc::send_pm($UserID, 0, 'Your warning has been reduced', "Your warning has been reduced by $ReduceWarning $Weeks by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
|
||||
$UpdateSet[] = "Warned=Warned - INTERVAL $ReduceWarning WEEK";
|
||||
$UpdateSet[] = "Warned = Warned - INTERVAL $ReduceWarning WEEK";
|
||||
$DB->query("
|
||||
SELECT Warned - INTERVAL $ReduceWarning WEEK
|
||||
FROM users_info
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
list($WarnedUntil) = $DB->next_record();
|
||||
$Msg = "warning reduced by $ReduceWarning $Weeks to $WarnedUntil";
|
||||
if ($WarnReason) {
|
||||
$Msg.=" for $WarnReason";
|
||||
$Msg .= " for $WarnReason";
|
||||
}
|
||||
$EditSummary[] = db_string($Msg);
|
||||
$LightUpdates['Warned'] = $WarnedUntil;
|
||||
}
|
||||
|
||||
if ($SupportFor != db_string($Cur['SupportFor']) && (check_perms('admin_manage_fls') || (check_perms('users_mod') && $UserID == $LoggedUser['ID']))) {
|
||||
$UpdateSet[] = "SupportFor='$SupportFor'";
|
||||
$UpdateSet[] = "SupportFor = '$SupportFor'";
|
||||
$EditSummary[] = "First-Line Support status changed to $SupportFor";
|
||||
}
|
||||
|
||||
if ($RestrictedForums != db_string($Cur['RestrictedForums']) && check_perms('users_mod')) {
|
||||
$UpdateSet[] = "RestrictedForums='$RestrictedForums'";
|
||||
$UpdateSet[] = "RestrictedForums = '$RestrictedForums'";
|
||||
$EditSummary[] = "restricted forum(s): $RestrictedForums";
|
||||
$DeleteKeys = true;
|
||||
}
|
||||
|
||||
if ($PermittedForums != db_string($Cur['PermittedForums']) && check_perms('users_mod')) {
|
||||
$ForumSet = explode(',',$PermittedForums);
|
||||
$ForumSet = explode(',', $PermittedForums);
|
||||
$ForumList = array();
|
||||
foreach ($ForumSet as $ForumID) {
|
||||
if ($Forums[$ForumID]['MinClassCreate'] <= $LoggedUser['EffectiveClass']) {
|
||||
$ForumList[] = $ForumID;
|
||||
}
|
||||
}
|
||||
$PermittedForums = implode(',',$ForumSet);
|
||||
$UpdateSet[] = "PermittedForums='$PermittedForums'";
|
||||
$PermittedForums = implode(',', $ForumSet);
|
||||
$UpdateSet[] = "PermittedForums = '$PermittedForums'";
|
||||
$EditSummary[] = "permitted forum(s): $PermittedForums";
|
||||
$DeleteKeys = true;
|
||||
}
|
||||
|
||||
if ($DisableAvatar != $Cur['DisableAvatar'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableAvatar='$DisableAvatar'";
|
||||
$UpdateSet[] = "DisableAvatar = '$DisableAvatar'";
|
||||
$EditSummary[] = "avatar status changed";
|
||||
$HeavyUpdates['DisableAvatar'] = $DisableAvatar;
|
||||
if (!empty($UserReason)) {
|
||||
@ -497,99 +526,99 @@
|
||||
}
|
||||
|
||||
if ($DisableLeech != $Cur['can_leech'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "can_leech='$DisableLeech'";
|
||||
$UpdateSet[] = "can_leech = '$DisableLeech'";
|
||||
$EditSummary[] = "leeching status changed (".translateLeechStatus($Cur['can_leech'])." -> ".translateLeechStatus($DisableLeech).")";
|
||||
$HeavyUpdates['DisableLeech'] = $DisableLeech;
|
||||
$HeavyUpdates['CanLeech'] = $DisableLeech;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your leeching privileges have been disabled', "Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your leeching privileges have been disabled', "Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => $DisableLeech));
|
||||
}
|
||||
|
||||
if ($DisableInvites != $Cur['DisableInvites'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableInvites='$DisableInvites'";
|
||||
$UpdateSet[] = "DisableInvites = '$DisableInvites'";
|
||||
if ($DisableInvites == 1) {
|
||||
//$UpdateSet[] = "Invites='0'";
|
||||
//$UpdateSet[] = "Invites = '0'";
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your invite privileges have been disabled', "Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your invite privileges have been disabled', "Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
$EditSummary[] = "invites status changed";
|
||||
$EditSummary[] = 'invites status changed';
|
||||
$HeavyUpdates['DisableInvites'] = $DisableInvites;
|
||||
}
|
||||
|
||||
if ($DisablePosting != $Cur['DisablePosting'] && check_perms('users_disable_posts')) {
|
||||
$UpdateSet[] = "DisablePosting='$DisablePosting'";
|
||||
$EditSummary[] = "posting status changed";
|
||||
$UpdateSet[] = "DisablePosting = '$DisablePosting'";
|
||||
$EditSummary[] = 'posting status changed';
|
||||
$HeavyUpdates['DisablePosting'] = $DisablePosting;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your forum posting privileges have been disabled', "Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your forum posting privileges have been disabled', "Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableForums != $Cur['DisableForums'] && check_perms('users_disable_posts')) {
|
||||
$UpdateSet[] = "DisableForums='$DisableForums'";
|
||||
$EditSummary[] = "forums status changed";
|
||||
$UpdateSet[] = "DisableForums = '$DisableForums'";
|
||||
$EditSummary[] = 'forums status changed';
|
||||
$HeavyUpdates['DisableForums'] = $DisableForums;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your forum privileges have been disabled', "Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your forum privileges have been disabled', "Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableTagging != $Cur['DisableTagging'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableTagging='$DisableTagging'";
|
||||
$EditSummary[] = "tagging status changed";
|
||||
$UpdateSet[] = "DisableTagging = '$DisableTagging'";
|
||||
$EditSummary[] = 'tagging status changed';
|
||||
$HeavyUpdates['DisableTagging'] = $DisableTagging;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your tagging privileges have been disabled', "Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your tagging privileges have been disabled', "Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableUpload != $Cur['DisableUpload'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableUpload='$DisableUpload'";
|
||||
$EditSummary[] = "upload status changed";
|
||||
$UpdateSet[] = "DisableUpload = '$DisableUpload'";
|
||||
$EditSummary[] = 'upload status changed';
|
||||
$HeavyUpdates['DisableUpload'] = $DisableUpload;
|
||||
if ($DisableUpload == 1) {
|
||||
Misc::send_pm($UserID, 0, 'Your upload privileges have been disabled', "Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your upload privileges have been disabled', "Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableWiki != $Cur['DisableWiki'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableWiki='$DisableWiki'";
|
||||
$EditSummary[] = "wiki status changed";
|
||||
$UpdateSet[] = "DisableWiki = '$DisableWiki'";
|
||||
$EditSummary[] = 'wiki status changed';
|
||||
$HeavyUpdates['DisableWiki'] = $DisableWiki;
|
||||
$HeavyUpdates['site_edit_wiki'] = 0;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your site editing privileges have been disabled', "Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your site editing privileges have been disabled', "Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($DisablePM != $Cur['DisablePM'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisablePM='$DisablePM'";
|
||||
$EditSummary[] = "PM status changed";
|
||||
$UpdateSet[] = "DisablePM = '$DisablePM'";
|
||||
$EditSummary[] = 'PM status changed';
|
||||
$HeavyUpdates['DisablePM'] = $DisablePM;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your PM privileges have been disabled', "Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].");
|
||||
Misc::send_pm($UserID, 0, 'Your PM privileges have been disabled', "Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&name=IRC+-+How+to+join]here[/url].');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableIRC != $Cur['DisableIRC'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableIRC='$DisableIRC'";
|
||||
$EditSummary[] = "IRC status changed";
|
||||
$UpdateSet[] = "DisableIRC = '$DisableIRC'";
|
||||
$EditSummary[] = 'IRC status changed';
|
||||
$HeavyUpdates['DisableIRC'] = $DisableIRC;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in ".BOT_DISABLED_CHAN.'.');
|
||||
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in '.BOT_DISABLED_CHAN.'.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($DisableRequests != $Cur['DisableRequests'] && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "DisableRequests='$DisableRequests'";
|
||||
$EditSummary[] = "request status changed";
|
||||
$UpdateSet[] = "DisableRequests = '$DisableRequests'";
|
||||
$EditSummary[] = 'request status changed';
|
||||
$HeavyUpdates['DisableRequests'] = $DisableRequests;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in ".BOT_DISABLED_CHAN.'.');
|
||||
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in '.BOT_DISABLED_CHAN.'.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -601,31 +630,31 @@
|
||||
} elseif ($EnableUser == '1') {
|
||||
$Cache->increment('stats_user_count');
|
||||
Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass']));
|
||||
if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded']/$Cur['Downloaded'] >= $Cur['RequiredRatio'])) {
|
||||
$UpdateSet[] = "i.RatioWatchEnds='0000-00-00 00:00:00'";
|
||||
if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded'] / $Cur['Downloaded'] >= $Cur['RequiredRatio'])) {
|
||||
$UpdateSet[] = "i.RatioWatchEnds = '0000-00-00 00:00:00'";
|
||||
$CanLeech = 1;
|
||||
$UpdateSet[] = "m.can_leech='1'";
|
||||
$UpdateSet[] = "i.RatioWatchDownload='0'";
|
||||
$UpdateSet[] = "m.can_leech = '1'";
|
||||
$UpdateSet[] = "i.RatioWatchDownload = '0'";
|
||||
} else {
|
||||
$EnableStr .= ' (Ratio: '.Format::get_ratio_html($Cur['Uploaded'], $Cur['Downloaded'], false).', RR: '.number_format($Cur['RequiredRatio'],2).')';
|
||||
if ($Cur['RatioWatchEnds'] != '0000-00-00 00:00:00') {
|
||||
$UpdateSet[] = "i.RatioWatchEnds=NOW()";
|
||||
$UpdateSet[] = "i.RatioWatchDownload=m.Downloaded";
|
||||
$UpdateSet[] = "i.RatioWatchEnds = NOW()";
|
||||
$UpdateSet[] = "i.RatioWatchDownload = m.Downloaded";
|
||||
$CanLeech = 0;
|
||||
}
|
||||
Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => '0'));
|
||||
}
|
||||
$UpdateSet[] = "Enabled='1'";
|
||||
$UpdateSet[] = "Enabled = '1'";
|
||||
$LightUpdates['Enabled'] = 1;
|
||||
}
|
||||
$EditSummary[] = $EnableStr;
|
||||
$Cache->replace_value('enabled_'.$UserID, $EnableUser, 0);
|
||||
$Cache->replace_value("enabled_$UserID", $EnableUser, 0);
|
||||
}
|
||||
|
||||
if ($ResetPasskey == 1 && check_perms('users_edit_reset_keys')) {
|
||||
$Passkey = db_string(Users::make_secret());
|
||||
$UpdateSet[] = "torrent_pass='$Passkey'";
|
||||
$EditSummary[] = "passkey reset";
|
||||
$UpdateSet[] = "torrent_pass = '$Passkey'";
|
||||
$EditSummary[] = 'passkey reset';
|
||||
$HeavyUpdates['torrent_pass'] = $Passkey;
|
||||
$Cache->delete_value('user_'.$Cur['torrent_pass']);
|
||||
//MUST come after the case for updating can_leech.
|
||||
@ -640,23 +669,23 @@
|
||||
|
||||
if ($ResetAuthkey == 1 && check_perms('users_edit_reset_keys')) {
|
||||
$Authkey = db_string(Users::make_secret());
|
||||
$UpdateSet[] = "AuthKey='$Authkey'";
|
||||
$EditSummary[] = "authkey reset";
|
||||
$UpdateSet[] = "AuthKey = '$Authkey'";
|
||||
$EditSummary[] = 'authkey reset';
|
||||
$HeavyUpdates['AuthKey'] = $Authkey;
|
||||
}
|
||||
|
||||
if ($SendHackedMail && check_perms('users_disable_any')) {
|
||||
$EditSummary[] = "hacked email sent to ".$HackedEmail;
|
||||
Misc::send_email($HackedEmail, "Your ".SITE_NAME." account.","Your ".SITE_NAME." account appears to have been compromised. As a security measure we have disabled your account. To resolve this please visit us on IRC.
|
||||
$EditSummary[] = "hacked account email sent to $HackedEmail";
|
||||
Misc::send_email($HackedEmail, 'Your '.SITE_NAME.' account', 'Your '.SITE_NAME.' account appears to have been compromised. As a security measure we have disabled your account. To resolve this please visit us on IRC.
|
||||
|
||||
This is the information to connect to our server:
|
||||
IRC Server: ".BOT_SERVER."
|
||||
Port: ".BOT_PORT." (".BOT_PORT_SSL." SSL)
|
||||
IRC Server: '.BOT_SERVER.'
|
||||
Port: '.BOT_PORT.' ('.BOT_PORT_SSL.' SSL)
|
||||
|
||||
Once you are connected to our server you'll need to join our disabled channel.
|
||||
Type: /join ".BOT_DISABLED_CHAN."
|
||||
Once you are connected to our server you will need to join our disabled users channel.
|
||||
Type: /join '.BOT_DISABLED_CHAN.'
|
||||
|
||||
Please visit us soon so we can help you resolve this matter.");
|
||||
Please visit us soon so we can help you resolve this matter.');
|
||||
}
|
||||
|
||||
if ($MergeStatsFrom && check_perms('users_edit_ratio')) {
|
||||
@ -668,37 +697,37 @@
|
||||
list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record();
|
||||
$DB->query("
|
||||
UPDATE users_main AS um
|
||||
JOIN users_info AS ui ON um.ID=ui.UserID
|
||||
JOIN users_info AS ui ON um.ID = ui.UserID
|
||||
SET
|
||||
um.Uploaded = 0,
|
||||
um.Downloaded = 0,
|
||||
ui.AdminComment = CONCAT('".sqltime()." - Stats (Uploaded: ".Format::get_size($MergeUploaded).", Downloaded: ".Format::get_size($MergeDownloaded).", Ratio: ".Format::get_ratio($MergeUploaded, $MergeDownloaded).") merged into https://".SSL_SITE_URL."/user.php?id=$UserID (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment)
|
||||
WHERE ID = ".$MergeID);
|
||||
ui.AdminComment = CONCAT('".sqltime().' - Stats (Uploaded: '.Format::get_size($MergeUploaded).', Downloaded: '.Format::get_size($MergeDownloaded).', Ratio: '.Format::get_ratio($MergeUploaded, $MergeDownloaded).') merged into https://'.SSL_SITE_URL."/user.php?id=$UserID (".$Cur['Username'].') by '.$LoggedUser['Username']."\n\n', ui.AdminComment)
|
||||
WHERE ID = $MergeID");
|
||||
$UpdateSet[] = "Uploaded = Uploaded + '$MergeUploaded'";
|
||||
$UpdateSet[] = "Downloaded = Downloaded + '$MergeDownloaded'";
|
||||
$EditSummary[] = "stats merged from https://".SSL_SITE_URL."/user.php?id=$MergeID ($MergeStatsFrom) (previous stats: Uploaded: ".Format::get_size($Cur['Uploaded']).", Downloaded: ".Format::get_size($Cur['Downloaded']).", Ratio: ".Format::get_ratio($Cur['Uploaded'], $Cur['Downloaded']).")";
|
||||
$Cache->delete_value('users_stats_'.$UserID);
|
||||
$Cache->delete_value('users_stats_'.$MergeID);
|
||||
$EditSummary[] = 'stats merged from https://'.SSL_SITE_URL."/user.php?id=$MergeID ($MergeStatsFrom) (previous stats: Uploaded: ".Format::get_size($Cur['Uploaded']).', Downloaded: '.Format::get_size($Cur['Downloaded']).', Ratio: '.Format::get_ratio($Cur['Uploaded'], $Cur['Downloaded']).')';
|
||||
$Cache->delete_value("users_stats_$UserID");
|
||||
$Cache->delete_value("users_stats_$MergeID");
|
||||
}
|
||||
}
|
||||
|
||||
if ($Pass && check_perms('users_edit_password')) {
|
||||
$UpdateSet[] = "PassHash='".db_string(Users::make_crypt_hash($Pass))."'";
|
||||
$UpdateSet[] = "PassHash = '".db_string(Users::make_crypt_hash($Pass))."'";
|
||||
$EditSummary[] = 'password reset';
|
||||
|
||||
$Cache->delete_value('user_info_'.$UserID);
|
||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||
$Cache->delete_value('user_stats_'.$UserID);
|
||||
$Cache->delete_value('enabled_'.$UserID);
|
||||
$Cache->delete_value("user_info_$UserID");
|
||||
$Cache->delete_value("user_info_heavy_$UserID");
|
||||
$Cache->delete_value("user_stats_$UserID");
|
||||
$Cache->delete_value("enabled_$UserID");
|
||||
|
||||
$DB->query("
|
||||
SELECT SessionID
|
||||
FROM users_sessions
|
||||
WHERE UserID='$UserID'");
|
||||
WHERE UserID = '$UserID'");
|
||||
while (list($SessionID) = $DB->next_record()) {
|
||||
$Cache->delete_value('session_'.$UserID.'_'.$SessionID);
|
||||
$Cache->delete_value("session_{$UserID}_$SessionID");
|
||||
}
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
$Cache->delete_value("users_sessions_$UserID");
|
||||
|
||||
$DB->query("
|
||||
DELETE FROM users_sessions
|
||||
@ -709,7 +738,7 @@
|
||||
if (empty($UpdateSet) && empty($EditSummary)) {
|
||||
if (!$Reason) {
|
||||
if (str_replace("\r", '', $Cur['AdminComment']) != str_replace("\r", '', $AdminComment) && check_perms('users_disable_any')) {
|
||||
$UpdateSet[] = "AdminComment='$AdminComment'";
|
||||
$UpdateSet[] = "AdminComment = '$AdminComment'";
|
||||
} else {
|
||||
header("Location: user.php?id=$UserID");
|
||||
die();
|
||||
@ -720,14 +749,14 @@
|
||||
}
|
||||
|
||||
if ($DeleteKeys) {
|
||||
$Cache->delete_value('user_info_'.$UserID);
|
||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||
$Cache->delete_value("user_info_$UserID");
|
||||
$Cache->delete_value("user_info_heavy_$UserID");
|
||||
} else {
|
||||
$Cache->begin_transaction('user_info_'.$UserID);
|
||||
$Cache->begin_transaction("user_info_$UserID");
|
||||
$Cache->update_row(false, $LightUpdates);
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||
$Cache->begin_transaction("user_info_heavy_$UserID");
|
||||
$Cache->update_row(false, $HeavyUpdates);
|
||||
$Cache->commit_transaction(0);
|
||||
}
|
||||
@ -735,27 +764,25 @@
|
||||
$Summary = '';
|
||||
// Create edit summary
|
||||
if ($EditSummary) {
|
||||
$Summary = implode(', ', $EditSummary)." by ".$LoggedUser['Username'];
|
||||
$Summary = sqltime().' - '.ucfirst($Summary);
|
||||
$Summary = implode(', ', $EditSummary) . ' by ' . $LoggedUser['Username'];
|
||||
$Summary = sqltime() . ' - ' . ucfirst($Summary);
|
||||
|
||||
if ($Reason) {
|
||||
$Summary .= "\nReason: ".$Reason;
|
||||
$Summary .= "\nReason: $Reason";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$Summary .= "\n\n".$AdminComment;
|
||||
$Summary .= "\n\n$AdminComment";
|
||||
} elseif (empty($UpdateSet) && empty($EditSummary) && $Cur['AdminComment'] == $_POST['AdminComment']) {
|
||||
$Summary = sqltime().' - '.'Comment added by '.$LoggedUser['Username'].': '.$Reason."\n\n";
|
||||
|
||||
$Summary = sqltime() . ' - Comment added by ' . $LoggedUser['Username'] . ': ' . "$Reason\n\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!empty($Summary)) {
|
||||
$UpdateSet[] = "AdminComment='$Summary'";
|
||||
$UpdateSet[] = "AdminComment = '$Summary'";
|
||||
} else {
|
||||
$UpdateSet[] = "AdminComment='$AdminComment'";
|
||||
$UpdateSet[] = "AdminComment = '$AdminComment'";
|
||||
}
|
||||
|
||||
// Update cache
|
||||
@ -765,7 +792,11 @@
|
||||
|
||||
$SET = implode(', ', $UpdateSet);
|
||||
|
||||
$SQL = "UPDATE users_main AS m JOIN users_info AS i ON m.ID=i.UserID SET $SET WHERE m.ID='$UserID'";
|
||||
$SQL = "
|
||||
UPDATE users_main AS m
|
||||
JOIN users_info AS i ON m.ID = i.UserID
|
||||
SET $SET
|
||||
WHERE m.ID = '$UserID'";
|
||||
|
||||
// Perform update
|
||||
//die($SQL);
|
||||
|
@ -152,7 +152,7 @@ function($Matches) {
|
||||
$ParanoiaLevel = 0;
|
||||
foreach ($Paranoia as $P) {
|
||||
$ParanoiaLevel++;
|
||||
if (strpos($P, '+')) {
|
||||
if (strpos($P, '+') !== false) {
|
||||
$ParanoiaLevel++;
|
||||
}
|
||||
}
|
||||
@ -171,8 +171,8 @@ function check_paranoia_here($Setting) {
|
||||
|
||||
$Badges = (($Donor) ? '<a href="donate.php"><img src="'.STATIC_SERVER.'common/symbols/donor.png" alt="Donor" /></a>' : '');
|
||||
|
||||
$Badges.=(($Warned!='0000-00-00 00:00:00') ? '<img src="'.STATIC_SERVER.'common/symbols/warned.png" alt="Warned" />' : '');
|
||||
$Badges.=(($Enabled == '1' || $Enabled == '0' || !$Enabled) ? '' : '<img src="'.STATIC_SERVER.'common/symbols/disabled.png" alt="Banned" />');
|
||||
$Badges .= (($Warned != '0000-00-00 00:00:00') ? '<img src="'.STATIC_SERVER.'common/symbols/warned.png" alt="Warned" />' : '');
|
||||
$Badges .= (($Enabled == '1' || $Enabled == '0' || !$Enabled) ? '' : '<img src="'.STATIC_SERVER.'common/symbols/disabled.png" alt="Banned" />');
|
||||
|
||||
View::show_header($Username, 'user,bbcode,requests,jquery,lastfm');
|
||||
|
||||
@ -186,8 +186,8 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT FriendID
|
||||
FROM friends
|
||||
WHERE UserID='$LoggedUser[ID]'
|
||||
AND FriendID='$UserID'");
|
||||
WHERE UserID = '$LoggedUser[ID]'
|
||||
AND FriendID = '$UserID'");
|
||||
if ($DB->record_count() == 0) { ?>
|
||||
<a href="friends.php?action=add&friendid=<?=$UserID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Add to friends</a>
|
||||
<? } ?>
|
||||
@ -231,7 +231,7 @@ function check_paranoia_here($Setting) {
|
||||
if ($Avatar && Users::has_avatars_enabled()) {
|
||||
// TODO: use Users::show_avatar; why is display_str() used a few lines below (where avatar is displayed)?
|
||||
if (check_perms('site_proxy_images') && !empty($Avatar)) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&avatar='.$UserID.'&i='.urlencode($Avatar);
|
||||
$Avatar = 'http'.($SSL ? 's' : '').'://'.SITE_URL.'/image.php?c=1&avatar='.$UserID.'&i='.urlencode($Avatar);
|
||||
}
|
||||
?>
|
||||
<div class="box box_image box_image_avatar">
|
||||
@ -246,22 +246,22 @@ function check_paranoia_here($Setting) {
|
||||
<? if (($Override = check_paranoia_here('lastseen'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Last seen: <?=$LastAccess?></li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('uploaded'))) { ?>
|
||||
if (($Override = check_paranoia_here('uploaded'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('downloaded'))) { ?>
|
||||
if (($Override = check_paranoia_here('downloaded'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('ratio'))) { ?>
|
||||
if (($Override = check_paranoia_here('ratio'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
|
||||
if (($Override = check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Required ratio: <?=number_format((double)$RequiredRatio, 2)?></li>
|
||||
<? }
|
||||
if ($OwnProfile || ($Override=check_paranoia_here(false)) || check_perms('users_mod')) { ?>
|
||||
if ($OwnProfile || ($Override = check_paranoia_here(false)) || check_perms('users_mod')) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
|
||||
<? }
|
||||
if (($OwnProfile || check_perms('users_mod')) && $Warned!='0000-00-00 00:00:00') { ?>
|
||||
if (($OwnProfile || check_perms('users_mod')) && $Warned != '0000-00-00 00:00:00') { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
@ -278,7 +278,7 @@ function check_paranoia_here($Setting) {
|
||||
COUNT(DISTINCT r.ID),
|
||||
SUM(rv.Bounty)
|
||||
FROM requests AS r
|
||||
LEFT JOIN requests_votes AS rv ON r.ID=rv.RequestID
|
||||
LEFT JOIN requests_votes AS rv ON r.ID = rv.RequestID
|
||||
WHERE r.FillerID = $UserID");
|
||||
list($RequestsFilled, $TotalBounty) = $DB->next_record();
|
||||
} else {
|
||||
@ -343,23 +343,23 @@ function check_paranoia_here($Setting) {
|
||||
<div class="box box_info box_userinfo_percentile">
|
||||
<div class="head colhead_dark">Percentile rankings (hover for values)</div>
|
||||
<ul class="stats nobullet">
|
||||
<? if (($Override=check_paranoia_here('uploaded'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('uploaded'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Uploaded)?>">Data uploaded: <?=$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?></li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('downloaded'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('downloaded'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($Downloaded)?>">Data downloaded: <?=$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?></li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('uploads+'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('uploads+'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=number_format($Uploads)?>">Torrents uploaded: <?=$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?></li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('requestsfilled_count'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('requestsfilled_count'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=number_format($RequestsFilled)?>">Requests filled: <?=$RequestRank === false ? 'Server busy' : number_format($RequestRank)?></li>
|
||||
<? } ?>
|
||||
<? if (($Override=check_paranoia_here('requestsvoted_bounty'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('requestsvoted_bounty'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=Format::get_size($TotalSpent)?>">Bounty spent: <?=$BountyRank === false ? 'Server busy' : number_format($BountyRank)?></li>
|
||||
<? } ?>
|
||||
<li title="<?=number_format($ForumPosts)?>">Posts made: <?=$PostRank === false ? 'Server busy' : number_format($PostRank)?></li>
|
||||
<? if (($Override=check_paranoia_here('artistsadded'))) { ?>
|
||||
<? if (($Override = check_paranoia_here('artistsadded'))) { ?>
|
||||
<li<?=($Override === 2 ? ' class="paranoia_override"' : '')?> title="<?=number_format($ArtistsAdded)?>">Artists added: <?=$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?></li>
|
||||
<? } ?>
|
||||
<? if (check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) { ?>
|
||||
@ -368,20 +368,20 @@ function check_paranoia_here($Setting) {
|
||||
</ul>
|
||||
</div>
|
||||
<?
|
||||
if (check_perms('users_mod', $Class) || check_perms('users_view_ips',$Class) || check_perms('users_view_keys',$Class)) {
|
||||
if (check_perms('users_mod', $Class) || check_perms('users_view_ips', $Class) || check_perms('users_view_keys', $Class)) {
|
||||
$DB->query("
|
||||
SELECT COUNT(*)
|
||||
FROM users_history_passwords
|
||||
WHERE UserID = '$UserID'");
|
||||
list($PasswordChanges) = $DB->next_record();
|
||||
if (check_perms('users_view_keys',$Class)) {
|
||||
if (check_perms('users_view_keys', $Class)) {
|
||||
$DB->query("
|
||||
SELECT COUNT(*)
|
||||
FROM users_history_passkeys
|
||||
WHERE UserID = '$UserID'");
|
||||
list($PasskeyChanges) = $DB->next_record();
|
||||
}
|
||||
if (check_perms('users_view_ips',$Class)) {
|
||||
if (check_perms('users_view_ips', $Class)) {
|
||||
$DB->query("
|
||||
SELECT COUNT(DISTINCT IP)
|
||||
FROM users_history_ips
|
||||
@ -394,7 +394,7 @@ function check_paranoia_here($Setting) {
|
||||
AND IP != ''");
|
||||
list($TrackerIPs) = $DB->next_record();
|
||||
}
|
||||
if (check_perms('users_view_email',$Class)) {
|
||||
if (check_perms('users_view_email', $Class)) {
|
||||
$DB->query("
|
||||
SELECT COUNT(*)
|
||||
FROM users_history_emails
|
||||
@ -405,11 +405,11 @@ function check_paranoia_here($Setting) {
|
||||
<div class="box box_info box_userinfo_history">
|
||||
<div class="head colhead_dark">History</div>
|
||||
<ul class="stats nobullet">
|
||||
<? if (check_perms('users_view_email',$Class)) { ?>
|
||||
<? if (check_perms('users_view_email', $Class)) { ?>
|
||||
<li>Emails: <?=number_format($EmailChanges)?> <a href="userhistory.php?action=email2&userid=<?=$UserID?>" class="brackets">View</a> <a href="userhistory.php?action=email&userid=<?=$UserID?>" class="brackets">Legacy view</a></li>
|
||||
<?
|
||||
}
|
||||
if (check_perms('users_view_ips',$Class)) {
|
||||
if (check_perms('users_view_ips', $Class)) {
|
||||
?>
|
||||
<li>IPs: <?=number_format($IPChanges)?> <a href="userhistory.php?action=ips&userid=<?=$UserID?>" class="brackets">View</a> <a href="userhistory.php?action=ips&userid=<?=$UserID?>&usersonly=1" class="brackets">View users</a></li>
|
||||
<? if (check_perms('users_view_ips', $Class) && check_perms('users_mod', $Class)) { ?>
|
||||
@ -446,8 +446,7 @@ function check_paranoia_here($Setting) {
|
||||
<?
|
||||
foreach ($UserInfo['ExtraClasses'] as $PermID => $Val) { ?>
|
||||
<li><?=$Classes[$PermID]['Name']?></li>
|
||||
<? }
|
||||
?>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?
|
||||
@ -468,20 +467,20 @@ function check_paranoia_here($Setting) {
|
||||
<li>Paranoia level: <span title="<?=$ParanoiaLevel?>"><?=$ParanoiaLevelText?></span></li>
|
||||
<? if (check_perms('users_view_email', $Class) || $OwnProfile) { ?>
|
||||
<li>Email: <a href="mailto:<?=display_str($Email)?>"><?=display_str($Email)?></a>
|
||||
<? if (check_perms('users_view_email',$Class)) { ?>
|
||||
<? if (check_perms('users_view_email', $Class)) { ?>
|
||||
<a href="user.php?action=search&email_history=on&email=<?=display_str($Email)?>" title="Search" class="brackets">S</a>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? }
|
||||
|
||||
if (check_perms('users_view_ips',$Class)) {
|
||||
if (check_perms('users_view_ips', $Class)) {
|
||||
?>
|
||||
<li>IP: <?=Tools::display_ip($IP)?></li>
|
||||
<li>Host: <?=Tools::get_host_by_ajax($IP)?></li>
|
||||
<?
|
||||
}
|
||||
|
||||
if (check_perms('users_view_keys',$Class) || $OwnProfile) {
|
||||
if (check_perms('users_view_keys', $Class) || $OwnProfile) {
|
||||
?>
|
||||
<li>Passkey: <a href="#" id="passkey" onclick="togglePassKey('<?=display_str($torrent_pass)?>'); return false;" class="brackets">View</a></li>
|
||||
<? }
|
||||
@ -575,10 +574,10 @@ function check_paranoia_here($Setting) {
|
||||
g.Name,
|
||||
g.WikiImage
|
||||
FROM xbt_snatched AS s
|
||||
INNER JOIN torrents AS t ON t.ID=s.fid
|
||||
INNER JOIN torrents_group AS g ON t.GroupID=g.ID
|
||||
WHERE s.uid='$UserID'
|
||||
AND g.CategoryID='1'
|
||||
INNER JOIN torrents AS t ON t.ID = s.fid
|
||||
INNER JOIN torrents_group AS g ON t.GroupID = g.ID
|
||||
WHERE s.uid = '$UserID'
|
||||
AND g.CategoryID = '1'
|
||||
AND g.WikiImage != ''
|
||||
GROUP BY g.ID
|
||||
ORDER BY s.tstamp DESC
|
||||
@ -620,9 +619,9 @@ function check_paranoia_here($Setting) {
|
||||
g.Name,
|
||||
g.WikiImage
|
||||
FROM torrents_group AS g
|
||||
INNER JOIN torrents AS t ON t.GroupID=g.ID
|
||||
WHERE t.UserID='$UserID'
|
||||
AND g.CategoryID='1'
|
||||
INNER JOIN torrents AS t ON t.GroupID = g.ID
|
||||
WHERE t.UserID = '$UserID'
|
||||
AND g.CategoryID = '1'
|
||||
AND g.WikiImage != ''
|
||||
GROUP BY g.ID
|
||||
ORDER BY t.Time DESC
|
||||
@ -657,9 +656,9 @@ function check_paranoia_here($Setting) {
|
||||
$DB->query("
|
||||
SELECT ID, Name
|
||||
FROM collages
|
||||
WHERE UserID='$UserID'
|
||||
AND CategoryID='0'
|
||||
AND Deleted='0'
|
||||
WHERE UserID = '$UserID'
|
||||
AND CategoryID = '0'
|
||||
AND Deleted = '0'
|
||||
ORDER BY Featured DESC, Name ASC");
|
||||
$Collages = $DB->to_array();
|
||||
$FirstCol = true;
|
||||
@ -670,8 +669,8 @@ function check_paranoia_here($Setting) {
|
||||
tg.WikiImage,
|
||||
tg.CategoryID
|
||||
FROM collages_torrents AS ct
|
||||
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
|
||||
WHERE ct.CollageID='$CollageID'
|
||||
JOIN torrents_group AS tg ON tg.ID = ct.GroupID
|
||||
WHERE ct.CollageID = '$CollageID'
|
||||
ORDER BY ct.Sort
|
||||
LIMIT 5");
|
||||
$Collage = $DB->to_array();
|
||||
@ -694,7 +693,7 @@ function check_paranoia_here($Setting) {
|
||||
extract(Torrents::array_group($Group));
|
||||
|
||||
$Name = '';
|
||||
$Name .= Artists::display_artists(array('1'=>$Artists), false, true);
|
||||
$Name .= Artists::display_artists(array('1' => $Artists), false, true);
|
||||
$Name .= $GroupName;
|
||||
?>
|
||||
<td>
|
||||
@ -716,7 +715,7 @@ function check_paranoia_here($Setting) {
|
||||
|
||||
if ((check_perms('users_view_invites')) && $Invited > 0) {
|
||||
include(SERVER_ROOT.'/classes/invite_tree.class.php');
|
||||
$Tree = new INVITE_TREE($UserID, array('visible'=>false));
|
||||
$Tree = new INVITE_TREE($UserID, array('visible' => false));
|
||||
?>
|
||||
<div class="box" id="invitetree_box">
|
||||
<div class="head">
|
||||
@ -741,8 +740,8 @@ function check_paranoia_here($Setting) {
|
||||
COUNT(rv.UserID) AS Votes,
|
||||
SUM(rv.Bounty) AS Bounty
|
||||
FROM requests AS r
|
||||
LEFT JOIN users_main AS u ON u.ID=UserID
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID
|
||||
LEFT JOIN users_main AS u ON u.ID = UserID
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID = r.ID
|
||||
WHERE r.UserID = $UserID
|
||||
AND r.TorrentID = 0
|
||||
GROUP BY r.ID
|
||||
@ -793,7 +792,7 @@ function check_paranoia_here($Setting) {
|
||||
} elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
|
||||
$FullName = "<a href=\"requests.php?action=view&id=$RequestID\">$Title [$Year]</a>";
|
||||
} else {
|
||||
$FullName ="<a href=\"requests.php?action=view&id=$RequestID\">$Title</a>";
|
||||
$FullName = "<a href=\"requests.php?action=view&id=$RequestID\">$Title</a>";
|
||||
}
|
||||
|
||||
$Row = (empty($Row) || $Row == 'a') ? 'b' : 'a';
|
||||
@ -849,7 +848,7 @@ function check_paranoia_here($Setting) {
|
||||
ResolverID
|
||||
FROM staff_pm_conversations
|
||||
WHERE UserID = $UserID
|
||||
AND (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."')
|
||||
AND (Level <= $UserLevel OR AssignedToUser = '".$LoggedUser['ID']."')
|
||||
ORDER BY Date DESC");
|
||||
if ($DB->record_count()) {
|
||||
$StaffPMs = $DB->to_array();
|
||||
@ -1034,7 +1033,7 @@ function check_paranoia_here($Setting) {
|
||||
<?
|
||||
}
|
||||
|
||||
if (check_perms('users_edit_ratio',$Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
|
||||
if (check_perms('users_edit_ratio', $Class) || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="label"><span title="Upload amount in bytes. Also accepts e.g. +20GB or -35.6364MB on the end">Uploaded:</span></td>
|
||||
@ -1243,9 +1242,9 @@ function check_paranoia_here($Setting) {
|
||||
<td class="label">Account:</td>
|
||||
<td>
|
||||
<select name="UserStatus">
|
||||
<option value="0"<? if ($Enabled=='0') { ?> selected="selected"<? } ?>>Unconfirmed</option>
|
||||
<option value="1"<? if ($Enabled=='1') { ?> selected="selected"<? } ?>>Enabled</option>
|
||||
<option value="2"<? if ($Enabled=='2') { ?> selected="selected"<? } ?>>Disabled</option>
|
||||
<option value="0"<? if ($Enabled == '0') { ?> selected="selected"<? } ?>>Unconfirmed</option>
|
||||
<option value="1"<? if ($Enabled == '1') { ?> selected="selected"<? } ?>>Enabled</option>
|
||||
<option value="2"<? if ($Enabled == '2') { ?> selected="selected"<? } ?>>Disabled</option>
|
||||
<? if (check_perms('users_delete_users')) { ?>
|
||||
<optgroup label="-- WARNING --">
|
||||
<option value="delete">Delete account</option>
|
||||
|
@ -42,8 +42,7 @@ source torrents : torrents_base {
|
||||
(id, name, tags, year, rlabel, cnumber, catid, reltype, \
|
||||
vanityhouse) \
|
||||
select id, name, taglist, year, recordlabel, cataloguenumber, \
|
||||
categoryid, unix_timestamp(time), releasetype, \
|
||||
vanityhouse \
|
||||
categoryid, releasetype, vanityhouse \
|
||||
from torrents_group \
|
||||
where time < @starttime
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user