fixing notice warning when not logged in

This commit is contained in:
Sebastian Grewe 2013-06-14 13:22:50 +02:00
parent d23d577368
commit 4c4202bc1b

View File

@ -7,15 +7,16 @@ if (!defined('SECURITY'))
// Globally available variables
$debug->append('Global smarty variables', 3);
// Defaults to get rid of PHP Notice warnings
$dDifficulty = 1;
// Only run these if the user is logged in
if ($_SESSION['AUTHENTICATED']) {
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true){
if ($bitcoin->can_connect() === true)
$dDifficulty = $bitcoin->query('getdifficulty');
} else {
$dDifficulty = 1;
}
}
// Fetch some data
$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers();
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();