Fixed bug where preview paranoia would ignore donor statistics; showing it anyway.

This commit is contained in:
0bs3rv3ra 2014-03-31 20:37:01 +10:00
parent e5b57d8c27
commit 9e1fb5bb6a
2 changed files with 11 additions and 3 deletions

View File

@ -58,9 +58,17 @@ public static function render_mod_donations($UserID) {
<?
}
public static function render_donor_stats($UserID) {
public static function render_donor_stats($UserID, $Preview, $Paranoia) {
$OwnProfile = G::$LoggedUser['ID'] == $UserID;
if (check_perms("users_mod") || $OwnProfile || Donations::is_visible($UserID)) {
$DonationsVisible = Donations::is_visible($UserID);
if ($Preview == 1) {
$OwnProfile = false;
}
//if previewing paranoia with donor_stats hidden, make sure (below) reflects that
if (in_array('donor_stats', $Paranoia)) {
$DonationsVisible = false;
}
if (check_perms("users_mod") || $OwnProfile || $DonationsVisible) {
?>
<div class="box box_info box_userinfo_donor_stats">
<div class="head colhead_dark">Donor Statistics</div>

View File

@ -561,7 +561,7 @@ function check_paranoia_here($Setting) {
</div>
<?
include(SERVER_ROOT.'/sections/user/community_stats.php');
DonationsView::render_donor_stats($UserID);
DonationsView::render_donor_stats($UserID, $Preview, $Paranoia);
?>
</div>
<div class="main_column">