Skip to content

Commit f7f0437

Browse files
authored
Merge pull request #2517 from MPOS/development
UPDATE : Development to Master
2 parents 2549e40 + 0387451 commit f7f0437

File tree

68 files changed

+2034
-15008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2034
-15008
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@
3737

3838
/vendor/
3939

40-
tests/_output/*
40+
tests/_output/*
41+
42+
# NetBeans Project Directory
43+
/nbproject/*

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ branches:
1818

1919
install:
2020
- wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
21-
- composer global require "fxp/composer-asset-plugin:1.0.0-beta2"
21+
- composer global require "fxp/composer-asset-plugin:~1.1.1"
2222
- composer install
2323

2424

@@ -38,4 +38,4 @@ script:
3838

3939
after_script:
4040
- wget https://scrutinizer-ci.com/ocular.phar
41-
- php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml
41+
- php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml

cronjobs/shared.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ function cfip() { return (@defined('SECURITY')) ? 1 : 0; }
6969
// Load the start time for later runtime calculations for monitoring
7070
$cron_start[$cron_name] = microtime(true);
7171

72+
// Skip all crons if admin enabled pool maintenance
73+
if ($setting->getValue('maintenance')) {
74+
$log->logInfo('Cronjobs disabled due to pool maintenance');
75+
$monitoring->endCronjob($cron_name, 'E0083', 2, true, false);
76+
}
77+
7278
// Check if our cron is activated
7379
if ($monitoring->isDisabled($cron_name)) {
7480
$log->logFatal('Cronjob is currently disabled due to errors, use -f option to force running cron.');

include/autoloader.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,8 @@
7878
require_once(CLASS_DIR . '/roundstats.class.php');
7979
require_once(CLASS_DIR . '/news.class.php');
8080
require_once(CLASS_DIR . '/api.class.php');
81+
require_once(CLASS_DIR . '/usersettings.class.php');
82+
require_once(CLASS_DIR . '/ipushnotification.interface.php');
83+
require_once(CLASS_DIR . '/pushnotification.class.php');
8184
require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php');
8285
require_once(INCLUDE_DIR . '/lib/scrypt.php');

include/classes/base.class.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Base {
1616
public function getTableName() {
1717
return $this->table;
1818
}
19+
20+
protected $debug;
1921
public function setDebug($debug) {
2022
$this->debug = $debug;
2123
}
@@ -25,9 +27,13 @@ public function setCoin($coin) {
2527
public function setCoinAddress($coin_address) {
2628
$this->coin_address = $coin_address;
2729
}
30+
31+
public $log;
2832
public function setLog($log) {
2933
$this->log = $log;
3034
}
35+
36+
protected $mysqli;
3137
public function setMysql($mysqli) {
3238
$this->mysqli = $mysqli;
3339
}
@@ -40,6 +46,10 @@ public function setSalt($salt) {
4046
public function setSalty($salt) {
4147
$this->salty = $salt;
4248
}
49+
/**
50+
* @var Smarty
51+
*/
52+
var $smarty;
4353
public function setSmarty($smarty) {
4454
$this->smarty = $smarty;
4555
}
@@ -52,6 +62,8 @@ public function setSessionManager($session) {
5262
public function setConfig($config) {
5363
$this->config = $config;
5464
}
65+
66+
protected $aErrorCodes;
5567
public function setErrorCodes(&$aErrorCodes) {
5668
$this->aErrorCodes =& $aErrorCodes;
5769
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
3+
4+
/**
5+
* We extend our CoinBase class
6+
* No need to change anything, base class supports
7+
* scrypt and sha256d
8+
**/
9+
class Coin extends CoinBase {
10+
protected $target_bits = 16;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
3+
/**
4+
* We extend our CoinBase class
5+
* No need to change anything, base class supports
6+
* scrypt and sha256d
7+
**/
8+
class Coin extends CoinBase {
9+
protected $target_bits = 24;
10+
protected $share_difficulty_precision = 4;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
3+
/**
4+
* We extend our CoinBase class
5+
* No need to change anything, base class supports
6+
* scrypt and sha256d
7+
**/
8+
class Coin extends CoinBase {
9+
protected $target_bits = 24;
10+
protected $share_difficulty_precision = 4;
11+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
interface IPushNotification {
3+
public static function getName();
4+
public static function getParameters();
5+
public function notify($message, $severity, $event);
6+
}

include/classes/monitoring.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Monitoring extends Base {
1212
public function storeUptimeRobotStatus() {
1313
if ($api_keys = $this->setting->getValue('monitoring_uptimerobot_api_keys')) {
1414
$aJSONData = array();
15-
$url = 'http://api.uptimerobot.com';
15+
$url = 'https://api.uptimerobot.com';
1616
$aMonitors = explode(',', $api_keys);
1717
foreach ($aMonitors as $aData) {
1818
$temp = explode('|', $aData);
@@ -131,7 +131,7 @@ public function endCronjob($cron_name, $msgCode, $exitCode=0, $fatal=false, $mai
131131
$this->setErrorMessage('Failed to send mail notification');
132132
}
133133
if ($fatal) {
134-
if ($exitCode != 0) $this->setStatus($cron_name . "_disabled", "yesno", 1);
134+
if ($exitCode == 1) $this->setStatus($cron_name . "_disabled", "yesno", 1);
135135
exit($exitCode);
136136
}
137137
}

0 commit comments

Comments
 (0)