Merge branch 'development' into bootstrap
This commit is contained in:
commit
b6aa1cbc66
@ -46,12 +46,12 @@ if (!$dWalletBalance = $bitcoin->getrealbalance())
|
||||
|
||||
// Fetch unconfirmed amount from blocks table
|
||||
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||
$dBlocksUnconfirmedBalance = 0;
|
||||
if ($config['getbalancewithunconfirmed']) {
|
||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||
$dBlocksUnconfirmedBalance = 0;
|
||||
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
||||
|
||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||
|
||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||
}
|
||||
// Fetch Newmint
|
||||
$aGetInfo = $bitcoin->getinfo();
|
||||
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
|
||||
@ -133,12 +133,12 @@ if (!$dWalletBalance = $bitcoin->getrealbalance())
|
||||
|
||||
// Fetch unconfirmed amount from blocks table
|
||||
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||
$dBlocksUnconfirmedBalance = 0;
|
||||
if ($config['getbalancewithunconfirmed']) {
|
||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||
$dBlocksUnconfirmedBalance = 0;
|
||||
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
||||
|
||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||
|
||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||
}
|
||||
// Fetch Newmint
|
||||
$aGetInfo = $bitcoin->getinfo();
|
||||
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
|
||||
|
||||
@ -11,11 +11,11 @@ define('THEME_DIR', BASEPATH . 'templates');
|
||||
$quickstartlink = "<a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide' title='MPOS Quick Start Guide'>Quick Start Guide</a>";
|
||||
|
||||
// Include our configuration (holding defines for the requires)
|
||||
if (!include_once(BASEPATH . 'include/config/global.inc.dist.php')) die('Unable to load base global config - '.$quickstartlink);
|
||||
if (!@include_once(BASEPATH . 'include/config/global.inc.php')) die('Unable to load your global config - '.$quickstartlink);
|
||||
if (!include_once(BASEPATH . 'include/config/global.inc.dist.php')) die('Unable to load base global config from ['.BASEPATH . 'include/config/global.inc.dist.php' . '] - '.$quickstartlink);
|
||||
if (!@include_once(BASEPATH . 'include/config/global.inc.php')) die('Unable to load your global config from ['.BASEPATH . 'include/config/global.inc.php' . '] - '.$quickstartlink);
|
||||
|
||||
// load our security configs
|
||||
if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unable to load base security config - '.$quickstartlink);
|
||||
if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unable to load base security config from ['.BASEPATH . 'include/config/security.inc.dist.php' . '] - '.$quickstartlink);
|
||||
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php');
|
||||
|
||||
// start our session, we need it for smarty caching
|
||||
|
||||
@ -923,23 +923,28 @@ public function isAuthenticated($logout=true) {
|
||||
|
||||
/**
|
||||
* Convenience function to get IP address, no params is the same as REMOTE_ADDR
|
||||
* @param trustremote bool must be FALSE to checkclient or checkforwarded
|
||||
* @param trustremote bool must be FALSE to checkcloudflare, checkclient or checkforwarded
|
||||
* @param checkcloudflare bool check HTTP_CF_CONNECTING_IP for a valid ip first
|
||||
* @param checkclient bool check HTTP_CLIENT_IP for a valid ip first
|
||||
* @param checkforwarded bool check HTTP_X_FORWARDED_FOR for a valid ip first
|
||||
* @return string IP address
|
||||
*/
|
||||
public function getCurrentIP($trustremote=false, $checkclient=false, $checkforwarded=true) {
|
||||
public function getCurrentIP($trustremote=false, $checkcloudflare=true, $checkclient=false, $checkforwarded=true) {
|
||||
$cf = (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : false;
|
||||
$client = (isset($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : false;
|
||||
$fwd = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : false;
|
||||
$remote = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : @$_SERVER['REMOTE_ADDR'];
|
||||
// shared internet
|
||||
if (filter_var($client, FILTER_VALIDATE_IP) && !$trustremote && $checkclient) {
|
||||
if (!$trustremote && $checkcloudflare && filter_var($cf, FILTER_VALIDATE_IP)) {
|
||||
// cloudflare
|
||||
return $cf;
|
||||
} else if (!$trustremote && $checkclient && filter_var($client, FILTER_VALIDATE_IP)) {
|
||||
return $client;
|
||||
} else if (strpos($fwd, ',') !== false && !$trustremote && $checkforwarded) {
|
||||
} else if (!$trustremote && $checkforwarded && strpos($fwd, ',') !== false) {
|
||||
// multiple proxies
|
||||
$ips = explode(',', $fwd);
|
||||
return $ips[0];
|
||||
} else if (filter_var($fwd, FILTER_VALIDATE_IP) && !$trustremote && $checkforwarded) {
|
||||
} else if (!$trustremote && $checkforwarded && filter_var($fwd, FILTER_VALIDATE_IP)) {
|
||||
// single
|
||||
return $fwd;
|
||||
} else {
|
||||
|
||||
@ -35,7 +35,7 @@ $aErrorCodes['E0030'] = 'Unable to fetch a valid token for this invitation';
|
||||
$aErrorCodes['E0031'] = 'Failed to send e-mail via mail() function';
|
||||
$aErrorCodes['E0032'] = 'Failed to run API call: %s';
|
||||
$aErrorCodes['E0033'] = 'Failed to store uptime status: %s';
|
||||
$aErrorCodes['E0034'] = 'Subjcet may only contain alphanumeric characters';
|
||||
$aErrorCodes['E0034'] = 'Subject may only contain alphanumeric characters';
|
||||
$aErrorCodes['E0035'] = 'Failed to add news record';
|
||||
$aErrorCodes['E0036'] = 'Failed to delete news record';
|
||||
$aErrorCodes['E0037'] = 'Failed to update news record';
|
||||
|
||||
@ -29,6 +29,13 @@ $config['SALTY'] = 'THISSHOULDALSOBERRAANNDDOOM';
|
||||
**/
|
||||
$config['algorithm'] = 'scrypt';
|
||||
|
||||
/**
|
||||
* Getbalance API Calls
|
||||
* System used for getting actual Balance from Wallet
|
||||
* https://github.com/MPOS/php-mpos/wiki/Config-Setup#getbalance-api-calls
|
||||
**/
|
||||
$config['getbalancewithunconfirmed'] = true;
|
||||
|
||||
/**
|
||||
* Database configuration
|
||||
* MySQL database configuration
|
||||
|
||||
@ -33,7 +33,7 @@ if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPool
|
||||
|
||||
// Time in seconds, not hours, using modifier in smarty to translate
|
||||
$iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0;
|
||||
$iEstShares = (pow(2, 32 - $config['difficulty']) * $dDifficulty);
|
||||
$iEstShares = $statistics->getEstimatedShares($dDifficulty);
|
||||
|
||||
// Time since last
|
||||
$now = new DateTime( "now" );
|
||||
|
||||
@ -77,6 +77,7 @@ $aGlobal = array(
|
||||
'disable_contactform' => $setting->getValue('disable_contactform'),
|
||||
'disable_contactform_guest' => $setting->getValue('disable_contactform_guest'),
|
||||
'algorithm' => $config['algorithm'],
|
||||
'getbalancewithunconfirmed' => $config['getbalancewithunconfirmed'],
|
||||
'target_bits' => $coin->getTargetBits(),
|
||||
'accounts' => $config['accounts'],
|
||||
'disable_invitations' => $setting->getValue('disable_invitations'),
|
||||
|
||||
@ -20,7 +20,11 @@
|
||||
{if $NEWMINT >= 0}
|
||||
<tr>
|
||||
<td align="left">Liquid Assets</td>
|
||||
{if $GLOBAL.config.getbalancewithunconfirmed}
|
||||
<td align="left">{($BALANCE - $LOCKED - $UNCONFIRMED + $NEWMINT|default:"0")|number_format:"8"}</td>
|
||||
{else}
|
||||
<td align="left">{($BALANCE - $LOCKED + $NEWMINT|default:"0")|number_format:"8"}</td>
|
||||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">PoS New Mint</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user