diff --git a/public/include/classes/roundstats.class.php b/public/include/classes/roundstats.class.php index 8af22cbf..6b187973 100644 --- a/public/include/classes/roundstats.class.php +++ b/public/include/classes/roundstats.class.php @@ -102,12 +102,12 @@ class RoundStats { * @param height int Block Height * @return data array Block round transactions **/ - public function getAllRoundTransactions($iHeight=0) { + public function getAllRoundTransactions($iHeight=0, $admin) { $this->debug->append("STA " . __METHOD__, 4); $stmt = $this->mysqli->prepare(" SELECT t.id AS id, - a.username AS username, + IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username, t.type AS type, t.amount AS amount FROM $this->tableTrans AS t @@ -115,7 +115,7 @@ class RoundStats { LEFT JOIN $this->tableUsers AS a ON t.account_id = a.id WHERE b.height = ? ORDER BY id ASC"); - if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) + if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $admin, $iHeight) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_all(MYSQLI_ASSOC); $this->debug->append('Unable to fetch transactions'); return false; diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 97290903..c28b6095 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -165,6 +165,13 @@ $aSettings['acl'][] = array( 'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'), 'tooltip' => 'Make the round statistics page private (users only) or public.' ); +$aSettings['acl'][] = array( + 'display' => 'Round Transactions', 'type' => 'select', + 'options' => array( 0 => 'Admins', 1 => 'Public'), + 'default' => 0, + 'name' => 'acl_round_transactions', 'value' => $setting->getValue('acl_round_transactions'), + 'tooltip' => 'Display all transactions regardless of admin status.' +); $aSettings['system'][] = array( 'display' => 'Disable e-mail confirmations', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), diff --git a/public/include/pages/statistics/round.inc.php b/public/include/pages/statistics/round.inc.php index e984ed66..4c37f749 100644 --- a/public/include/pages/statistics/round.inc.php +++ b/public/include/pages/statistics/round.inc.php @@ -22,8 +22,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id'])); $aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id'])); - if ($user->isAdmin(@$_SESSION['USERDATA']['id'])) { - $aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey); + if ($user->isAdmin(@$_SESSION['USERDATA']['id']) || $setting->getValue('acl_round_transactions')) { + $aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey, @$_SESSION['USERDATA']['id']); } else { $aUserRoundTransactions = $roundstats->getUserRoundTransactions($iKey, @$_SESSION['USERDATA']['id']); }