Allow Public ACL for all round transactions
This commit is contained in:
parent
bb924f82fe
commit
6c3d2d1e96
@ -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;
|
||||
|
||||
@ -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' ),
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user