Only run some globals for smarty if loggedin
* Do not check for round shares if user is not logged in * Will prevent a long page load for new users trying to register * Only needed on statistics page that is not available to guests
This commit is contained in:
parent
8c31480711
commit
88b9d95ff2
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user