Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
417 commits
Select commit Hold shift + click to select a range
74ac29e
[FIX] delete screenshot
iAmShorty Mar 3, 2014
1960df0
[UPDATE] updated query and template
iAmShorty Mar 3, 2014
887eef3
[FIX] fixed typo in notification class
iAmShorty Mar 3, 2014
57e6b2d
[FIX] permission fix
iAmShorty Mar 3, 2014
4820cc7
[UPDATE] style fix for confirmations
iAmShorty Mar 4, 2014
a17a7f7
[UPDATE] style fix dashboard account balance
iAmShorty Mar 4, 2014
779bbb8
Dashboard Test Setout
nrpatten Mar 4, 2014
8e8736e
[CHANGE] notifications
iAmShorty Mar 4, 2014
59aef1d
Merge branch 'development' into bootstrap
MPOS123 Mar 4, 2014
4b56420
[FIX] Bar chart updates
MPOS123 Mar 4, 2014
b6b0006
[UPDATE] Dashboard Layout
nrpatten Mar 4, 2014
36cda4a
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
nrpatten Mar 4, 2014
746c2ef
[UPDATE] Dashboard graphs with proper boxes
MPOS123 Mar 4, 2014
88caa1a
[UPDATE] Overview Footer margin -15px
nrpatten Mar 4, 2014
a980773
[DASHBOARD] More work and samples
MPOS123 Mar 4, 2014
c3a31b0
[FIX] Merge conflict, proper CSS fix
MPOS123 Mar 4, 2014
35bef0f
[FIX] Round progress number
MPOS123 Mar 4, 2014
e48bb24
[UPDATE] hide lastlogin message without site reload
iAmShorty Mar 4, 2014
c29bcf2
[CLEANUP] removed mobile settings and template files
iAmShorty Mar 4, 2014
d45e171
[UPDATE] notification dismiss motd/backend/lastlogin
iAmShorty Mar 4, 2014
6575418
[FIX] At least two decimals for hashrates
MPOS123 Mar 4, 2014
9b95c95
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 4, 2014
73db2cf
[ADDED] Worker information
MPOS123 Mar 4, 2014
5626c2b
[ADDED] Accont balance updates
MPOS123 Mar 4, 2014
f56de00
[FIX] Round percentage two digits
MPOS123 Mar 4, 2014
4136cc7
[CHANGE] Show 10 instead of 5 blocks on pool stats
MPOS123 Mar 4, 2014
8f40e3b
[FIX] sparkline tooltip fix
iAmShorty Mar 5, 2014
5a2e926
[FIX] removed accidentally added logfile
iAmShorty Mar 5, 2014
6eed6ec
[FIX] added newmint wallet fix
iAmShorty Mar 5, 2014
963b76e
[STYLE] added icons to notifications
iAmShorty Mar 5, 2014
50de392
[UPDATE] autohide notifications and settings update
iAmShorty Mar 5, 2014
8f03474
[FIX] removed tooltipformat from sparkline
iAmShorty Mar 5, 2014
1ae463d
[UPDATE] Overview Layout Align On Resize
nrpatten Mar 5, 2014
bcb5eac
[UPDATE] New Overview Layout Align On Resize [Opps Remove MPOS1]
nrpatten Mar 5, 2014
3120ed7
[FIX] Block Overview Error
nrpatten Mar 5, 2014
0e981d7
[ADD] Password reset form and link in login
nrpatten Mar 5, 2014
faf414e
[FEATURE] added minimum payout
iAmShorty Mar 5, 2014
b85a47a
[UPDATE] dashboard fixes, disable tickerupdate in cron/dashboard
iAmShorty Mar 5, 2014
69e47fe
Add Ticketupdate 'enabled' var
Mar 5, 2014
f9835e6
[FIX] trim whitespaces
iAmShorty Mar 6, 2014
dcfa79c
[FIX] coin_address is string, not int
iAmShorty Mar 6, 2014
b7db722
[FIX] removed test from footer
iAmShorty Mar 6, 2014
d2ddad5
Fix Dashboard Centering
Mar 6, 2014
581f365
[FIX] Removed +x bit
MPOS123 Mar 7, 2014
e62db71
[FIX] Tickerupdate Checks
MPOS123 Mar 7, 2014
7e49e90
[Merge] Fix conflicts with development
MPOS123 Mar 7, 2014
ba8e3aa
[TEST] Min/Max Ranges for Price Ticker
MPOS123 Mar 7, 2014
942c1ff
[REMOVED] Color Round Stats, not our own style
MPOS123 Mar 7, 2014
7c1e9b4
[ADDED] Dashboard Quick Access on mobile
MPOS123 Mar 7, 2014
afd9fb2
[UPDATE] Login Icons/Dashboard Auto Resize (easyer to work with for a…
nrpatten Mar 10, 2014
e6088fe
[FIX][UPDATE] Login Icons/Dashboard Auto Resize (easyer to work with …
nrpatten Mar 10, 2014
e3317f3
[FIX] mpos theme notification fix
iAmShorty Mar 10, 2014
6b1bcea
[FIX] removed test files
iAmShorty Mar 10, 2014
7bc6ec9
[FIX] mpos compatibility for icons in navigation
iAmShorty Mar 10, 2014
baf07e0
[CLEANUP] Responsive tables added when needed
MPOS123 Mar 10, 2014
cf3e230
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 10, 2014
022a3d1
[FIX] Dasboard icon alignment
iAmShorty Mar 10, 2014
0f3c24a
[FIX] Nethashrate
nrpatten Mar 10, 2014
04c5b4b
[FIX] Nethashrate
nrpatten Mar 10, 2014
2767064
[FIX] Sparks Line/Bar
nrpatten Mar 10, 2014
68816e3
[UPDATE] fixed balance background
iAmShorty Mar 10, 2014
b845ec6
[FIX] Forgot api id's
nrpatten Mar 10, 2014
1a9ba4a
[FIX] Forgot api id's
nrpatten Mar 10, 2014
2225468
[FIX] changed inline styles to css
iAmShorty Mar 10, 2014
03c890b
[FIX] changed inline styles to css in overview
iAmShorty Mar 10, 2014
cd1c828
[FIX] Remove spark from bootstrap.css
nrpatten Mar 10, 2014
f16be5d
[FIX] Remove spark from bootstrap.css
nrpatten Mar 10, 2014
3ade244
[FIX] Remove spark from bootstrap.min.css
nrpatten Mar 10, 2014
e4f048b
[UPDATE] added CTOKEN to forms
iAmShorty Mar 10, 2014
6c195af
[UPDATE] removed debugger console
iAmShorty Mar 10, 2014
4fc9eae
[UPDATE] borderless css for dashboard round stats
iAmShorty Mar 10, 2014
f6425ba
[ADD] Price enable/disable to currency/day
nrpatten Mar 10, 2014
e9b6e00
[FIX] Open {nocache}
nrpatten Mar 10, 2014
603961d
[FIX] added default start var to worker paging
iAmShorty Mar 10, 2014
bf1ac16
Merge branch 'development' into bootstrap
MPOS123 Mar 10, 2014
7977834
[UPDATE] additional spaces request #1920
iAmShorty Mar 10, 2014
4ff53d1
[UPDATE] Registration Layout
nrpatten Mar 10, 2014
834b813
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
nrpatten Mar 10, 2014
20df379
[UPDATE] changed bitcoin icon to money
iAmShorty Mar 10, 2014
bf3029d
[UPDATE] Move .hashunits into span next to Hashrate [FIX] For resize
nrpatten Mar 10, 2014
e707548
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
nrpatten Mar 10, 2014
c53c288
[UPDATE] reworked getting started page
iAmShorty Mar 10, 2014
9f97eb6
[CLEANUP] Font in stats boxes
MPOS123 Mar 10, 2014
1ab765b
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 10, 2014
3ef1aa4
[UPDATE] Overview MH/s size
nrpatten Mar 10, 2014
7143845
[FIX] updating workers page
iAmShorty Mar 10, 2014
c7df914
[UPDATE] Remove dashboard round stats color as requested
nrpatten Mar 11, 2014
ac8223c
[UPDATE] Remove dashboard round stats color as requested
nrpatten Mar 11, 2014
5e07655
[UPDATE] Add Difficulty/est Difficulty and Time per Block
nrpatten Mar 11, 2014
62a9672
[UPDATE] Add shares per second S/s to My Sharerate
nrpatten Mar 11, 2014
8831dad
[PREP] #1922
MPOS123 Mar 11, 2014
670432a
[CLEANUP] Number formatting adjusted in JS
MPOS123 Mar 11, 2014
a54ba1e
[FIX] Initial hashrate value for graph
MPOS123 Mar 11, 2014
fbf8036
[CLEANUP] Major structure overhaul for dashboard
MPOS123 Mar 11, 2014
3205404
Merge branch 'development' into bootstrap
MPOS123 Mar 11, 2014
e86f670
[CLONE] Copied prop dashboard to PPLNS for @iAmShorty to play with
MPOS123 Mar 11, 2014
c3d69fe
[ADDED] Worker Information Box to dashboard
MPOS123 Mar 11, 2014
7f01244
[UPDATE] smaller table footers
iAmShorty Mar 11, 2014
5a5a5b4
[UPDATE] change dashboard as requested
iAmShorty Mar 11, 2014
26d52b6
[UPDATE] dashboard style
iAmShorty Mar 11, 2014
b05d626
[CLEANUP] Bar graphs design
MPOS123 Mar 11, 2014
65ce8f1
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 11, 2014
02dc719
[UPDATE] dashboard style
iAmShorty Mar 11, 2014
686e7f1
[UPDATE] morris.js charts
iAmShorty Mar 11, 2014
59d9c83
[FIX] show estimated coins if coinprice is disabled
iAmShorty Mar 11, 2014
3c41f0b
[UPDATE] progress bars and Est Next Difficulty split
nrpatten Mar 11, 2014
d1442fe
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
nrpatten Mar 11, 2014
083b1f5
[UPDATE] progress bars and Est Next Difficulty split for props
nrpatten Mar 11, 2014
dbc4b70
[UPDATE] adding colors to progressbars
iAmShorty Mar 11, 2014
4a79ed8
[FIX] Initial static values for round shares
MPOS123 Mar 11, 2014
5a746bb
[FIX] Hide worker information if live dashboard disabled
MPOS123 Mar 11, 2014
b8ebbe5
[FIX] Use proper personal invalid shares
MPOS123 Mar 11, 2014
846165d
Merge branch 'development' into bootstrap
MPOS123 Mar 11, 2014
dfddb83
Merge branch 'development' into bootstrap
MPOS123 Mar 12, 2014
a431c0f
[UPDATE] fixed worker page icons and paging
iAmShorty Mar 12, 2014
d9cfd2a
[FIX] user earnings only visible as admin
iAmShorty Mar 12, 2014
fd30568
[CLEANUP] In-line with rest of account pages
MPOS123 Mar 12, 2014
25dd2a9
[FIX] user auth status
iAmShorty Mar 12, 2014
89fad15
[FIX] Logic error
MPOS123 Mar 12, 2014
05bd929
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 12, 2014
1969744
[FIX] typo in config
iAmShorty Mar 12, 2014
b3eb25c
[FIX] text-center QRcode
nrpatten Mar 12, 2014
f0ca663
[FIX] css folders
iAmShorty Mar 12, 2014
3f028a2
[UPDATE] cleaned up about page
iAmShorty Mar 12, 2014
b300901
[FIX] fixed divs in transactions
iAmShorty Mar 12, 2014
90fe686
[FIX] making round stats responsive
iAmShorty Mar 12, 2014
654dcc3
[FIX] making round stats responsive - prop
iAmShorty Mar 12, 2014
ac9b65e
[FIX] adding recaptcha to login
iAmShorty Mar 12, 2014
9dfcab2
[FIX] fixed share information update if shares are 0
iAmShorty Mar 13, 2014
69bf240
[FIX] fixed progressbars style/color for efficiency
iAmShorty Mar 13, 2014
c5788c5
[FIX] fixed undefined index share
iAmShorty Mar 13, 2014
41c1af7
[UPDATE] style fixes
iAmShorty Mar 13, 2014
d6244e3
[FIX] Small Rez row center
nrpatten Mar 13, 2014
7d17fd5
[POC] Coin-based Classes
MPOS123 Mar 17, 2014
46cfd2c
[POC] Replaced config target bits with coin base
MPOS123 Mar 17, 2014
914df49
[FIX] Access to protected var
MPOS123 Mar 17, 2014
dcb50da
[REMOVED] Code Debug output
MPOS123 Mar 17, 2014
5d37a77
[UPDATE] Blocks overview est shares
MPOS123 Mar 17, 2014
1583877
Merge branch 'development' into coin-plugin-system
MPOS123 Mar 17, 2014
5fd4085
[MOVED] Coin Classes into own folder
MPOS123 Mar 17, 2014
3694af7
Merge branch 'development' into coin-plugin-system
MPOS123 Mar 17, 2014
e863ef3
Merge branch 'development' into bootstrap
MPOS123 Mar 17, 2014
2089af6
[FIX] Proper getTargetBits call
MPOS123 Mar 17, 2014
9d66c2f
[FIX] Worker class
MPOS123 Mar 17, 2014
9f942a6
[FIX] added missing icons
iAmShorty Mar 18, 2014
e19f77f
[ADDED] Missing number_format
MPOS123 Mar 19, 2014
40337e4
[FIX] datatable issue with empty donors
iAmShorty Mar 19, 2014
f7e6e6a
[FIX] fixed datatables if arrays are empty
iAmShorty Mar 19, 2014
452d468
[UPDATE] added datatable to user info
iAmShorty Mar 19, 2014
9f9b4e9
[FIX] update datatables css
iAmShorty Mar 19, 2014
5c4112d
Merge branch 'development' into bootstrap
MPOS123 Mar 19, 2014
ccd217d
[UPDATE] mail stale users
iAmShorty Mar 19, 2014
3c537d5
[FIX] Target Bits on Dashboard
MPOS123 Mar 19, 2014
c71bc99
Merge pull request #1955 from MPOS/coin-plugin-system
TheSerapher Mar 19, 2014
88e3edb
[MERGE] Fix merge conflict
MPOS123 Mar 19, 2014
fe36acf
[UPDATE] responsive tables in wallet info
iAmShorty Mar 20, 2014
d0707c9
Merge branch 'bootstrap' of https://github.com/MPOS/php-mpos into boo…
iAmShorty Mar 20, 2014
e684a98
[ADDED] Calc Coin PPS Value Method
MPOS123 Mar 20, 2014
2c3ae28
Merge pull request #1974 from MPOS/coin-pps-value
TheSerapher Mar 20, 2014
0bdc124
[FIX] Spelling mistake
TheSerapher Mar 20, 2014
6f42694
Merge pull request #1976 from MPOS/spelling
TheSerapher Mar 20, 2014
fb0dbbd
[FIX] style fixes
iAmShorty Mar 21, 2014
67a4713
[REMOVED] Baseline Share calculations
MPOS123 Mar 21, 2014
1f6ef81
[ADDED] SQL Upgrade Script
MPOS123 Mar 21, 2014
055e425
[REMOVED] Baseline shares from statistics
MPOS123 Mar 21, 2014
d72b4f6
[REMOVED] Baseline from roundstats
MPOS123 Mar 21, 2014
10ad428
[UPDATED] Logrotate conf
MPOS123 Mar 21, 2014
bc42963
[DEPRECATED] run-crons throws a warning now
MPOS123 Mar 21, 2014
f9cba03
[IMPROVED] Advanced upgrade structure
MPOS123 Mar 21, 2014
8b28b25
[CHANGE] Moved SQL files into upgrade script
MPOS123 Mar 21, 2014
9a7d9ab
Merge pull request #1984 from MPOS/drop-baseline-shares
TheSerapher Mar 21, 2014
5841eb4
Merge branch 'development' into bootstrap
MPOS123 Mar 21, 2014
3223e40
[FIXED] Charset on payouts table, non-critical
MPOS123 Mar 21, 2014
7945b87
[FIX] 0.0.8 Upgrade SQL
MPOS123 Mar 21, 2014
3ec6248
Merge branch 'development' into bootstrap
MPOS123 Mar 21, 2014
1634d0a
Update bootstrap.min.css
Samuelnz Mar 22, 2014
049d3be
Update bootstrap.min.css
Samuelnz Mar 22, 2014
39da074
Update mpos.css
Samuelnz Mar 22, 2014
f78b20f
Update mpos.css
Samuelnz Mar 22, 2014
828481b
[FIX] Worker Info Responsive
MPOS123 Mar 22, 2014
a00b847
[DRAFT] PPS Dashboard
MPOS123 Mar 22, 2014
f9c57e8
Merge pull request #1987 from SamuelNZ/patch-3
TheSerapher Mar 22, 2014
fd5591f
New Test Setout
nrpatten Mar 22, 2014
f3f12d3
New Test Setout Round Stats
nrpatten Mar 22, 2014
20130b4
New Test Setout Round Stats Readd
nrpatten Mar 22, 2014
b0fdb62
[LAYOUT] Blocks Stats page
MPOS123 Mar 22, 2014
51b7cbd
Update mpos.css
Samuelnz Mar 22, 2014
02c7074
New Test Setout Round Props
nrpatten Mar 22, 2014
3e68540
New Test Setout Round Props
nrpatten Mar 22, 2014
f0e0bf2
[UPDATE] Overview Icons
nrpatten Mar 22, 2014
7350178
[UPDATE] Pool Info Without Price
nrpatten Mar 22, 2014
cddb929
[FIX] HTML Fixes
nrpatten Mar 22, 2014
bd57e04
[UPDATE] style fixes
iAmShorty Mar 22, 2014
ca163a4
[UPDATE] style fixes
iAmShorty Mar 22, 2014
aa63eac
Update global.inc.dist.php
Samuelnz Mar 22, 2014
bfd0302
[FIX] Style Margin
nrpatten Mar 22, 2014
0aa75bd
[FIX] More Style Margin
nrpatten Mar 22, 2014
948fe89
[FIX] More Style Margin
nrpatten Mar 22, 2014
be50e8a
[FIX] Remove baseline conversion from PPLNS Targets
MPOS123 Mar 22, 2014
af3b048
Merge branch 'development' into bootstrap
MPOS123 Mar 22, 2014
441e718
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 22, 2014
ad1db8d
[FIX] Same for PPLNS Archive shares
MPOS123 Mar 22, 2014
5b47274
Merge branch 'development' into bootstrap
MPOS123 Mar 22, 2014
bd4096b
[UPDATE] added exchange url to price ticker
iAmShorty Mar 22, 2014
5866cbb
[UPDATE] changed link behavior
iAmShorty Mar 22, 2014
c785af9
[UPDATE] changed link behavior
iAmShorty Mar 22, 2014
48a34c4
[FIX] HTML Errors
nrpatten Mar 23, 2014
ab96fcf
[FIX] More HTML Errors [FIX] contributors share/hashrate highlight
nrpatten Mar 23, 2014
a9f2386
[FIX] contributors share/hashrate highlight
nrpatten Mar 23, 2014
13590f6
[UPDATE] Teal Backgrond for Pool Information Round Information Not so…
nrpatten Mar 23, 2014
94035b5
Update bootstrap.php
kthxbai2u Mar 23, 2014
1de5078
Fix Typo
Mar 23, 2014
c89b807
[CLEANUP] Number formatting
MPOS123 Mar 23, 2014
9d0700e
[UPDATE] added Pool Navigation to header and admin settings
iAmShorty Mar 24, 2014
ad0feb3
[UPDATE] description update
iAmShorty Mar 24, 2014
ad6f70f
[FIX] small style change for dropdown
iAmShorty Mar 24, 2014
c15aaa6
[UPDATE] lightblue background with opacity 0.8 / font-weight 600 for …
nrpatten Mar 24, 2014
fec49db
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
nrpatten Mar 24, 2014
6d04c4f
[FIX] style fix
iAmShorty Mar 24, 2014
1ca9c9e
[UPDATE] removed baseline shares from api
iAmShorty Mar 24, 2014
630ec6e
Merge pull request #2001 from iAmShorty/api-calls
TheSerapher Mar 24, 2014
4b8db48
Merge pull request #1989 from SamuelNZ/patch-4
TheSerapher Mar 24, 2014
7d51e8f
[FIX] broken mobile navigation
iAmShorty Mar 24, 2014
d4c23fe
Cloudflare IP forwarding when using getCurrentIP()
Contex Mar 24, 2014
4dff6ee
[UPDATE] style fix user transactions
iAmShorty Mar 24, 2014
56e757a
Merge pull request #1994 from kthxbai2u/patch-1
TheSerapher Mar 25, 2014
74d8727
Merge pull request #2002 from Contex/development
TheSerapher Mar 25, 2014
22b6901
[FIX] getbalance fix for coins with getbalance problems
iAmShorty Mar 25, 2014
25323f3
[FIX] file rights
iAmShorty Mar 25, 2014
e26533f
Merge pull request #2005 from iAmShorty/getbalance-config
TheSerapher Mar 25, 2014
b6aa1cb
Merge branch 'development' into bootstrap
MPOS123 Mar 25, 2014
d454570
[FIX] added getbalancewithunconfirmed to wallet template
iAmShorty Mar 25, 2014
46f7adb
[SQL] Base Structure 0.0.8
MPOS123 Mar 25, 2014
8f739bb
Merge branch 'development' into bootstrap
MPOS123 Mar 25, 2014
577f9ad
Merge branch 'bootstrap' of github.com:MPOS/php-mpos into bootstrap
MPOS123 Mar 25, 2014
d51cfc0
[UPDATE] Make bootstrap default template
MPOS123 Mar 25, 2014
662ff69
[ADDED] Return-Path when sending mail
MPOS123 Mar 25, 2014
6788411
Merge pull request #2008 from MPOS/mail-return-path
TheSerapher Mar 25, 2014
3a7e358
[UPDATE] some style changes, design switcher for own designs
iAmShorty Mar 25, 2014
1087d48
[UPDATE] hover links in dark theme
iAmShorty Mar 25, 2014
6d67a32
Rearrange cron in UI to correspond to the actual order of work
mezrin Mar 25, 2014
dfd8985
Merge pull request #2011 from Mezrin/development
TheSerapher Mar 25, 2014
6a8784e
[FIX] default design fix
iAmShorty Mar 25, 2014
b464791
[FIX] style fix in admin news and css
iAmShorty Mar 25, 2014
dffd5a7
[UPDATE] Couple of color tweeks
nrpatten Mar 26, 2014
07ba447
[UPDATE] More color tweeks
nrpatten Mar 26, 2014
557856e
[UPDATE] More tweeks
nrpatten Mar 26, 2014
ff6b267
[FIX] Me Being Silly :P
nrpatten Mar 26, 2014
acced2b
Merge pull request #1853 from MPOS/bootstrap
TheSerapher Mar 26, 2014
e7d5397
[REMOVED] Backup files ... TsTsTs
MPOS123 Mar 26, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion cronjobs/etc/logrotate.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"./logs/*.txt" {
"./logs/*/*.txt" {
copytruncate
rotate 7
compress
Expand Down
20 changes: 10 additions & 10 deletions cronjobs/payouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@

// 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)) {
Expand Down Expand Up @@ -133,12 +133,12 @@

// 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)) {
Expand Down
9 changes: 4 additions & 5 deletions cronjobs/pps_payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}

// Per-share value to be paid out to users
$pps_value = round($pps_reward / (pow(2, $config['target_bits']) * $dDifficulty), 12);
$pps_value = round($coin->calcPPSValue($pps_reward, $dDifficulty), 12);

// Find our last share accounted and last inserted share for PPS calculations
if (!$iPreviousShareId = $setting->getValue('pps_last_share_id')) {
Expand Down Expand Up @@ -105,9 +105,8 @@
continue;
}

// MPOS uses a base difficulty setting to avoid showing weightened shares
// Since we need weightened shares here, we go back to the proper value for payouts
$aData['payout'] = round($aData['valid'] * pow(2, ($config['difficulty'] - 16)) * $pps_value, 12);
// Payout for this user
$aData['payout'] = round($aData['valid'] * $pps_value, 12);

// Defaults
$aData['fee' ] = 0;
Expand All @@ -120,7 +119,7 @@
$aData['donation'] = round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 12);

$log->logInfo(sprintf(
$strLogMask, $aData['id'], $aData['username'], $aData['invalid'], $aData['valid'] * pow(2, ($config['difficulty'] - 16)),
$strLogMask, $aData['id'], $aData['username'], $aData['invalid'], $aData['valid'],
number_format($pps_value, 12), number_format($aData['payout'], 12), number_format($aData['donation'], 12), number_format($aData['fee'], 12)
));

Expand Down
2 changes: 2 additions & 0 deletions cronjobs/run-crons.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

echo "Please be aware: This cron is deprecated and will be removed. Please read: https://github.com/MPOS/php-mpos/wiki/Cronjobs#setup"
sleep 2

#########################
# #
Expand Down
22 changes: 15 additions & 7 deletions cronjobs/tickerupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,26 @@
$strLogMask = "| %-25.25s | %15.15s | %8.8s | %-6.6s | %-80.80s |";
$log->logInfo(sprintf($strLogMask, 'Method', 'Value', 'Runtime', 'Status', 'Message'));

empty($config['price']['enabled']) ? $tickerupdate = false : $tickerupdate = $config['price']['enabled'];

// Fetch latest coin price via API call
$start = microtime(true);
$message = 'Updated latest ' . $config['currency'] . ' price from ' . $config['price']['url'] . ' API';
$status = 'OK';
if ($price = $tools->getPrice()) {
if (!$setting->setValue('price', $price)) {
$message = 'Unable to store new price value: ' . $setting->getCronError();
if ($tickerupdate) {
$message = 'Updated latest ' . $config['currency'] . ' price from ' . $config['price']['url'] . ' API';
$status = 'OK';
if ($price = $tools->getPrice()) {
if (!$setting->setValue('price', $price)) {
$message = 'Unable to store new price value: ' . $setting->getCronError();
$status = 'ERROR';
}
} else {
$message = 'Failed to fetch price from API: ' . $tools->getCronError();
$status = 'ERROR';
}
} else {
$message = 'Failed to fetch price from API: ' . $tools->getCronError();
$status = 'ERROR';
$message = 'Tickerupdate is disabled';
$status = 'OK';
$price = 0;
}
$log->logInfo(sprintf($strLogMask, 'Price Update', $price, number_format(microtime(true) - $start, 3), $status, $message));

Expand Down
8 changes: 4 additions & 4 deletions public/include/admin_checks.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@

// display the errors
foreach ($enotice as $en) {
$_SESSION['POPUP'][] = array('CONTENT' => $en, 'TYPE' => 'info');
$_SESSION['POPUP'][] = array('CONTENT' => $en, 'TYPE' => 'alert alert-info');
}
if (!count($notice) && !count($error)) {
$_SESSION['POPUP'][] = array('CONTENT' => 'The config options we checked seem OK', 'TYPE' => 'success');
$_SESSION['POPUP'][] = array('CONTENT' => 'The config options we checked seem OK', 'TYPE' => 'alert alert-success');
} else {
foreach ($notice as $n) {
$_SESSION['POPUP'][] = array('CONTENT' => $n, 'TYPE' => 'warning');
$_SESSION['POPUP'][] = array('CONTENT' => $n, 'TYPE' => 'alert alert-warning');
}
foreach ($error as $e) {
$_SESSION['POPUP'][] = array('CONTENT' => $e, 'TYPE' => 'errormsg');
$_SESSION['POPUP'][] = array('CONTENT' => $e, 'TYPE' => 'alert alert-danger');
}
}
}
Expand Down
29 changes: 13 additions & 16 deletions public/include/autoloader.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
(SECURITY == "*)WT#&YHfd" && SECHASH_CHECK) ? die("public/index.php -> Set a new SECURITY value to continue") : 0;
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

// SHA/Scrypt check
if (empty($config['algorithm']) || $config['algorithm'] == 'scrypt') {
$config['target_bits'] = 16;
} else {
$config['target_bits'] = 32;
}

// Default classes
require_once(INCLUDE_DIR . '/lib/KLogger.php');
require_once(CLASS_DIR . '/logger.class.php');
Expand All @@ -20,24 +13,28 @@
require_once(INCLUDE_DIR . '/config/memcache_keys.inc.php');
require_once(INCLUDE_DIR . '/config/error_codes.inc.php');

// We need to load these two first
// We need to load these first
require_once(CLASS_DIR . '/base.class.php');
require_once(CLASS_DIR . '/coins/coin_base.class.php');
require_once(CLASS_DIR . '/setting.class.php');

// We need this one in here to properly set our theme
require_once(INCLUDE_DIR . '/lib/Mobile_Detect.php');
// Now decide on which coin class to load and instantiate
if (file_exists(CLASS_DIR . '/coins/coin_' . $config['algorithm'] . '.class.php')) {
require_once(CLASS_DIR . '/coins/coin_' . $config['algorithm'] . '.class.php');
$coin = new Coin();
$coin->setConfig($config);
} else {
die('Unable to load your coins class definition for ' . $config['algorithm']);
}

// Detect device
if ($detect->isMobile() && $setting->getValue('website_mobile_theme')) {
// Set to mobile theme
$setting->getValue('website_mobile_theme') ? $theme = $setting->getValue('website_mobile_theme') : $theme = 'mobile';
} else if ( PHP_SAPI == 'cli') {
if ( PHP_SAPI == 'cli') {
// Create a new compile folder just for crons
// We call mail templates directly anyway
$theme = 'cron';
} else {
// Use configured theme, fallback to default theme
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'mpos';
$setting->getValue('website_theme') ? $theme = $setting->getValue('website_theme') : $theme = 'bootstrap';
}
define('THEME', $theme);

Expand Down Expand Up @@ -73,4 +70,4 @@
require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php');
require_once(INCLUDE_DIR . '/lib/scrypt.php');

?>
?>
8 changes: 4 additions & 4 deletions public/include/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
$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
Expand All @@ -36,4 +36,4 @@
// We include all needed files here, even though our templates could load them themself
require_once(INCLUDE_DIR . '/autoloader.inc.php');

?>
?>
3 changes: 3 additions & 0 deletions public/include/classes/base.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public function getTableName() {
public function setDebug($debug) {
$this->debug = $debug;
}
public function setCoin($coin) {
$this->coin = $coin;
}
public function setLog($log) {
$this->log = $log;
}
Expand Down
60 changes: 60 additions & 0 deletions public/include/classes/coins/coin_base.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;


/**
* Our coin base class that we extend our other coins from
*
* We are implementing all basic coin methods into this class but it
* must be extended for customized coins.
**/
class CoinBase extends Base {
// Our coins target bits
protected $target_bits = NULL;

/**
* Read our target bits
**/
public function getTargetBits() {
return $this->target_bits;
}

/**
* Calculate the PPS value for this coin
* WARNING: Get this wrong and you will over- or underpay your miners!
**/
public function calcPPSValue($pps_reward, $dDifficulty) {
return ($pps_reward / (pow(2, $this->target_bits) * $dDifficulty));
}

/**
* Calculate our hashrate based on shares inserted to DB
* We use diff1 share values, not a baseline one
**/
public function calcHashrate($shares, $interval) {
return $shares * pow(2, $this->target_bits) / $interval / 1000;
}

/**
* Calculate estimated shares of this coin, this is using baseline
* according to our configuration difficulty
**/
public function calcEstaimtedShares($dDifficulty) {
return (int)round(pow(2, (32 - $this->target_bits)) * $dDifficulty, 0);
}

/**
* Calculate our networks expected time per block
**/
public function calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate) {
return pow(2, 32) * $dDifficulty / $dNetworkHashrate;
}
/**
* Calculate next expected difficulty based on current difficulty
**/
public function calcExpectedNextDifficulty($dDifficulty, $dNetworkHashrate) {
return round($dDifficulty * $this->config['cointarget'] / $this->calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate), 8);
}
}

?>
13 changes: 13 additions & 0 deletions public/include/classes/coins/coin_scrypt.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

/**
* We extend our CoinBase class
* No need to change anything, base class supports
* scrypt and sha256d
**/
class Coin extends CoinBase {
protected $target_bits = 16;
}

?>
13 changes: 13 additions & 0 deletions public/include/classes/coins/coin_sha256d.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

/**
* We extend our CoinBase class
* No need to change anything, base class supports
* scrypt and sha256d
**/
class Coin extends CoinBase {
protected $target_bits = 32;
}

?>
2 changes: 1 addition & 1 deletion public/include/classes/mail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function sendMail($template, $aData) {
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (strlen(@$aData['senderName']) > 0 && @strlen($aData['senderEmail']) > 0 )
$headers .= 'Reply-To: ' . $aData['senderName'] . ' <' . $aData['senderEmail'] . ">\n";
if (mail($aData['email'], $this->smarty->fetch(BASEPATH . 'templates/mail/subject.tpl'), $this->smarty->fetch(BASEPATH . 'templates/mail/' . $template . '.tpl'), $headers))
if (mail($aData['email'], $this->smarty->fetch(BASEPATH . 'templates/mail/subject.tpl'), $this->smarty->fetch(BASEPATH . 'templates/mail/' . $template . '.tpl'), $headers, '-f ' . $this->setting->getValue('website_email')))
return true;
$this->setErrorMessage($this->sqlError('E0031'));
return false;
Expand Down
6 changes: 3 additions & 3 deletions public/include/classes/notification.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public function addNotification($account_id, $type, $data) {
* @param id int Account ID
* @return array Notification data
**/
public function getNotifications($account_id) {
public function getNotifications($account_id,$limit=50) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("SELECT * FROM $this->table WHERE account_id = ? ORDER BY time DESC");
if ($stmt && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result())
$stmt = $this->mysqli->prepare("SELECT * FROM $this->table WHERE account_id = ? ORDER BY time DESC LIMIT ?");
if ($stmt && $stmt->bind_param('ii', $account_id, $limit) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
return $this->getError();
}
Expand Down
3 changes: 2 additions & 1 deletion public/include/classes/roundstats.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getDetailsForBlockHeight($iHeight=0) {
SELECT
b.id, height, blockhash, amount, confirmations, difficulty, FROM_UNIXTIME(time) as time, shares,
IF(a.is_anonymous, 'anonymous', a.username) AS finder,
ROUND((difficulty * 65535) / POW(2, (" . $this->config['difficulty'] . " -16)), 0) AS estshares,
ROUND(difficulty * POW(2, 32 - " . $this->coin->getTargetBits() . "), 0) AS estshares,
(time - (SELECT time FROM $this->tableBlocks WHERE height < ? ORDER BY height DESC LIMIT 1)) AS round_time
FROM " . $this->block->getTableName() . " as b
LEFT JOIN " . $this->user->getTableName() . " AS a ON b.account_id = a.id
Expand Down Expand Up @@ -288,3 +288,4 @@ public function getUserRoundTransHeight($iHeight=0, $iUser) {
$roundstats->setStatistics($statistics);
$roundstats->setBlock($block);
$roundstats->setTransaction($transaction);
$roundstats->setCoin($coin);
14 changes: 5 additions & 9 deletions public/include/classes/share.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getLastInsertedShareId() {
**/
public function getRoundShares($previous_upstream=0, $current_upstream) {
$stmt = $this->mysqli->prepare("SELECT
ROUND(IFNULL(SUM(IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 8) AS total
IFNULL(SUM(IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty)), 0) AS total
FROM $this->table AS s
LEFT JOIN " . $this->user->getTableName() . " AS a
ON a.username = SUBSTRING_INDEX( s.username , '.', 1 )
Expand All @@ -99,8 +99,8 @@ public function getSharesForAccounts($previous_upstream=0, $current_upstream) {
a.id,
SUBSTRING_INDEX( s.username , '.', 1 ) as username,
a.no_fees AS no_fees,
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 8) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 8) AS invalid
IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) AS valid,
IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) AS invalid
FROM $this->table AS s
LEFT JOIN " . $this->user->getTableName() . " AS a
ON a.username = SUBSTRING_INDEX( s.username , '.', 1 )
Expand Down Expand Up @@ -146,8 +146,8 @@ function getArchiveShares($iCount) {
a.id,
SUBSTRING_INDEX( s.username , '.', 1 ) as account,
a.no_fees AS no_fees,
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 8) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 8) AS invalid
IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) AS valid,
IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) AS invalid
FROM $this->tableArchive AS s
LEFT JOIN " . $this->user->getTableName() . " AS a
ON a.username = SUBSTRING_INDEX( s.username , '.', 1 )
Expand Down Expand Up @@ -360,8 +360,6 @@ public function findUpstreamShare($aBlock, $last=0) {
* Fetch the lowest needed share ID from shares
**/
function getMinimumShareId($iCount, $current_upstream) {
// We don't use baseline here to be more accurate
$iCount = $iCount * pow(2, ($this->config['difficulty'] - 16));
$stmt = $this->mysqli->prepare("
SELECT MIN(b.id) AS id FROM
(
Expand All @@ -381,8 +379,6 @@ function getMinimumShareId($iCount, $current_upstream) {
* Fetch the lowest needed share ID from archive
**/
function getMinArchiveShareId($iCount) {
// We don't use baseline here to be more accurate
$iCount = $iCount * pow(2, ($this->config['difficulty'] - 16));
$stmt = $this->mysqli->prepare("
SELECT MIN(b.share_id) AS share_id FROM
(
Expand Down
Loading