Skip to content

[FIX] disable earnings when tx summaries are disabled #2197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions include/pages/account/earnings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

// Check user authentication status
if ($user->isAuthenticated()) {
if ($user->isAuthenticated() AND !$setting->getValue('disable_transactionsummary')) {
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$iLimit = 30;
$debug->append('No cached version available, fetching from backend', 3);
if (!$setting->getValue('disable_transactionsummary')) {
$aTransactionSummary = $transaction->getTransactionSummary($_SESSION['USERDATA']['id']);
$aTransactionSummaryByTime = $transaction->getTransactionTypebyTime($_SESSION['USERDATA']['id']);
$smarty->assign('SUMMARY', $aTransactionSummary);
$smarty->assign('BYTIME', $aTransactionSummaryByTime);
}
$aTransactionSummary = $transaction->getTransactionSummary($_SESSION['USERDATA']['id']);
$aTransactionSummaryByTime = $transaction->getTransactionTypebyTime($_SESSION['USERDATA']['id']);
$smarty->assign('SUMMARY', $aTransactionSummary);
$smarty->assign('BYTIME', $aTransactionSummaryByTime);
} else {
$debug->append('Using cached page', 3);
}
$smarty->assign('CONTENT', 'default.tpl');
} else if (!$setting->getValue('disable_transactionsummary')) {
$smarty->assign('CONTENT', 'disabled.tpl');
} else {
$smarty->assign('CONTENT', 'disabled.tpl');
}

$smarty->assign('CONTENT', 'default.tpl');
?>
1 change: 1 addition & 0 deletions include/smarty_globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'disable_contactform' => $setting->getValue('disable_contactform'),
'disable_contactform_guest' => $setting->getValue('disable_contactform_guest'),
'disable_worker_edit' => $setting->getValue('disable_worker_edit'),
'disable_transactionsummary' => $setting->getValue('disable_transactionsummary'),
'algorithm' => $config['algorithm'],
'getbalancewithunconfirmed' => $config['getbalancewithunconfirmed'],
'target_bits' => $coin->getTargetBits(),
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion templates/bootstrap/global/navigation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=edit"><i class="fa fa-edit fa-fw"></i> Edit Account</a></li>
<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=workers"><i class="fa fa-desktop fa-fw"></i> My Workers</a></li>
<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=transactions"><i class="fa fa-credit-card fa-fw"></i> Transactions</a></li>
<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=earnings"><i class="fa fa-money fa-fw"></i> Earnings</a></li>
{if !$GLOBAL.config.disable_transactionsummary}<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=earnings"><i class="fa fa-money fa-fw"></i> Earnings</a></li>{/if}
{if !$GLOBAL.config.disable_notifications}<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=notifications"><i class="fa fa-bullhorn fa-fw"></i> Notifications</a></li>{/if}
{if !$GLOBAL.config.disable_invitations}<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=invitations"><i class="fa fa-users fa-fw"></i> Invitations</a></li>{/if}
{if !$GLOBAL.acl.qrcode}<li><a href="{$smarty.server.SCRIPT_NAME}?page=account&action=qrcode"><i class="fa fa-qrcode fa-fw"></i> QR Codes</a></li>{/if}
Expand Down