diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index d7712942..257d33d4 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -7,16 +7,19 @@ if (!defined('SECURITY')) // Globally available variables $debug->append('Global smarty variables', 3); +// Only run these if the user is logged in +if ($_SESSION['AUTHENTICATED']) { + $aRoundShares = $statistics->getRoundShares(); + if ($bitcoin->can_connect() === true){ + $dDifficulty = $bitcoin->query('getdifficulty'); + } else { + $dDifficulty = 1; + } +} // Fetch some data -$aRoundShares = $statistics->getRoundShares(); $iCurrentActiveWorkers = $worker->getCountAllActiveWorkers(); $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); $iCurrentPoolShareRate = $statistics->getCurrentShareRate(); -if ($bitcoin->can_connect() === true){ - $dDifficulty = $bitcoin->query('getdifficulty'); -} else { - $dDifficulty = 1; -} // Global data for Smarty $aGlobal = array(