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
|
// Fetch unconfirmed amount from blocks table
|
||||||
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
||||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
if ($config['getbalancewithunconfirmed']) {
|
||||||
$dBlocksUnconfirmedBalance = 0;
|
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||||
|
$dBlocksUnconfirmedBalance = 0;
|
||||||
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
||||||
|
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
}
|
||||||
|
|
||||||
// Fetch Newmint
|
// Fetch Newmint
|
||||||
$aGetInfo = $bitcoin->getinfo();
|
$aGetInfo = $bitcoin->getinfo();
|
||||||
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
|
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
|
||||||
@ -133,12 +133,12 @@ if (!$dWalletBalance = $bitcoin->getrealbalance())
|
|||||||
|
|
||||||
// Fetch unconfirmed amount from blocks table
|
// Fetch unconfirmed amount from blocks table
|
||||||
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations'];
|
||||||
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
if ($config['getbalancewithunconfirmed']) {
|
||||||
$dBlocksUnconfirmedBalance = 0;
|
$aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations);
|
||||||
|
$dBlocksUnconfirmedBalance = 0;
|
||||||
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
if (!empty($aBlocksUnconfirmed))foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount'];
|
||||||
|
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
||||||
$dWalletBalance -= $dBlocksUnconfirmedBalance;
|
}
|
||||||
|
|
||||||
// Fetch Newmint
|
// Fetch Newmint
|
||||||
$aGetInfo = $bitcoin->getinfo();
|
$aGetInfo = $bitcoin->getinfo();
|
||||||
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
|
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>";
|
$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)
|
// 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.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 - '.$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
|
// 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');
|
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
|
// 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
|
* 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 checkclient bool check HTTP_CLIENT_IP for a valid ip first
|
||||||
* @param checkforwarded bool check HTTP_X_FORWARDED_FOR for a valid ip first
|
* @param checkforwarded bool check HTTP_X_FORWARDED_FOR for a valid ip first
|
||||||
* @return string IP address
|
* @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;
|
$client = (isset($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : false;
|
||||||
$fwd = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : 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'];
|
$remote = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : @$_SERVER['REMOTE_ADDR'];
|
||||||
// shared internet
|
// 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;
|
return $client;
|
||||||
} else if (strpos($fwd, ',') !== false && !$trustremote && $checkforwarded) {
|
} else if (!$trustremote && $checkforwarded && strpos($fwd, ',') !== false) {
|
||||||
// multiple proxies
|
// multiple proxies
|
||||||
$ips = explode(',', $fwd);
|
$ips = explode(',', $fwd);
|
||||||
return $ips[0];
|
return $ips[0];
|
||||||
} else if (filter_var($fwd, FILTER_VALIDATE_IP) && !$trustremote && $checkforwarded) {
|
} else if (!$trustremote && $checkforwarded && filter_var($fwd, FILTER_VALIDATE_IP)) {
|
||||||
// single
|
// single
|
||||||
return $fwd;
|
return $fwd;
|
||||||
} else {
|
} 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['E0031'] = 'Failed to send e-mail via mail() function';
|
||||||
$aErrorCodes['E0032'] = 'Failed to run API call: %s';
|
$aErrorCodes['E0032'] = 'Failed to run API call: %s';
|
||||||
$aErrorCodes['E0033'] = 'Failed to store uptime status: %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['E0035'] = 'Failed to add news record';
|
||||||
$aErrorCodes['E0036'] = 'Failed to delete news record';
|
$aErrorCodes['E0036'] = 'Failed to delete news record';
|
||||||
$aErrorCodes['E0037'] = 'Failed to update news record';
|
$aErrorCodes['E0037'] = 'Failed to update news record';
|
||||||
|
|||||||
@ -29,6 +29,13 @@ $config['SALTY'] = 'THISSHOULDALSOBERRAANNDDOOM';
|
|||||||
**/
|
**/
|
||||||
$config['algorithm'] = 'scrypt';
|
$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
|
* Database configuration
|
||||||
* MySQL 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
|
// Time in seconds, not hours, using modifier in smarty to translate
|
||||||
$iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0;
|
$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
|
// Time since last
|
||||||
$now = new DateTime( "now" );
|
$now = new DateTime( "now" );
|
||||||
|
|||||||
@ -77,6 +77,7 @@ $aGlobal = array(
|
|||||||
'disable_contactform' => $setting->getValue('disable_contactform'),
|
'disable_contactform' => $setting->getValue('disable_contactform'),
|
||||||
'disable_contactform_guest' => $setting->getValue('disable_contactform_guest'),
|
'disable_contactform_guest' => $setting->getValue('disable_contactform_guest'),
|
||||||
'algorithm' => $config['algorithm'],
|
'algorithm' => $config['algorithm'],
|
||||||
|
'getbalancewithunconfirmed' => $config['getbalancewithunconfirmed'],
|
||||||
'target_bits' => $coin->getTargetBits(),
|
'target_bits' => $coin->getTargetBits(),
|
||||||
'accounts' => $config['accounts'],
|
'accounts' => $config['accounts'],
|
||||||
'disable_invitations' => $setting->getValue('disable_invitations'),
|
'disable_invitations' => $setting->getValue('disable_invitations'),
|
||||||
|
|||||||
@ -20,7 +20,11 @@
|
|||||||
{if $NEWMINT >= 0}
|
{if $NEWMINT >= 0}
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">Liquid Assets</td>
|
<td align="left">Liquid Assets</td>
|
||||||
|
{if $GLOBAL.config.getbalancewithunconfirmed}
|
||||||
<td align="left">{($BALANCE - $LOCKED - $UNCONFIRMED + $NEWMINT|default:"0")|number_format:"8"}</td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">PoS New Mint</td>
|
<td align="left">PoS New Mint</td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user