diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index c26e314c..0a66e831 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -27,6 +27,13 @@ $aSettings['website'][] = array( 'name' => 'system_motd_style', 'value' => $setting->getValue('system_motd_style'), 'tooltip' => 'Set the Style what MOTD looks like.' ); +$aSettings['website'][] = array( + 'display' => 'MOTD Dismiss', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'system_motd_dismiss', 'value' => $setting->getValue('system_motd_dismiss'), + 'tooltip' => 'Set if users can hide MOTD.' +); $aSettings['website'][] = array( 'display' => 'Website Name', 'type' => 'text', 'size' => 25, diff --git a/include/smarty_globals.inc.php b/include/smarty_globals.inc.php index 86a5f1d0..4b16205f 100644 --- a/include/smarty_globals.inc.php +++ b/include/smarty_globals.inc.php @@ -188,6 +188,11 @@ if (@$_SESSION['USERDATA']['id']) { if ($setting->getValue('maintenance')) $_SESSION['POPUP'][] = array('CONTENT' => 'This pool is currently in maintenance mode.', 'TYPE' => 'alert alert-warning'); if ($motd = $setting->getValue('system_motd')) { + if ($setting->getValue('system_motd_dismiss')) { + $motd_dismiss = "yes"; + } else { + $motd_dismiss = "no"; + } switch ($setting->getValue('system_motd_style', 0)) { case 0: $motd_style = "alert-success"; @@ -204,7 +209,7 @@ if ($motd = $setting->getValue('system_motd')) { default: $motd_style = "alert-info"; } - $_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => 'yes', 'ID' => 'motd', 'TYPE' => 'alert ' . $motd_style . ''); + $_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => $motd_dismiss, 'ID' => 'motd', 'TYPE' => 'alert ' . $motd_style . ''); } // check for deprecated theme diff --git a/scripts/force_payout.php b/scripts/force_payout.php new file mode 100644 index 00000000..cafbc888 --- /dev/null +++ b/scripts/force_payout.php @@ -0,0 +1,90 @@ +#!/usr/bin/php +logInfo("Starting Forced Payout..."); + +// Check and see if the sendmany RPC method is available +// This does not test if it actually works too! +$sendmanyAvailable = ((strpos($bitcoin->help('sendmany'), 'unknown') === FALSE) ? true : false); +if ($sendmanyAvailable) + $log->logDebug(' sendmany available in coind help command'); + +// Fetch all users +$users = $user->getAllAssoc(); + +if (!$payoutUsers) { + $mask = "| %6s | %20s | %30s | %20s | %15s |"; + $log->logInfo(sprintf($mask, 'ID', 'Username', 'eMail', 'Last Login', 'Balance')); +} else { + $mask = "| %20s | %15s | %50s |"; + $log->logInfo(sprintf($mask, 'Username', 'Balance', 'Transaction ID')); +} + +$totalSavings = 0; + +foreach ($users as $user) { + $id = $user['id']; + $username = $user['username']; + $lastLogin = $user['last_login']; + $coinAddress = $user['coin_address']; + $mailAddress = $user['email']; + + // get balances + $balances = $transaction->getBalance($id); + $confirmedBalance = $balances['confirmed']; + $totalSavings += $confirmedBalance; + + if(($balancedUsers || $payoutUsers) && $confirmedBalance == 0) + continue; + + if ($payoutUsers) { + if ($bitcoin->validateaddress($coinAddress)) { + $transaction_id = 0; + + $log->logInfo(sprintf($mask, $username, round($confirmedBalance,8), $transaction_id)); + + } else { + + $log->logFatal(' unable to payout user ' . $username . ', no valid payout address'); + + /* + $subject = "Account at " . $setting->getValue('website_name') . "!"; + $body = "Hi ". $username .",\n\nWe have discovered \ + your Payout Address as invalid and you have a Balance of ". $confirmedBalance . " " . $config['currency'] . " left on our Pool. \n + Please set a valid Payout Address at " . . " so we can send the Coins you have mined at our Pool \n\nCheers"; + + if (mail($mailAddress, $subject, $body)) { + echo("Email successfully sent!"); + } else { + echo("Email delivery failed..."); + } + */ + + } + } else { + $log->logInfo(sprintf($mask, $id, $username, $mailAddress, strftime("%Y-%m-%d %H:%M:%S", $lastLogin), round($confirmedBalance,8))); + } +} + +?>