Skip to content

Commit f58db4f

Browse files
committed
Merge pull request #2297 from MPOS/dashboard-global-api-disabled
[FIX] Disable API calls if not enabled
2 parents 638b2c3 + ffe99fa commit f58db4f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

include/pages/dashboard.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
$smarty->assign('BLOCKSFOUND', $aLastBlocks);
5353
$smarty->assign('DISABLED_DASHBOARD', $setting->getValue('disable_dashboard'));
5454
$smarty->assign('DISABLED_DASHBOARD_API', $setting->getValue('disable_dashboard_api'));
55+
$smarty->assign('DISABLED_API', $setting->getValue('disable_api'));
5556
$smarty->assign('ESTIMATES', array('shares' => $iEstShares, 'percent' => $dEstPercent));
5657
$smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock, 'EstNextDifficulty' => $dEstNextDifficulty, 'EstTimePerBlock' => $dExpectedTimePerBlock, 'BlocksUntilDiffChange' => $iBlocksUntilDiffChange));
5758
$smarty->assign('INTERVAL', $interval / 60);

templates/bootstrap/dashboard/default.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
{include file="dashboard/overview/default.tpl"}
1717
{include file="dashboard/round_statistics/$PAYOUT_SYSTEM/default.tpl"}
1818
{include file="dashboard/account_data/default.tpl"}
19+
{if !$DISABLED_API}
1920
{include file="dashboard/worker_information/default.tpl"}
21+
{/if}
2022
{include file="dashboard/blocks/default.tpl"}
2123
</div>
2224
</div>

templates/bootstrap/dashboard/js/api.tpl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ $(document).ready(function(){
178178
return;
179179
}
180180
if (blocks[0].height > lastBlock) {
181-
if(canCreateSoundJS) {
181+
if(canCreateSoundJS) {
182182
createjs.Sound.play('ding');
183183
}
184184
lastBlock = blocks[0].height;
@@ -234,6 +234,7 @@ $(document).ready(function(){
234234
});
235235
})();
236236
237+
{/literal}{if !$DISABLED_API}{literal}
237238
// Worker process to update active workers in the account details table
238239
(function worker2() {
239240
$.ajax({
@@ -250,7 +251,9 @@ $(document).ready(function(){
250251
}
251252
});
252253
})();
254+
{/literal}{/if}{literal}
253255
256+
{/literal}{if !$DISABLED_API}{literal}
254257
// Worker process to update user account balances
255258
// Our worker process to keep worker information updated
256259
(function worker3() {
@@ -265,7 +268,8 @@ $(document).ready(function(){
265268
}
266269
});
267270
})();
268-
271+
{/literal}{/if}{literal}
272+
269273
// Mute Button
270274
$('#muteButton').click(function(){
271275
if(muteFlag == 2) {
@@ -280,8 +284,6 @@ $(document).ready(function(){
280284
$(this).find($(".fa")).removeClass('fa-volume-up').addClass('fa-volume-off');
281285
}
282286
});
283-
284-
285287
});
286288
{/literal}
287289
</script>

0 commit comments

Comments
 (0)