Admin Panel Setting to disable/enable AP/MP
This will allow admins to temporarily or permanantly enable and disable auto and manual payout processing. Fixes #488
This commit is contained in:
parent
43923fe4e9
commit
7fce187ab0
@ -22,6 +22,14 @@ limitations under the License.
|
|||||||
// Include all settings and classes
|
// Include all settings and classes
|
||||||
require_once('shared.inc.php');
|
require_once('shared.inc.php');
|
||||||
|
|
||||||
|
if ($setting->getValue('disable_ap') == 1) {
|
||||||
|
$log->logInfo(" auto payout disabled via admin panel");
|
||||||
|
$monitoring->setStatus($cron_name . "_active", "yesno", 0);
|
||||||
|
$monitoring->setStatus($cron_name . "_message", "message", "Auto-Payout disabled");
|
||||||
|
$monitoring->setStatus($cron_name . "_status", "okerror", 1);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if ($bitcoin->can_connect() !== true) {
|
if ($bitcoin->can_connect() !== true) {
|
||||||
$log->logFatal(" unable to connect to RPC server, exiting");
|
$log->logFatal(" unable to connect to RPC server, exiting");
|
||||||
$monitoring->setStatus($cron_name . "_active", "yesno", 0);
|
$monitoring->setStatus($cron_name . "_active", "yesno", 0);
|
||||||
@ -34,7 +42,7 @@ if ($bitcoin->can_connect() !== true) {
|
|||||||
$users = $user->getAllAutoPayout();
|
$users = $user->getAllAutoPayout();
|
||||||
|
|
||||||
// Quick summary
|
// Quick summary
|
||||||
$log->logInfo(" found " . count($users) . " queued payout(s)");
|
if (count($users) > 0) $log->logInfo(" found " . count($users) . " queued payout(s)");
|
||||||
|
|
||||||
// Go through users and run transactions
|
// Go through users and run transactions
|
||||||
if (! empty($users)) {
|
if (! empty($users)) {
|
||||||
|
|||||||
@ -12,6 +12,8 @@ if ($user->isAuthenticated()) {
|
|||||||
case 'cashOut':
|
case 'cashOut':
|
||||||
if ($setting->getValue('manual_payout_active') == 1) {
|
if ($setting->getValue('manual_payout_active') == 1) {
|
||||||
$_SESSION['POPUP'][] = array('CONTENT' => 'A manual payout is in progress. Please try again later.', 'TYPE' => 'errormsg');
|
$_SESSION['POPUP'][] = array('CONTENT' => 'A manual payout is in progress. Please try again later.', 'TYPE' => 'errormsg');
|
||||||
|
} else if ($setting->getValue('disable_mp') == 1) {
|
||||||
|
$_SESSION['POPUP'][] = array('CONTENT' => 'Manual payouts are disabled.', 'TYPE' => 'info');
|
||||||
} else {
|
} else {
|
||||||
$setting->setValue('manual_payout_active', 1);
|
$setting->setValue('manual_payout_active', 1);
|
||||||
$continue = true;
|
$continue = true;
|
||||||
|
|||||||
@ -20,6 +20,8 @@ if (@$_REQUEST['do'] == 'save' && !empty($_REQUEST['data'])) {
|
|||||||
$smarty->assign("MAINTENANCE", $setting->getValue('maintenance'));
|
$smarty->assign("MAINTENANCE", $setting->getValue('maintenance'));
|
||||||
$smarty->assign("LOCKREGISTRATION", $setting->getValue('lock_registration'));
|
$smarty->assign("LOCKREGISTRATION", $setting->getValue('lock_registration'));
|
||||||
$smarty->assign("DISABLEINVITATIONS", $setting->getValue('disable_invitations'));
|
$smarty->assign("DISABLEINVITATIONS", $setting->getValue('disable_invitations'));
|
||||||
|
$smarty->assign("DISABLEAP", $setting->getValue('disable_ap'));
|
||||||
|
$smarty->assign("DISABLEMP", $setting->getValue('disable_mp'));
|
||||||
|
|
||||||
// Tempalte specifics
|
// Tempalte specifics
|
||||||
$smarty->assign("CONTENT", "default.tpl");
|
$smarty->assign("CONTENT", "default.tpl");
|
||||||
|
|||||||
@ -46,6 +46,7 @@ $aGlobal = array(
|
|||||||
'price' => $setting->getValue('price'),
|
'price' => $setting->getValue('price'),
|
||||||
'blockexplorer' => $config['blockexplorer'],
|
'blockexplorer' => $config['blockexplorer'],
|
||||||
'chaininfo' => $config['chaininfo'],
|
'chaininfo' => $config['chaininfo'],
|
||||||
|
'disable_mp' => $setting->getValue('disable_mp'),
|
||||||
'config' => array(
|
'config' => array(
|
||||||
'website' => $config['website'],
|
'website' => $config['website'],
|
||||||
'accounts' => $config['accounts'],
|
'accounts' => $config['accounts'],
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
<input type="submit" class="submit long" value="Update Settings"></form>
|
<input type="submit" class="submit long" value="Update Settings"></form>
|
||||||
{include file="global/block_footer.tpl"}
|
{include file="global/block_footer.tpl"}
|
||||||
|
|
||||||
|
{if !$GLOBAL.disable_mp}
|
||||||
{include file="global/block_header.tpl" BLOCK_HEADER="Cash Out"}
|
{include file="global/block_header.tpl" BLOCK_HEADER="Cash Out"}
|
||||||
<ul><li><font color="">Please note: a {$GLOBAL.config.txfee} {$GLOBAL.config.currency} transaction will apply when processing "On-Demand" manual payments</font></li></ul>
|
<ul><li><font color="">Please note: a {$GLOBAL.config.txfee} {$GLOBAL.config.currency} transaction will apply when processing "On-Demand" manual payments</font></li></ul>
|
||||||
<form action="{$smarty.server.PHP_SELF}" method="post">
|
<form action="{$smarty.server.PHP_SELF}" method="post">
|
||||||
@ -33,6 +34,7 @@
|
|||||||
</tbody></table>
|
</tbody></table>
|
||||||
<input type="submit" class="submit mid" value="Cash Out"></form>
|
<input type="submit" class="submit mid" value="Cash Out"></form>
|
||||||
{include file="global/block_footer.tpl"}
|
{include file="global/block_footer.tpl"}
|
||||||
|
{/if}
|
||||||
|
|
||||||
{include file="global/block_header.tpl" BLOCK_HEADER="Change Password"}
|
{include file="global/block_header.tpl" BLOCK_HEADER="Change Password"}
|
||||||
<ul><li><font color="">Note: You will be redirected to login on successful completion of a password change</font></li></ul>
|
<ul><li><font color="">Note: You will be redirected to login on successful completion of a password change</font></li></ul>
|
||||||
|
|||||||
@ -40,6 +40,26 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="left">Disable Auto Payout</td>
|
||||||
|
<td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable or disable users to invite others. Configuration file defines number of allowed invitations.'></span></td>
|
||||||
|
<td>
|
||||||
|
<select name="data[disable_ap]">
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
<option value="0"{nocache}{if !$DISABLEAP} selected{/if}{/nocache}>No</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="left">Disable Manual Payout</td>
|
||||||
|
<td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable or disable users to invite others. Configuration file defines number of allowed invitations.'></span></td>
|
||||||
|
<td>
|
||||||
|
<select name="data[disable_mp]">
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
<option value="0"{nocache}{if !$DISABLEMP} selected{/if}{/nocache}>No</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr><td class="center" colspan="3"><input type="submit" value="Save" class="submit small" /></td></tr>
|
<tr><td class="center" colspan="3"><input type="submit" value="Save" class="submit small" /></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user