Merge pull request #2297 from MPOS/dashboard-global-api-disabled

[FIX] Disable API calls if not enabled
This commit is contained in:
Sebastian Grewe 2014-07-22 10:33:21 +02:00
commit f58db4f032
3 changed files with 9 additions and 4 deletions

View File

@ -52,6 +52,7 @@ if ($user->isAuthenticated()) {
$smarty->assign('BLOCKSFOUND', $aLastBlocks);
$smarty->assign('DISABLED_DASHBOARD', $setting->getValue('disable_dashboard'));
$smarty->assign('DISABLED_DASHBOARD_API', $setting->getValue('disable_dashboard_api'));
$smarty->assign('DISABLED_API', $setting->getValue('disable_api'));
$smarty->assign('ESTIMATES', array('shares' => $iEstShares, 'percent' => $dEstPercent));
$smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock, 'EstNextDifficulty' => $dEstNextDifficulty, 'EstTimePerBlock' => $dExpectedTimePerBlock, 'BlocksUntilDiffChange' => $iBlocksUntilDiffChange));
$smarty->assign('INTERVAL', $interval / 60);

View File

@ -16,7 +16,9 @@
{include file="dashboard/overview/default.tpl"}
{include file="dashboard/round_statistics/$PAYOUT_SYSTEM/default.tpl"}
{include file="dashboard/account_data/default.tpl"}
{if !$DISABLED_API}
{include file="dashboard/worker_information/default.tpl"}
{/if}
{include file="dashboard/blocks/default.tpl"}
</div>
</div>

View File

@ -178,7 +178,7 @@ $(document).ready(function(){
return;
}
if (blocks[0].height > lastBlock) {
if(canCreateSoundJS) {
if(canCreateSoundJS) {
createjs.Sound.play('ding');
}
lastBlock = blocks[0].height;
@ -234,6 +234,7 @@ $(document).ready(function(){
});
})();
{/literal}{if !$DISABLED_API}{literal}
// Worker process to update active workers in the account details table
(function worker2() {
$.ajax({
@ -250,7 +251,9 @@ $(document).ready(function(){
}
});
})();
{/literal}{/if}{literal}
{/literal}{if !$DISABLED_API}{literal}
// Worker process to update user account balances
// Our worker process to keep worker information updated
(function worker3() {
@ -265,7 +268,8 @@ $(document).ready(function(){
}
});
})();
{/literal}{/if}{literal}
// Mute Button
$('#muteButton').click(function(){
if(muteFlag == 2) {
@ -280,8 +284,6 @@ $(document).ready(function(){
$(this).find($(".fa")).removeClass('fa-volume-up').addClass('fa-volume-off');
}
});
});
{/literal}
</script>