diff --git a/classes/class_paranoia.php b/classes/class_paranoia.php
index aeb37d40..361e4b42 100644
--- a/classes/class_paranoia.php
+++ b/classes/class_paranoia.php
@@ -37,14 +37,16 @@
* @param $Paranoia The paranoia level to check against.
* @param $UserClass The user class to check against (Staff can see through paranoia of lower classed staff)
* @param $UserID Optional. The user ID of the person being viewed
- * @return Boolean representing whether the current user can see through the paranoia setting
+ * @return mixed 1 representing the user has normal access
+ 2 representing that the paranoia was overridden,
+ false representing access denied.
*/
+define("PARANOIA_ALLOWED", 1);
+define("PARANOIA_OVERRIDDEN", 2);
+
function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
global $LoggedUser, $Classes;
- if(check_perms('users_override_paranoia', $UserClass)) {
- return true;
- }
if ($Property == false) {
return false;
}
@@ -60,29 +62,39 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
return $all;
} else {
if(($UserID !== false) && ($LoggedUser['ID'] == $UserID)) {
- return true;
+ return PARANOIA_ALLOWED;
}
$May = !in_array($Property, $Paranoia) && !in_array($Property . '+', $Paranoia);
+ if($May)
+ return PARANOIA_ALLOWED;
+
+ if(check_perms('users_override_paranoia', $UserClass))
+ return PARANOIA_OVERRIDDEN;
+ $Override=false;
switch ($Property) {
case 'downloaded':
case 'ratio':
case 'uploaded':
case 'lastseen':
- $May = $May || check_perms('users_mod', $UserClass);
+ if(check_perms('users_mod', $UserClass))
+ return PARANOIA_OVERRIDDEN;
break;
case 'snatched': case 'snatched+':
- $May = $May || check_perms('site_view_torrent_snatchlist', $UserClass);
+ if(check_perms('users_view_torrents_snatchlist', $UserClass))
+ return PARANOIA_OVERRIDDEN;
break;
case 'uploads': case 'uploads+':
case 'seeding': case 'seeding+':
case 'leeching': case 'leeching+':
- $May = $May || check_perms('users_view_seedleech', $UserClass);
+ if(check_perms('users_view_seedleech', $UserClass))
+ return PARANOIA_OVERRIDDEN;
break;
case 'invitedcount':
- $May = $May || check_perms('users_view_invites', $UserClass);
+ if(check_perms('users_view_invites', $UserClass))
+ return PARANOIA_OVERRIDDEN;
break;
}
- return $May;
+ return false;
}
-}
+}
\ No newline at end of file
diff --git a/sections/user/index.php b/sections/user/index.php
index 6a02c10b..8eaba161 100644
--- a/sections/user/index.php
+++ b/sections/user/index.php
@@ -33,18 +33,16 @@
case 'search':// User search
if (check_perms('admin_advanced_user_search') && check_perms('users_view_ips') && check_perms('users_view_email')) {
include('advancedsearch.php');
- } else {
+ } else
include('search.php');
- }
break;
case 'edit':
include('edit.php');
break;
-
+
case 'takeedit':
include('takeedit.php');
break;
-
case 'invitetree':
include(SERVER_ROOT.'/sections/user/invitetree.php');
break;
diff --git a/sections/user/user.php b/sections/user/user.php
index f40f0c87..4a508295 100644
--- a/sections/user/user.php
+++ b/sections/user/user.php
@@ -6,10 +6,10 @@
include(SERVER_ROOT.'/sections/requests/functions.php');
include(SERVER_ROOT.'/classes/class_image_tools.php');
-if (empty($_GET['id']) || !is_numeric($_GET['id'])) { error(0); }
+if (empty($_GET['id']) || !is_numeric($_GET['id']))
+ error(0);
+
$UserID = $_GET['id'];
-
-
if($UserID == $LoggedUser['ID']) {
$OwnProfile = true;
} else {
@@ -213,23 +213,23 @@ function check_paranoia_here($Setting) {
Stats
- Joined: =$JoinedDate?>
- if (check_paranoia_here('lastseen')) { ?>
- - Last Seen: =$LastAccess?>
+ if (($Override = check_paranoia_here('lastseen'))) { ?>
+ - >Last Seen: =$LastAccess?>
} ?>
- if (check_paranoia_here('uploaded')) { ?>
- - Uploaded: =get_size($Uploaded)?>
+ if (($Override=check_paranoia_here('uploaded'))) { ?>
+ - >Uploaded: =get_size($Uploaded)?>
} ?>
- if (check_paranoia_here('downloaded')) { ?>
- - Downloaded: =get_size($Downloaded)?>
+ if (($Override=check_paranoia_here('downloaded'))) { ?>
+ - >Downloaded: =get_size($Downloaded)?>
} ?>
- if (check_paranoia_here('ratio')) { ?>
- - Ratio: =ratio($Uploaded, $Downloaded)?>
+ if (($Override=check_paranoia_here('ratio'))) { ?>
+ - >Ratio: =ratio($Uploaded, $Downloaded)?>
} ?>
- if (check_paranoia_here('requiredratio') && isset($RequiredRatio)) { ?>
- - Required ratio: =number_format((double)$RequiredRatio, 2)?>
+ if (($Override=check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
+ - >Required ratio: =number_format((double)$RequiredRatio, 2)?>
} ?>
- if ($OwnProfile || check_paranoia_here(false)) { //if ($OwnProfile || check_perms('users_mod')) { ?>
- - Tokens: =number_format($FLTokens)?>
+ if ($OwnProfile || ($Override=check_paranoia_here(false))) { //if ($OwnProfile || check_perms('users_mod')) { ?>
+ - >Tokens: =number_format($FLTokens)?>
} ?>
@@ -287,24 +287,24 @@ function check_paranoia_here($Setting) {
Percentile Rankings (Hover for values)
- if (check_paranoia_here('uploaded')) { ?>
- - Data uploaded: =$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?>
+ if (($Override=check_paranoia_here('uploaded'))) { ?>
+ - title="=get_size($Uploaded)?>">Data uploaded: =$UploadedRank === false ? 'Server busy' : number_format($UploadedRank)?>
} ?>
- if (check_paranoia_here('downloaded')) { ?>
- - Data downloaded: =$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?>
+ if (($Override=check_paranoia_here('downloaded'))) { ?>
+ - title="=get_size($Downloaded)?>">Data downloaded: =$DownloadedRank === false ? 'Server busy' : number_format($DownloadedRank)?>
} ?>
- if (check_paranoia_here('uploads+')) { ?>
- - Torrents uploaded: =$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?>
+ if (($Override=check_paranoia_here('uploads+'))) { ?>
+ - title="=$Uploads?>">Torrents uploaded: =$UploadsRank === false ? 'Server busy' : number_format($UploadsRank)?>
} ?>
- if (check_paranoia_here('requestsfilled_count')) { ?>
- - Requests filled: =$RequestRank === false ? 'Server busy' : number_format($RequestRank)?>
+ if (($Override=check_paranoia_here('requestsfilled_count'))) { ?>
+ - title="=$RequestsFilled?>">Requests filled: =$RequestRank === false ? 'Server busy' : number_format($RequestRank)?>
} ?>
- if (check_paranoia_here('requestsvoted_bounty')) { ?>
- - Bounty spent: =$BountyRank === false ? 'Server busy' : number_format($BountyRank)?>
+ if (($Override=check_paranoia_here('requestsvoted_bounty'))) { ?>
+ - title="=get_size($TotalSpent)?>">Bounty spent: =$BountyRank === false ? 'Server busy' : number_format($BountyRank)?>
} ?>
- Posts made: =$PostRank === false ? 'Server busy' : number_format($PostRank)?>
- if (check_paranoia_here('artistsadded')) { ?>
- - Artists added: =$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?>
+ if (($Override=check_paranoia_here('artistsadded'))) { ?>
+ - title="=$ArtistsAdded?>">Artists added: =$ArtistsRank === false ? 'Server busy' : number_format($ArtistsRank)?>
} ?>
if (check_paranoia_here(array('uploaded', 'downloaded', 'uploads+', 'requestsfilled_count', 'requestsvoted_bounty', 'artistsadded'))) { ?>
- Overall rank: =$OverallRank === false ? 'Server busy' : number_format($OverallRank)?>
@@ -439,9 +439,9 @@ function check_paranoia_here($Setting) {
$DB->query("SELECT SupportFor FROM users_info WHERE UserID = ".$LoggedUser['ID']);
list($SupportFor) = $DB->next_record();
}
-if (check_perms('users_mod') || $OwnProfile || !empty($SupportFor)) {
+if ($Override=check_perms('users_mod') || $OwnProfile || !empty($SupportFor)) {
?>
- - Clients:
+
- >Clients:
$DB->query("SELECT DISTINCT useragent FROM xbt_files_users WHERE uid = ".$UserID);
while(list($Client) = $DB->next_record()) {
if (strlen($Clients) > 0) {
@@ -483,55 +483,88 @@ function check_paranoia_here($Setting) {
Community
- Forum Posts: =number_format($ForumPosts)?> [View]
- if (check_paranoia_here('torrentcomments')) { ?>
- - Torrent Comments: =number_format($NumComments)?> [View]
- } elseif (check_paranoia_here('torrentcomments+')) { ?>
- - Torrent Comments: =number_format($NumComments)?>
- } ?>
- if (check_paranoia_here('collages')) { ?>
- - Collages started: =number_format($NumCollages)?> [View]
- } elseif (check_paranoia_here('collages+')) { ?>
- - Collages started: =number_format($NumCollages)?>
- } ?>
- if (check_paranoia_here('collagecontribs')) { ?>
- - Collages contributed to: =number_format($NumCollageContribs)?> [View]
- } elseif(check_paranoia_here('collagecontribs+')) { ?>
- - Collages contributed to: =number_format($NumCollageContribs)?>
- } ?>
- if (check_paranoia_here('requestsfilled_list')) { ?>
- - Requests filled: =number_format($RequestsFilled)?> for =get_size($TotalBounty)?> [View]
- } elseif (check_paranoia_here(array('requestsfilled_count', 'requestsfilled_bounty'))) { ?>
- - Requests filled: =number_format($RequestsFilled)?> for =get_size($TotalBounty)?>
- } elseif (check_paranoia_here('requestsfilled_count')) { ?>
+ if (($Override=check_paranoia_here('torrentcomments+'))) { ?>
+ - >Torrent Comments: =number_format($NumComments)?>
+ if($Override=check_paranoia_here('torrentcomments')) { ?>[ title="View">View]
+ } ?>
+
+ }
+ if (($Override=check_paranoia_here('collages+'))) { ?>
+ - >Collages started: =number_format($NumCollages)?>
+ if(($Override=check_paranoia_here('collages'))) { ?>[
+ href="collages.php?userid==$UserID?>" title="View">View]
+ } ?>
+
+ }
+ if (($Override=check_paranoia_here('collagecontribs+'))) { ?>
+ - >Collages contributed to: echo number_format($NumCollageContribs);
+ if (($Override=check_paranoia_here('collagecontribs'))) {
+ ?> [ href="collages.php?userid==$UserID?>&contrib=1" title="View">View]
+ } ?>
+
+ }
+
+//Let's see if we can view requests because of reasons
+$ViewAll = check_paranoia_here('requestsfilled_list');
+$ViewCount = check_paranoia_here('requestsfilled_count');
+$ViewBounty = check_paranoia_here('requestsfilled_bounty');
+
+ if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
- Requests filled: =number_format($RequestsFilled)?>
- } elseif (check_paranoia_here('requestsfilled_bounty')) { ?>
- - Requests filled: =get_size($TotalBounty)?> collected
- } ?>
- if (check_paranoia_here('requestsvoted_list')) { ?>
- - Requests voted: =number_format($RequestsVoted)?> for =get_size($TotalSpent)?> [View]
- } elseif (check_paranoia_here(array('requestsvoted_count', 'requestsvoted_bounty'))) { ?>
- - Requests voted: =number_format($RequestsVoted)?> for =get_size($TotalSpent)?>
- } elseif (check_paranoia_here('requestsvoted_count')) { ?>
+ } elseif(!$ViewCount && $ViewBounty && !$ViewAll) { ?>
+ - Requests voted: =get_size($TotalSpent)?> collected
+ } elseif($ViewCount && $ViewBounty && !$ViewAll) { ?>
+ - Requests filled: =number_format($RequestsFilled)?> for =get_size($TotalBounty)?>
+ } elseif($ViewAll) { ?>
+ -
+ >Requests filled: =number_format($RequestsFilled)?>
+ > for =get_size($TotalBounty) ?>
+ [ title="View">View]
+
+ }
+
+//Let's see if we can view requests because of reasons
+$ViewAll = check_paranoia_here('requestsvoted_list');
+$ViewCount = check_paranoia_here('requestsvoted_count');
+$ViewBounty = check_paranoia_here('requestsvoted_bounty');
+
+ if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
- Requests voted: =number_format($RequestsVoted)?>
- } elseif (check_paranoia_here('requestsvoted_bounty')) { ?>
+ } elseif(!$ViewCount && $ViewBounty && !$ViewAll) { ?>
- Requests voted: =get_size($TotalSpent)?> spent
- } ?>
- if (check_paranoia_here('uploads')) { ?>
- - Uploaded: =number_format($Uploads)?> [View] if(check_perms('zip_downloader')) { ?> [Download] } ?>
- } elseif (check_paranoia_here('uploads+')) { ?>
- - Uploaded: =number_format($Uploads)?>
- } ?>
- if (check_paranoia_here('uniquegroups')) { ?>
- - Unique Groups: =number_format($UniqueGroups)?> [View]
- } elseif (check_paranoia_here('uniquegroups+')) { ?>
- - Unique Groups: =number_format($UniqueGroups)?>
- } ?>
- if (check_paranoia_here('perfectflacs')) { ?>
- - "Perfect" FLACs: =number_format($PerfectFLACs)?> [View]
- } elseif (check_paranoia_here('perfectflacs+')) { ?>
- - "Perfect" FLACs: =number_format($PerfectFLACs)?>
- } ?>
-
+ } elseif($ViewCount && $ViewBounty && !$ViewAll) { ?>
+ - Requests voted: =number_format($RequestsVoted)?> for =get_size($TotalSpent)?>
+ } elseif($ViewAll) { ?>
+ -
+ >Requests voted: =number_format($RequestsVoted)?>
+ > for =get_size($TotalSpent)?>
+ [ title="View">View]
+
+ }
+ if (($Override=check_paranoia_here('uploads+'))) { ?>
+ - >Uploaded: =number_format($Uploads)?>
+ if(($Override=check_paranoia_here('uploads'))) { ?>[ href="torrents.php?type=uploaded&userid==$UserID?>" title="View">View] } if(check_perms('zip_downloader')) { ?> [Download] } ?>
+
+ }
+ if (($Override=check_paranoia_here('uniquegroups+'))) { ?>
+ - >
+ Unique Groups:
+ [ href="torrents.php?type=uploaded&userid==$UserID?>&filter=uniquegroup">View]
+ }?>
+
+ }
+ if (($Override=check_paranoia_here('perfectflacs+'))) { ?>
+ - >"Perfect" FLACs:
+ [ href="torrents.php?type=uploaded&userid==$UserID?>&filter=perfectflac">View]
+ }
+ }
if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) {
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, 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.active=1 GROUP BY Type");
@@ -540,37 +573,46 @@ function check_paranoia_here($Setting) {
$Leeching = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0;
}
?>
- if (check_paranoia_here('seeding')) { ?>
- - Seeding: =number_format($Seeding)?> =(check_paranoia_here('snatched') && $Snatched )?'(' . 100*min(1,round($Seeding/$UniqueSnatched,2)).'%) ':''?>[View] if (check_perms('zip_downloader')) { ?> [Download] } ?>
- } elseif (check_paranoia_here('seeding+')) { ?>
- - Seeding: =number_format($Seeding)?>
- } ?>
- if (check_paranoia_here('leeching')) { ?>
- - Leeching: =number_format($Leeching)?> [View]=($DisableLeech == 0 && check_perms('users_view_ips')) ? " (Disabled)" : ""?>
- } elseif (check_paranoia_here('leeching+')) { ?>
- - Leeching: =number_format($Leeching)?>
+ if (($Override=check_paranoia_here('seeding+'))) { ?>
+ - >Seeding: =number_format($Seeding)?>
+ if(($AOverride=check_paranoia_here('seeding'))) {
+ echo (($Override=check_paranoia_here('snatched')) && $Snatched )? ' ':''?>
+ [ title="View">View]
+ if (check_perms('zip_downloader')) { ?>
+ [Download]
+ } ?>
+ } ?>
+
+ }
+ if (($Override=check_paranoia_here('leeching+'))) { ?>
+ - >Leeching: echo number_format($Leeching);
+ if(($Override=check_paranoia_here('leeching'))) { ?>
+ [ href="torrents.php?type=leeching&userid==$UserID?>" title="View">View]
+ }
+ echo ($DisableLeech == 0 && check_perms('users_view_ips')) ? " (Disabled)" : ""?>
+
}
?>
- if (check_paranoia_here('snatched+')) { ?>
- - Snatched: =number_format($Snatched)?>
- if(check_perms('site_view_torrent_snatchlist', $Class)) { ?>
- (=number_format($UniqueSnatched)?>)
+ if (($Override=check_paranoia_here('snatched+'))) { ?>
+
- >Snatched: =number_format($Snatched)?>
+ if(($Override=check_perms('site_view_torrent_snatchlist', $Class))) { ?>
+ (= $Override === 2 ? '' : number_format($UniqueSnatched) ?>)
} ?>
} ?>
- if (check_paranoia_here('snatched')) { ?>
- [View] if(check_perms('zip_downloader')) { ?> [Download] } ?>
+ if (($Override=check_paranoia_here('snatched'))) { ?>
+ [ title="View">View] if(check_perms('zip_downloader')) { ?> [Download] } ?>
}
-if(check_perms('site_view_torrent_snatchlist', $Class)) {
+if(($Override=check_perms('site_view_torrent_snatchlist', $Class))) {
$DB->query("SELECT COUNT(ud.UserID), COUNT(DISTINCT ud.TorrentID) FROM users_downloads AS ud INNER JOIN torrents AS t ON t.ID=ud.TorrentID WHERE ud.UserID='$UserID'");
list($NumDownloads, $UniqueDownloads) = $DB->next_record();
?>
- - Downloaded: =number_format($NumDownloads)?> (=number_format($UniqueDownloads)?>) [View]
+ - >Downloaded: =number_format($NumDownloads)?> (=number_format($UniqueDownloads)?>) [View]
}
-if(check_paranoia_here('invitedcount')) {
+if(($Override=check_paranoia_here('invitedcount'))) {
$DB->query("SELECT COUNT(UserID) FROM users_info WHERE Inviter='$UserID'");
list($Invited) = $DB->next_record();
?>
diff --git a/static/styles/global.css b/static/styles/global.css
index 5084c849..4bfb852a 100644
--- a/static/styles/global.css
+++ b/static/styles/global.css
@@ -173,4 +173,36 @@ span.rbm { display: block; background: url('../rippy/rippy_middle.gif') repeat b
span.rbb { display: block; padding: 4px 0px 18px; margin-bottom: 5px; background: url('../rippy/rippy_bottom.gif') no-repeat bottom; }
span.secondary_class { font-size:85%; font-weight:bold; }
-.breadcrumbs { font-weight: bold; text-align: right; }
\ No newline at end of file
+.breadcrumbs { font-weight: bold; text-align: right; }
+
+.paranoia_override {
+ font-style: italic;
+}
+#manage_collage_table.ui-sortable .ui-sortable-helper.drag {
+ cursor:grabbing;
+ cursor:-moz-grabbing;
+ cursor:-webkit-grabbing;
+}
+#manage_collage_table .ui-sortable-helper td,
+#manage_collage_table .ui-sortable-placeholder {
+ border: 0;
+}
+.drag_drop_save {
+ padding: 6px 0;
+ overflow: hidden;
+}
+.headerSort {
+ cursor: pointer;
+}
+.headerSort span {
+ background: url("../common/table-order.png") no-repeat scroll right -38px transparent;
+ padding: 0px 20px 0 0;
+}
+.headerSortDown span {
+ background: url("../common/table-order.png") no-repeat scroll right 4px transparent;
+}
+.headerSortUp span {
+ background: url("../common/table-order.png") no-repeat scroll right -79px transparent;
+}
+ padding: 6px 0
+}
\ No newline at end of file