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

Diff for: CHANGELOG.md

+11
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

Diff for: include/classes/bitcoinwrapper.class.php

+13
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;

Diff for: include/classes/tools.class.php

+6-1
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
}

Diff for: include/classes/user.class.php

+3-2
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
}

Diff for: include/pages/admin/checks/check_daemon.inc.php

+13-2
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) {

Diff for: include/pages/admin/wallet.inc.php

+3
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'];

Diff for: include/smarty_globals.inc.php

+1-1
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;

Diff for: include/version.inc.php

+1-1
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);

Diff for: public/index.php

-7
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) {

Diff for: public/site_assets/bootstrap/css/mpos.css

+35
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 */

Diff for: templates/bootstrap/account/workers/default.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
{assign var="username" value="."|escape|explode:$WORKERS[worker].username:2}
5555
<tr>
5656
<td>
57-
<div class="input-group input-group-sm">
57+
<div class="input-group input-group-sm clear">
5858
<span {if $WORKERS[worker].hashrate > 0}style="color: orange"{/if} class="input-group-addon">{$username.0|escape}.</span>
59-
<input type="text" name="data[{$WORKERS[worker].id}][username]" value="{$username.1|escape}" size="10" required class="form-control" />
59+
<input type="text" name="data[{$WORKERS[worker].id}][username]" value="{$username.1|escape}" size="10" required class="name" />
6060
</div>
6161
</td>
6262
<td><input class="form-control" type="text" name="data[{$WORKERS[worker].id}][password]" value="{$WORKERS[worker].password|escape}" size="10" required></td>

Diff for: templates/bootstrap/admin/setup/default.tpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<div class="panel panel-info">
44
<div class="panel-heading">
55
<i class="fa fa-question fa-fw"></i> Setup Checks<br />
6-
<i>To disable these checks, set skip_config_tests to true in global.inc.php</i>
76
</div>
87
<div class="panel-body">
98
{if $ERRORS|@count > 0}
@@ -30,6 +29,9 @@
3029
{/section}
3130
{/if}
3231
</div>
32+
<div class="panel-footer">
33+
<li>To disable these checks, set skip_config_tests to true in global.inc.php</li>
34+
</div>
3335
</div>
3436
</div>
3537
<!-- /.col-lg-12 -->

Diff for: templates/bootstrap/admin/user/default.tpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<th class="h6" style="padding-right:10px">Est. Donation</th>
9696
<th class="h6" style="padding-right:10px">Est. Payout</th>
9797
{else}
98-
<th class="h6" colspan="2" style="padding-right:10px">Est. 24 Hours</th>
98+
<th class="h6" style="padding-right:10px">Est. 24 Hours</th>
9999
{/if}
100100
<th class="h6" style="padding-right:10px">Balance</th>
101101
<th class="h6" style="padding-right:10px">Reg. Date</th>
@@ -118,7 +118,7 @@
118118
<td>{$USERS[user].estimates.donation|number_format:"8"}</td>
119119
<td>{$USERS[user].estimates.payout|number_format:"8"}</td>
120120
{else}
121-
<td colspan="2">{$USERS[user].estimates.hours24|number_format:"8"}</td>
121+
<td>{$USERS[user].estimates.hours24|number_format:"8"}</td>
122122
{/if}
123123
<td>{$USERS[user].balance|number_format:"8"}</td>
124124
<td>{$USERS[user].signup_timestamp|date_format:$GLOBAL.config.date}</td>
@@ -147,4 +147,4 @@
147147
</div>
148148
</div>
149149
</div>
150-
</div>
150+
</div>

Diff for: templates/bootstrap/global/navigation.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<li {if $smarty.get.page|default:"0" eq "admin"}class="active"{/if}>
2828
<a href="#"><i class="fa fa-wrench fa-fw"></i> Admin Panel<span class="fa arrow"></span></a>
2929
<ul class="nav nav-second-level">
30-
<li {if $smarty.get.action|default:"0" eq "dashboard" || $smarty.get.action|default:"0" eq "monitoring" || $smarty.get.action|default:"0" eq "settings"}class="active"{/if}>
30+
<li {if $smarty.get.action|default:"0" eq "dashboard" || $smarty.get.action|default:"0" eq "monitoring" || $smarty.get.action|default:"0" eq "settings" || $smarty.get.action|default:"0" eq "setup"}class="active"{/if}>
3131
<a href="#"><i class="fa fa-linux fa-fw"></i> System <span class="fa arrow"></span></a>
3232
<ul class="nav nav-third-level">
3333
<li><a href="{$smarty.server.SCRIPT_NAME}?page=admin&action=setup"><i class="fa fa-book fa-fw"></i> Setup</a></li>

Diff for: upgrade/definitions/0.0.11_to_0.0.12.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function run_0012() {
1111
// Upgrade specific variables
1212
$aSql[] = "CREATE TABLE `coin_addresses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `account_id` int(11) NOT NULL, `currency` varchar(5) NOT NULL, `coin_address` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `coin_address` (`coin_address`), KEY `account_id` (`account_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
1313
$aSql[] = "INSERT IGNORE INTO coin_addresses (account_id, currency, coin_address) SELECT id, '" . $config['currency'] . "', coin_address FROM " . $user->getTableName() . " WHERE coin_address IS NOT NULL";
14-
$aSql[] = "ALTER TABLE `" . $user->getTableName() . "` DROP `coin_address`";
14+
$aSql[] = "ALTER TABLE " . $user->getTableName() . " DROP `coin_address`";
1515
$aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '0.0.12' WHERE name = 'DB_VERSION'";
1616

1717
if ($db_version_now == $db_version_old && version_compare($db_version_now, DB_VERSION, '<')) {

0 commit comments

Comments
 (0)