diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index 46ab5cb5..6f56453b 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -311,6 +311,7 @@ class Statistics { GROUP BY HOUR(time) "); if ($this->checkStmt($stmt) && $stmt->bind_param("i", $account_id) && $stmt->execute() && $result = $stmt->get_result()) { + $aData = array(); while ($row = $result->fetch_assoc()) { $aData[$row['hour']] = $row['hashrate']; } diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 20ff072d..49de7b5f 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -552,7 +552,7 @@ class User { **/ public function isAuthenticated() { $this->debug->append("STA " . __METHOD__, 4); - if ($_SESSION['AUTHENTICATED'] == true && ! $this->isLocked($_SESSION['USERDATA']['id']) && $this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR']) + if (@$_SESSION['AUTHENTICATED'] == true && ! $this->isLocked($_SESSION['USERDATA']['id']) && $this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR']) return true; // Catchall $this->logoutUser(); diff --git a/public/include/pages/account/edit.inc.php b/public/include/pages/account/edit.inc.php index a4859c8f..92b8f1e1 100644 --- a/public/include/pages/account/edit.inc.php +++ b/public/include/pages/account/edit.inc.php @@ -5,10 +5,10 @@ if (!defined('SECURITY')) die('Hacking attempt'); if ($user->isAuthenticated()) { - if ( ! $user->checkPin($_SESSION['USERDATA']['id'], $_POST['authPin']) && $_POST['do']) { + if ( ! $user->checkPin($_SESSION['USERDATA']['id'], @$_POST['authPin']) && @$_POST['do']) { $_SESSION['POPUP'][] = array('CONTENT' => 'Invalid PIN','TYPE' => 'errormsg'); } else { - switch ($_POST['do']) { + switch (@$_POST['do']) { case 'cashOut': if ($setting->getValue('manual_payout_active') == 1) { $_SESSION['POPUP'][] = array('CONTENT' => 'A manual payout is in progress. Please try again later.', 'TYPE' => 'errormsg'); diff --git a/public/include/pages/account/notifications.inc.php b/public/include/pages/account/notifications.inc.php index 87fd6217..3f013ed0 100644 --- a/public/include/pages/account/notifications.inc.php +++ b/public/include/pages/account/notifications.inc.php @@ -3,7 +3,7 @@ // Make sure we are called from index.php if (!defined('SECURITY')) die('Hacking attempt'); if ($user->isAuthenticated()) { - if ($_REQUEST['do'] == 'save') { + if (@$_REQUEST['do'] == 'save') { if ($notification->updateSettings($_SESSION['USERDATA']['id'], $_REQUEST['data'])) { $_SESSION['POPUP'][] = array('CONTENT' => 'Updated notification settings'); } else { diff --git a/public/include/pages/account/workers.inc.php b/public/include/pages/account/workers.inc.php index 78556424..ccdae2b8 100644 --- a/public/include/pages/account/workers.inc.php +++ b/public/include/pages/account/workers.inc.php @@ -4,7 +4,7 @@ if (!defined('SECURITY')) die('Hacking attempt'); if ($user->isAuthenticated()) { - switch ($_REQUEST['do']) { + switch (@$_REQUEST['do']) { case 'delete': if ($worker->deleteWorker($_SESSION['USERDATA']['id'], $_GET['id'])) { $_SESSION['POPUP'][] = array('CONTENT' => 'Worker removed'); @@ -31,7 +31,9 @@ if ($user->isAuthenticated()) { $aWorkers = $worker->getWorkers($_SESSION['USERDATA']['id']); if (!$aWorkers) $_SESSION['POPUP'][] = array('CONTENT' => 'You have no workers configured', 'TYPE' => 'errormsg'); - $smarty->assign('CONTENT', 'default.tpl'); $smarty->assign('WORKERS', $aWorkers); } + +$smarty->assign('CONTENT', 'default.tpl'); + ?> diff --git a/public/include/pages/admin/user.inc.php b/public/include/pages/admin/user.inc.php index 11808edb..9bb9ecee 100644 --- a/public/include/pages/admin/user.inc.php +++ b/public/include/pages/admin/user.inc.php @@ -12,18 +12,18 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) { $aRoundShares = $statistics->getRoundShares(); // Change account lock -if ($_POST['do'] == 'lock') { +if (@$_POST['do'] == 'lock') { $supress_master = 1; $user->changeLocked($_POST['account_id']); } // Change account admin -if ($_POST['do'] == 'admin') { +if (@$_POST['do'] == 'admin') { $supress_master = 1; $user->changeAdmin($_POST['account_id']); } -if ($_POST['query']) { +if (@$_POST['query']) { // Fetch requested users $aUsers = $statistics->getAllUserStats($_POST['query']); @@ -40,10 +40,10 @@ if ($_POST['query']) { $aUser['payout']['est_payout'] = round($aUser['payout']['est_block'] - $aUser['payout']['est_donation'] - $aUser['payout']['est_fee'], 3); $aUsers[$iKey] = $aUser; } + // Assign our variables + $smarty->assign("USERS", $aUsers); } -// Assign our variables -$smarty->assign("USERS", $aUsers); // Tempalte specifics $smarty->assign("CONTENT", "default.tpl"); diff --git a/public/include/pages/statistics/graphs.inc.php b/public/include/pages/statistics/graphs.inc.php index cf62bddf..f7016835 100644 --- a/public/include/pages/statistics/graphs.inc.php +++ b/public/include/pages/statistics/graphs.inc.php @@ -7,9 +7,10 @@ if (!defined('SECURITY')) if ($user->isAuthenticated()) { $aHourlyHashRates = $statistics->getHourlyHashrateByAccount($_SESSION['USERDATA']['id']); $aPoolHourlyHashRates = $statistics->getHourlyHashrateByPool(); - // Propagate content our template - $smarty->assign("YOURHASHRATES", $aHourlyHashRates); - $smarty->assign("POOLHASHRATES", $aPoolHourlyHashRates); - $smarty->assign("CONTENT", "default.tpl"); } + +// Propagate content our template +$smarty->assign("YOURHASHRATES", @$aHourlyHashRates); +$smarty->assign("POOLHASHRATES", @$aPoolHourlyHashRates); +$smarty->assign("CONTENT", "default.tpl"); ?> diff --git a/public/include/pages/statistics/pool.inc.php b/public/include/pages/statistics/pool.inc.php index fc546e72..9650681e 100644 --- a/public/include/pages/statistics/pool.inc.php +++ b/public/include/pages/statistics/pool.inc.php @@ -27,6 +27,8 @@ $aBlockData = $aBlocksFoundData[0]; // Estimated time to find the next block $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); +$iCurrentPoolHashrate == 0 ? $iCurrentPoolHashrate = 1 : true; + // Time in seconds, not hours, using modifier in smarty to translate $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000); diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 5c4bde10..c8231a49 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -9,9 +9,10 @@ $debug->append('Global smarty variables', 3); // Defaults to get rid of PHP Notice warnings $dDifficulty = 1; +$aRoundShares = 1; // Only run these if the user is logged in -if ($_SESSION['AUTHENTICATED']) { +if (@$_SESSION['AUTHENTICATED']) { $aRoundShares = $statistics->getRoundShares(); if ($bitcoin->can_connect() === true) $dDifficulty = $bitcoin->query('getdifficulty'); diff --git a/public/templates/mmcFE/account/edit/default.tpl b/public/templates/mmcFE/account/edit/default.tpl index f48ef67f..69861d61 100644 --- a/public/templates/mmcFE/account/edit/default.tpl +++ b/public/templates/mmcFE/account/edit/default.tpl @@ -23,7 +23,7 @@ - +
Account Balance:    {$GLOBAL.userdata.balance.confirmed|escape} {$GLOABL.config.currency}
Account Balance:    {$GLOBAL.userdata.balance.confirmed|escape} {$GLOBAL.config.currency}
Payout to:
{$GLOBAL.userdata.coin_address|escape}
4 digit PIN:
diff --git a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl index 9086427a..2392af09 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl @@ -28,7 +28,7 @@ n/a {$GLOBAL.userdata.username} {$GLOBAL.userdata.hashrate} - {$estday|number_format:"3"} + {$estday|number_format:"3"|default:"n/a"} {($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"} {/if}