Merge branch 'development' into coin-rounding-setting
This commit is contained in:
commit
22e88777da
@ -1,7 +1,7 @@
|
||||
Description
|
||||
===========
|
||||
|
||||
MPOS is a web based Mining Portal for various crypto currencies. It was created by [TheSerapher](https://github.com/TheSerapher) and has hence grown quite large. Recently it was migrated into a Github Organization to make development easier. It's a community driven open source project. Support can be requested on IRC at https://webchat.freenode.net/?channels=#mpos
|
||||
MPOS is a web based Mining Portal for various crypto currencies. It was created by [TheSerapher](https://github.com/TheSerapher) and has hence grown quite large. Recently it was migrated into a Github Organization to make development easier. It's a community driven open source project. Support can be requested on IRC at https://webchat.freenode.net/?channels=#mpos - Be **PATIENT** ... People listed in this channel may currently be inactive but most users there have offline logging of messages. They **will** see your questions and answer if they can. Don't join, ask the question and leave. Sit around if you want answers to your questions!
|
||||
|
||||
|
||||
**NOTE**: This project is still under development and commits are happening on a daily basis.
|
||||
|
||||
@ -34,13 +34,18 @@ if (file_exists(CLASS_DIR . '/coins/coin_' . $config['algorithm'] . '.class.php'
|
||||
require_once(INCLUDE_DIR . '/lib/swiftmailer/swift_required.php');
|
||||
|
||||
// Detect device
|
||||
if ( PHP_SAPI == 'cli') {
|
||||
require_once(INCLUDE_DIR . '/lib/Mobile_Detect.php');
|
||||
$detect = new Mobile_Detect;
|
||||
|
||||
if ($detect->isMobile()) {
|
||||
$theme = $setting->getValue('website_mobile_theme', 'bootstrap');
|
||||
} else 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 = 'bootstrap';
|
||||
$theme = $setting->getValue('website_theme', 'bootstrap');
|
||||
}
|
||||
define('THEME', $theme);
|
||||
|
||||
|
||||
@ -69,6 +69,13 @@ $aSettings['website'][] = array(
|
||||
'name' => 'website_theme', 'value' => $setting->getValue('website_theme'),
|
||||
'tooltip' => 'The default theme used on your pool.'
|
||||
);
|
||||
$aSettings['website'][] = array(
|
||||
'display' => 'Website mobile theme', 'type' => 'select',
|
||||
'options' => $aThemes,
|
||||
'default' => 'bootstrap',
|
||||
'name' => 'website_mobile_theme', 'value' => $setting->getValue('website_mobile_theme'),
|
||||
'tooltip' => 'The mobile theme used on your pool.'
|
||||
);
|
||||
$aSettings['website'][] = array(
|
||||
'display' => 'Website Design', 'type' => 'select',
|
||||
'options' => $aDesigns,
|
||||
|
||||
1248
include/lib/Mobile_Detect.php
Normal file
1248
include/lib/Mobile_Detect.php
Normal file
File diff suppressed because one or more lines are too long
@ -20,7 +20,7 @@ if ($setting->getValue('notifications_disable_pool_newsletter', 0) == 1) {
|
||||
$iSuccess = 0;
|
||||
foreach ($user->getAllAssoc() as $aData) {
|
||||
$aUserNotificationSettings = $notification->getNotificationSettings($aData['id']);
|
||||
if ($aData['is_locked'] != 0 || $aUserNotificationSettings['newsletter'] != 1) continue;
|
||||
if ($aData['is_locked'] != 0 || $aUserNotificationSettings['newsletter'] != 1 || empty($aData['email'])) continue;
|
||||
$aData['subject'] = $_REQUEST['data']['subject'];
|
||||
$aData['CONTENT'] = $_REQUEST['data']['content'];
|
||||
if (!$mail->sendMail('newsletter/body', $aData, true)) {
|
||||
|
||||
@ -19,7 +19,9 @@ echo json_encode(
|
||||
'workers' => $worker->getCountAllActiveWorkers(),
|
||||
'shares_this_round' => $aShares['valid'],
|
||||
'last_block' => $aLastBlock['height'],
|
||||
'network_hashrate' => $dNetworkHashrate
|
||||
'network_hashrate' => $dNetworkHashrate,
|
||||
'fee' => $config['fees'],
|
||||
'payout' => $config['payout_system']
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -18,28 +18,30 @@ if ($setting->getValue('recaptcha_enabled') && $setting->getValue('recaptcha_ena
|
||||
}
|
||||
}
|
||||
|
||||
if ($setting->getValue('maintenance') && !$user->isAdmin($user->getUserIdByEmail($_POST['username']))) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'You are not allowed to login during maintenace.', 'TYPE' => 'info');
|
||||
} else if (!empty($_POST['username']) && !empty($_POST['password'])) {
|
||||
// Check if recaptcha is enabled, process form data if valid
|
||||
if (!$setting->getValue('recaptcha_enabled') || !$setting->getValue('recaptcha_enabled_logins') || ($setting->getValue('recaptcha_enabled') && $setting->getValue('recaptcha_enabled_logins') && $rsp->is_valid)) {
|
||||
if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) {
|
||||
// check if login is correct
|
||||
if ($user->checkLogin(@$_POST['username'], @$_POST['password']) ) {
|
||||
$port = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]);
|
||||
$location = (@$_SERVER['HTTPS'] == "on") ? 'https://' : 'http://';
|
||||
$location .= $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME'];
|
||||
$location.= '?page=dashboard';
|
||||
if (!headers_sent()) header('Location: ' . $location);
|
||||
exit('<meta http-equiv="refresh" content="0; url=' . htmlspecialchars($location) . '"/>');
|
||||
if (!empty($_POST['username']) && !empty($_POST['password'])) {
|
||||
if ($setting->getValue('maintenance') && !$user->isAdmin($user->getUserIdByEmail($_POST['username']))) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'You are not allowed to login during maintenace.', 'TYPE' => 'alert alert-info');
|
||||
} else {
|
||||
// Check if recaptcha is enabled, process form data if valid
|
||||
if (!$setting->getValue('recaptcha_enabled') || !$setting->getValue('recaptcha_enabled_logins') || ($setting->getValue('recaptcha_enabled') && $setting->getValue('recaptcha_enabled_logins') && $rsp->is_valid)) {
|
||||
if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) {
|
||||
// check if login is correct
|
||||
if ($user->checkLogin(@$_POST['username'], @$_POST['password']) ) {
|
||||
$port = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]);
|
||||
$location = (@$_SERVER['HTTPS'] == "on") ? 'https://' : 'http://';
|
||||
$location .= $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME'];
|
||||
$location.= '?page=dashboard';
|
||||
if (!headers_sent()) header('Location: ' . $location);
|
||||
exit('<meta http-equiv="refresh" content="0; url=' . htmlspecialchars($location) . '"/>');
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to login: '.$user->getError(), 'TYPE' => 'alert alert-danger');
|
||||
}
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to login: '.$user->getError(), 'TYPE' => 'alert alert-danger');
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => $csrftoken->getErrorWithDescriptionHTML(), 'TYPE' => 'alert alert-warning');
|
||||
}
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => $csrftoken->getErrorWithDescriptionHTML(), 'TYPE' => 'alert alert-warning');
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Invalid Captcha, please try again.', 'TYPE' => 'alert alert-danger');
|
||||
}
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Invalid Captcha, please try again.', 'TYPE' => 'alert alert-danger');
|
||||
}
|
||||
}
|
||||
// Load login template
|
||||
|
||||
19
scripts/test_email.php
Executable file
19
scripts/test_email.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
// Change to working directory
|
||||
chdir(dirname(__FILE__));
|
||||
|
||||
// Include all settings and classes
|
||||
require_once('shared.inc.php');
|
||||
|
||||
// Send email
|
||||
$aMailData = array(
|
||||
'email' => $setting->getValue('system_error_email'),
|
||||
'subject' => 'Test email from mining pool',
|
||||
'coinname' => $config['gettingstarted']['coinname'],
|
||||
'stratumurl' => $config['gettingstarted']['stratumurl'],
|
||||
'stratumport' => $config['gettingstarted']['stratumport']
|
||||
);
|
||||
|
||||
if (!$mail->sendMail('notifications/test_email', $aMailData))
|
||||
echo "Failed to send test email" . PHP_EOL;
|
||||
@ -242,7 +242,7 @@ CREATE TABLE IF NOT EXISTS `transactions` (
|
||||
CREATE TABLE `statistics_users` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` int(11) NOT NULL,
|
||||
`hashrate` int(11) NOT NULL,
|
||||
`hashrate` bigint(20) unsigned NOT NULL,
|
||||
`workers` int(11) NOT NULL,
|
||||
`sharerate` float NOT NULL,
|
||||
`timestamp` int(11) NOT NULL,
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<div class="panel-body">
|
||||
<ul>
|
||||
<li><b><i>Q: When will I get paid?</b></i></li>
|
||||
<b>A:</b> This pool uses the follwing payout system.<br>
|
||||
<b>A:</b> This pool uses the following payout system.<br>
|
||||
{if $GLOBAL.config.payout_system == 'prop'}
|
||||
<br>
|
||||
<b>Proportional (Prop)</b> - The block reward is distributed among miners in proportion to the number of shares they submitted in a round. The expected reward per share depends on the number of shares already submitted in the round.
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
|
||||
Please note: a {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} {$GLOBAL.config.currency} transaction will apply when processing "On-Demand" manual payments <span id="tt"><img width="15px" height="15px" title="This {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} manual payment transaction fee is a network fee and goes back into the network not the pool." src="site_assets/bootstrap/images/questionmark.png"></span>
|
||||
{if $GLOBAL.config.txfee_manual > 0}Please note: a {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} {$GLOBAL.config.currency} transaction will apply when processing "On-Demand" manual payments <span id="tt"><img width="15px" height="15px" title="This {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} manual payment transaction fee is a network fee and goes back into the network not the pool." src="site_assets/bootstrap/images/questionmark.png"></span>{/if}
|
||||
</p>
|
||||
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
|
||||
Minimum Cashout: {$GLOBAL.config.mp_threshold} {$GLOBAL.config.currency}
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<div class="form-group">
|
||||
<label>Automatic Payout Threshold</label>
|
||||
</br>
|
||||
<font size="1">{$GLOBAL.config.ap_threshold.min} - {$GLOBAL.config.ap_threshold.max} {$GLOBAL.config.currency}. Set to '0' for no auto payout. A {if $GLOBAL.config.txfee_auto > 0.00001}{$GLOBAL.config.txfee_auto}{else}{$GLOBAL.config.txfee_auto|number_format:"8"}{/if} {$GLOBAL.config.currency} TX fee will apply <span id="tt"><img width="15px" height="15px" title="This {if $GLOBAL.config.txfee_auto > 0.00001}{$GLOBAL.config.txfee_auto}{else}{$GLOBAL.config.txfee_auto|number_format:"8"}{/if} automatic payment transaction fee is a network fee and goes back into the network not the pool." src="site_assets/bootstrap/images/questionmark.png"></span></font>
|
||||
<font size="1">{$GLOBAL.config.ap_threshold.min} - {$GLOBAL.config.ap_threshold.max} {$GLOBAL.config.currency}. Set to '0' for no auto payout.{if $GLOBAL.config.txfee_auto > 0} A {if $GLOBAL.config.txfee_auto > 0.00001}{$GLOBAL.config.txfee_auto}{else}{$GLOBAL.config.txfee_auto|number_format:"8"}{/if} {$GLOBAL.config.currency} TX fee will apply <span id="tt"><img width="15px" height="15px" title="This {if $GLOBAL.config.txfee_auto > 0.00001}{$GLOBAL.config.txfee_auto}{else}{$GLOBAL.config.txfee_auto|number_format:"8"}{/if} automatic payment transaction fee is a network fee and goes back into the network not the pool." src="site_assets/bootstrap/images/questionmark.png"></span>{/if}</font>
|
||||
</br>
|
||||
<input class="form-control" type="text" name="payoutThreshold" value="{nocache}{$smarty.request.payoutThreshold|default:$GLOBAL.userdata.ap_threshold|escape}{/nocache}" size="{$GLOBAL.config.ap_threshold.max|strlen}" maxlength="{$GLOBAL.config.ap_threshold.max|strlen}" {if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.details && !$DETAILSUNLOCKED}id="disabledInput" disabled{/if}/>
|
||||
</div>
|
||||
@ -66,7 +66,6 @@
|
||||
<font size="1">The 4 digit PIN you chose when registering</font>
|
||||
<input class="form-control" type="password" name="authPin" size="4" maxlength="4">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,39 +1,46 @@
|
||||
<article class="module width_half">
|
||||
<form action="{$smarty.server.SCRIPT_NAME}" method="post">
|
||||
<div class="row">
|
||||
<form class="col-md-4" role="form" method="POST">
|
||||
<input type="hidden" name="token" value="{$smarty.request.token|escape}">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
|
||||
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
|
||||
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
|
||||
|
||||
|
||||
<input type="hidden" name="do" value="resetPassword">
|
||||
<header><h3>Password reset</h3></header>
|
||||
<div class="module_content">
|
||||
<fieldset>
|
||||
<label>New Password</label>
|
||||
<input type="password" name="newPassword" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Repeat New Password</label>
|
||||
<input type="password" name="newPassword2" required>
|
||||
</fieldset>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<footer>
|
||||
{nocache}
|
||||
<input type="hidden" name="cp_token" value="{$smarty.request.cp_token|escape|default:""}">
|
||||
<input type="hidden" name="utype" value="change_pw">
|
||||
{if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.changepw}
|
||||
{if $CHANGEPASSSENT == 1 && $CHANGEPASSUNLOCKED == 1}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm">
|
||||
{elseif $CHANGEPASSSENT == 0 && $CHANGEPASSUNLOCKED == 1 || $CHANGEPASSSENT == 1 && $CHANGEPASSUNLOCKED == 0}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm" disabled="disabled">
|
||||
{elseif $CHANGEPASSSENT == 0 && $CHANGEPASSUNLOCKED == 0}
|
||||
<input type="submit" value="Unlock" class="btn btn-warning btn-sm" name="unlock">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Password reset</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<fieldset>
|
||||
<label>New Password</label>
|
||||
<input class="form-control" type="password" name="newPassword" required>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<fieldset>
|
||||
<label>Repeat New Password</label>
|
||||
<input class="form-control" type="password" name="newPassword2" required>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
{nocache}
|
||||
<input type="hidden" name="cp_token" value="{$smarty.request.cp_token|escape|default:""}">
|
||||
<input type="hidden" name="utype" value="change_pw">
|
||||
{if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.changepw}
|
||||
{if $CHANGEPASSSENT == 1 && $CHANGEPASSUNLOCKED == 1}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm">
|
||||
{elseif $CHANGEPASSSENT == 0 && $CHANGEPASSUNLOCKED == 1 || $CHANGEPASSSENT == 1 && $CHANGEPASSUNLOCKED == 0}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm" disabled="disabled">
|
||||
{elseif $CHANGEPASSSENT == 0 && $CHANGEPASSUNLOCKED == 0}
|
||||
<input type="submit" value="Unlock" class="btn btn-warning btn-sm" name="unlock">
|
||||
{/if}
|
||||
{else}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm">
|
||||
{/if}
|
||||
{else}
|
||||
<input type="submit" value="Change Password" class="btn btn-warning btn-sm">
|
||||
{/if}
|
||||
{/nocache}
|
||||
</footer>
|
||||
{/nocache}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
6
templates/mail/notifications/test_email.tpl
Normal file
6
templates/mail/notifications/test_email.tpl
Normal file
@ -0,0 +1,6 @@
|
||||
{include file="../global/header.tpl"}
|
||||
<h1>Test email</h1>
|
||||
<p>If you see this email - your email protocol is configured correctly</p>
|
||||
<p>Coin name: {$DATA.coinname}</p>
|
||||
<p>Stratum: {$DATA.stratumurl}:{$DATA.stratumport}</p>
|
||||
{include file="../global/footer.tpl"}
|
||||
Loading…
Reference in New Issue
Block a user