Skip to content

Commit b7b45eb

Browse files
committed
Merge pull request #2458 from MPOS/development
UPDATE : Development to Master
2 parents 53533e4 + 21dbe36 commit b7b45eb

File tree

15 files changed

+96
-22
lines changed

15 files changed

+96
-22
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
1.0.5 (XXX XXth XXXX)
2+
---------------------
3+
4+
* Fixed worker name scaling issues on mobile devices (Thanks @nrpatten)
5+
* Fixed user information table formatting (Thanks @pokari1986)
6+
* Fixed empty auto-payout threshold value for accounts page
7+
* Removed config disable check popup for admins on all pages
8+
* Added blockchain download status for admin feedback (admin setup check)
9+
* Added peer state to wallet info state if no peers are connected
10+
111
1.0.4 (Jun 19th 2015)
212
---------------------
13+
314
* Honor anonymous attribute when sending block finder mails
415
* Display admin warning if no transfer fees are set
516
* Moved admin_checks.php into the admin panel/system/setup

include/classes/bitcoinwrapper.class.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ public function getestimatedtime($iCurrentPoolHashrate) {
6666
$dDifficulty = $this->getdifficulty();
6767
return $this->memcache->setCache(__FUNCTION__, $dDifficulty * pow(2,32) / $iCurrentPoolHashrate, 30);
6868
}
69+
public function getblockchaindownload() {
70+
$aPeerInfo = $this->getpeerinfo();
71+
$aInfo = $this->getinfo();
72+
$iStartingHeight = 0;
73+
foreach ($aPeerInfo as $aPeerData) {
74+
if ($iStartingHeight < $aPeerData['startingheight']) $iStartingHeight = $aPeerData['startingheight'];
75+
}
76+
if ($iStartingHeight > $aInfo['blocks']) {
77+
return number_format(round($aInfo['blocks'] / $iStartingHeight * 100, 2), 2);
78+
} else {
79+
return false;
80+
}
81+
}
6982
public function getnetworkhashps() {
7083
$this->oDebug->append("STA " . __METHOD__, 4);
7184
if ($data = $this->memcache->get(__FUNCTION__)) return $data;

include/classes/tools.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ private function getApiType($url) {
8383
return 'cryptorush';
8484
} else if (preg_match('/mintpal.com/', $url)) {
8585
return 'mintpal';
86+
} else if (preg_match('/c-cex.com/', $url)) {
87+
return 'c-cex';
8688
} else if (preg_match('/bittrex.com/', $url)) {
8789
return 'bittrex';
8890
}
@@ -123,7 +125,10 @@ public function getPrice() {
123125
case 'mintpal':
124126
return @$aData['0']['last_price'];
125127
break;
126-
case 'bittrex':
128+
case 'c-cex':
129+
return @$aData['ticker']['lastprice'];
130+
break;
131+
case 'bittrex':
127132
return @$aData['result']['Last'];
128133
break;
129134
}

include/classes/user.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function getTopInviters($limit=10,$start=0) {
189189
return $result->fetch_all(MYSQLI_ASSOC);
190190
}
191191
}
192-
192+
193193
/**
194194
* Check user login
195195
* @param username string Username
@@ -718,7 +718,8 @@ public function getUserData($userID) {
718718
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $userID) && $stmt->execute() && $result = $stmt->get_result()) {
719719
$aData = $result->fetch_assoc();
720720
$aData['coin_address'] = $this->coin_address->getCoinAddress($userID);
721-
$aData['ap_threshold'] = $this->coin_address->getAPThreshold($userID);
721+
if (! $aData['ap_threshold'] = $this->coin_address->getAPThreshold($userID))
722+
$aData['ap_threshold'] = 0;
722723
$stmt->close();
723724
return $aData;
724725
}

include/pages/admin/checks/check_daemon.inc.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc";
1414
$error[] = $newerror;
1515
$newerror = null;
16-
}
17-
else {
16+
} else {
1817
// validate that the wallet service is not in test mode
1918
if ($bitcoin->is_testnet() == true) {
2019
$newerror = array();
@@ -27,6 +26,18 @@
2726
$error[] = $newerror;
2827
$newerror = null;
2928
}
29+
// Check if chain is currently downloading
30+
if ($dDownloadPercentage = $bitcoin->getblockchaindownload()) {
31+
$newerror = array();
32+
$newerror['name'] = "Coin daemon";
33+
$newerror['level'] = 1;
34+
$newerror['extdesc'] = "Your coin daemon is currently downloading the blockchain. Your miners won't be able to connect until this is completed.";
35+
$newerror['description'] = "Blockchain download progress is at an estimated $dDownloadPercentage%. It may take a while to complete.";
36+
$newerror['configvalue'] = "wallet.host";
37+
$newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc";
38+
$error[] = $newerror;
39+
$newerror = null;
40+
}
3041
// check if there is more than one account set on wallet
3142
$accounts = $bitcoin->listaccounts();
3243
if (count($accounts) > 1 && $accounts[''] <= 0) {

include/pages/admin/wallet.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
$aGetInfo = $bitcoin->getinfo();
2525
$aGetPeerInfo = $bitcoin->getpeerinfo();
26+
if ($aGetInfo['connections'] == 0) $aGetInfo['errors'] = 'No peers';
27+
# Check if daemon is downloading the blockchain, estimated
28+
if ($dDownloadPercentage = $bitcoin->getblockchaindownload()) $aGetInfo['errors'] = "Downloading: $dDownloadPercentage%";
2629
$aGetTransactions = $bitcoin->listtransactions('', (int)$setting->getValue('wallet_transaction_limit', 25));
2730
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
2831
$dNewmint = $aGetInfo['newmint'];

include/smarty_globals.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
// Lets check for our cron status and render a message
228228
require_once(INCLUDE_DIR . '/config/monitor_crons.inc.php');
229229
$bMessage = false;
230-
$aCronMessage[] = 'We are investingating issues in the backend. Your shares and hashrate are safe and we will fix things ASAP.</br><br/>';
230+
$aCronMessage[] = 'We are investigating issues in the backend. Your shares and hashrate are safe and we will fix things ASAP.</br><br/>';
231231
foreach ($aMonitorCrons as $strCron) {
232232
if ($monitoring->isDisabled($strCron) == 1) {
233233
$bMessage = true;

include/version.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
33

4-
define('MPOS_VERSION', '1.0.4');
4+
define('MPOS_VERSION', '1.0.5');
55
define('DB_VERSION', '1.0.1');
66
define('CONFIG_VERSION', '1.0.1');
77
define('HASH_VERSION', 1);

public/index.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ function cfip() { return (@defined('SECURITY')) ? 1 : 0; }
9999
}
100100
}
101101

102-
// version check and config check if not disabled
103-
if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA']['id'])) {
104-
if (!@$config['skip_config_tests'] && @$_GET['action'] != 'setup') {
105-
$_SESSION['POPUP'][] = array('CONTENT' => "You haven't turned off config checks, visit the <b><a href='?page=admin&action=setup'>setup page</a></b> for further information.", 'DISMISS' => 'yes', 'ID' => 'lastlogin', 'TYPE' => 'alert alert-info');
106-
}
107-
}
108-
109102
// Create our pages array from existing files
110103
if (is_dir(INCLUDE_DIR . '/pages/')) {
111104
foreach (glob(INCLUDE_DIR . '/pages/*.inc.php') as $filepath) {

public/site_assets/bootstrap/css/mpos.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ div.fade {
584584
.table > tbody > tr > td
585585
{
586586
padding:4px;
587+
vertical-align: middle;
587588
}
588589

589590
.panel > .table,
@@ -625,3 +626,37 @@ div.fade {
625626
}
626627

627628
/* End Footer */
629+
630+
/* EDIT */
631+
632+
.name {
633+
float: left;
634+
margin-bottom: 0;
635+
min-width: 100%;
636+
position: relative;
637+
width: auto;
638+
z-index: 2;
639+
transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
640+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
641+
display: block;
642+
border-bottom-right-radius: 4px;
643+
border-top-right-radius: 4px;
644+
margin-right: 25px;
645+
}
646+
647+
.name:focus {
648+
border-color: #66afe9;
649+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
650+
outline: 0 none;
651+
}
652+
653+
.navbar-right {
654+
float: right !important;
655+
margin-right: 0;
656+
}
657+
658+
.clear {
659+
padding: 0px;
660+
}
661+
662+
/* END EDIT */

0 commit comments

Comments
 (0)