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('BLOCKSFOUND', $aLastBlocks);
$smarty->assign('DISABLED_DASHBOARD', $setting->getValue('disable_dashboard')); $smarty->assign('DISABLED_DASHBOARD', $setting->getValue('disable_dashboard'));
$smarty->assign('DISABLED_DASHBOARD_API', $setting->getValue('disable_dashboard_api')); $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('ESTIMATES', array('shares' => $iEstShares, 'percent' => $dEstPercent));
$smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock, 'EstNextDifficulty' => $dEstNextDifficulty, 'EstTimePerBlock' => $dExpectedTimePerBlock, 'BlocksUntilDiffChange' => $iBlocksUntilDiffChange)); $smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock, 'EstNextDifficulty' => $dEstNextDifficulty, 'EstTimePerBlock' => $dExpectedTimePerBlock, 'BlocksUntilDiffChange' => $iBlocksUntilDiffChange));
$smarty->assign('INTERVAL', $interval / 60); $smarty->assign('INTERVAL', $interval / 60);

View File

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

View File

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