diff --git a/include/autoloader.inc.php b/include/autoloader.inc.php index f04988c2..4d14e17e 100644 --- a/include/autoloader.inc.php +++ b/include/autoloader.inc.php @@ -17,6 +17,7 @@ require_once(INCLUDE_DIR . '/config/error_codes.inc.php'); require_once(CLASS_DIR . '/base.class.php'); require_once(CLASS_DIR . '/coins/coin_base.class.php'); require_once(CLASS_DIR . '/setting.class.php'); +require_once(INCLUDE_DIR . '/version.inc.php'); if (PHP_OS == 'WINNT') require_once(CLASS_DIR . '/memcached.class.php'); // Now decide on which coin class to load and instantiate diff --git a/include/classes/worker.class.php b/include/classes/worker.class.php index 570dcd32..f47445ae 100644 --- a/include/classes/worker.class.php +++ b/include/classes/worker.class.php @@ -141,6 +141,7 @@ class Worker extends Base { FROM $this->table AS w WHERE account_id = ?"); if ($this->checkStmt($stmt) && $stmt->bind_param('iiiii', $interval, $interval, $interval, $interval, $account_id) && $stmt->execute() && $result = $stmt->get_result()) { + $aData = array(); while ($row = $result->fetch_assoc()) { $row['hashrate'] = round($this->coin->calcHashrate($row['shares'], $interval), 2); if ($row['count_all'] > 0) { diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index 9ed22091..b5839ef7 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -364,20 +364,6 @@ $aSettings['system'][] = array( 'name' => 'disable_dashboard_api', 'value' => $setting->getValue('disable_dashboard_api'), 'tooltip' => 'Disable dashboard API entirely to reduce server load.' ); -$aSettings['system'][] = array( - 'display' => 'Disable Live Navbar', 'type' => 'select', - 'options' => array( 0 => 'No', 1 => 'Yes'), - 'default' => 0, - 'name' => 'disable_navbar', 'value' => $setting->getValue('disable_navbar'), - 'tooltip' => 'Disable live updates on the navbar to reduce server load.' -); -$aSettings['system'][] = array( - 'display' => 'Disable Navbar API', 'type' => 'select', - 'options' => array( 0 => 'No', 1 => 'Yes'), - 'default' => 0, - 'name' => 'disable_navbar_api', 'value' => $setting->getValue('disable_navbar_api'), - 'tooltip' => 'Disable navbar API entirely to reduce server load. Used in pool stats and navbar mini stats.' -); $aSettings['system'][] = array( 'display' => 'Disable TX Summaries', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), diff --git a/include/pages/api/getnavbardata.inc.php b/include/pages/api/getnavbardata.inc.php deleted file mode 100644 index 24ab357e..00000000 --- a/include/pages/api/getnavbardata.inc.php +++ /dev/null @@ -1,76 +0,0 @@ -getValue('disable_navbar_api')) { - echo $api->get_json(array('error' => 'disabled')); - die(); -} - -// System load check -if ($load = @sys_getloadavg()) { - if (isset($config['system']['load']['max']) && $load[0] > $config['system']['load']['max']) { - header('HTTP/1.1 503 Too busy, try again later'); - die('Server too busy. Please try again later.'); - } -} - -// Fetch RPC information -if ($bitcoin->can_connect() === true) { - $dNetworkHashrate = $bitcoin->getnetworkhashps(); - $dDifficulty = $bitcoin->getdifficulty(); - $iBlock = $bitcoin->getblockcount(); -} else { - $dNetworkHashrate = 0; - $dDifficulty = 1; - $iBlock = 0; -} - -// Some settings -if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; -if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_modifier') ) $dPoolHashrateModifier = 1; -if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1; - -// Fetch raw data -$statistics->setGetCache(false); -$dPoolHashrate = $statistics->getCurrentHashrate($interval); -if ($dPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $dPoolHashrate; -$statistics->setGetCache(true); - -// Small helper -$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ); - -// Apply pool modifiers -$dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier; -$dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier; - -// Use caches for this one -$aRoundShares = $statistics->getRoundShares(); - -$iTotalRoundShares = $aRoundShares['valid'] + $aRoundShares['invalid']; -if ($iTotalRoundShares > 0) { - $dPoolInvalidPercent = round($aRoundShares['invalid'] / $iTotalRoundShares * 100, 2); -} else { - $dUserInvalidPercent = 0; - $dPoolInvalidPercent = 0; -} - -// Round progress -$iEstShares = $statistics->getEstimatedShares($dDifficulty); -if ($iEstShares > 0 && $aRoundShares['valid'] > 0) { - $dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2); -} else { - $dEstPercent = 0; -} - -// Output JSON format -$data = array( - 'raw' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'pool' => array( 'hashrate' => $dPoolHashrate ) ), - 'pool' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted, 'estimated' => $iEstShares, 'progress' => $dEstPercent ), - 'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ) -); -echo $api->get_json($data); - -// Supress master template -$supress_master = 1; -?> diff --git a/public/include/classes/coins/coin_scryptn.class.php b/public/include/classes/coins/coin_scryptn.class.php new file mode 100644 index 00000000..db588f61 --- /dev/null +++ b/public/include/classes/coins/coin_scryptn.class.php @@ -0,0 +1,16 @@ + diff --git a/public/include/classes/coins/coin_x11.class.php b/public/include/classes/coins/coin_x11.class.php new file mode 100644 index 00000000..6e356be3 --- /dev/null +++ b/public/include/classes/coins/coin_x11.class.php @@ -0,0 +1,13 @@ + diff --git a/public/index.php b/public/index.php index f557f5e6..d169fff9 100644 --- a/public/index.php +++ b/public/index.php @@ -101,7 +101,6 @@ if (count(@$_SESSION['last_ip_pop']) == 2) { // version check and config check if not disabled if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA']['id'])) { - require_once(INCLUDE_DIR . '/version.inc.php'); if (!@$config['skip_config_tests']) { require_once(INCLUDE_DIR . '/admin_checks.php'); } diff --git a/templates/bootstrap/account/edit/detail.tpl b/templates/bootstrap/account/edit/detail.tpl index 9b40dc67..582deb94 100644 --- a/templates/bootstrap/account/edit/detail.tpl +++ b/templates/bootstrap/account/edit/detail.tpl @@ -33,14 +33,14 @@