Incremented version, moved config options, return vals fixed in 2f checks
This commit is contained in:
parent
ef904858ae
commit
bfd803ec28
@ -38,7 +38,7 @@ class Payout Extends Base {
|
|||||||
**/
|
**/
|
||||||
public function createPayout($account_id=NULL, $strToken) {
|
public function createPayout($account_id=NULL, $strToken) {
|
||||||
// twofactor - if cashout enabled we need to create/check the token
|
// twofactor - if cashout enabled we need to create/check the token
|
||||||
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['withdraw']) {
|
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['options']['withdraw']) {
|
||||||
$tData = $this->token->getToken($strToken, 'withdraw_funds');
|
$tData = $this->token->getToken($strToken, 'withdraw_funds');
|
||||||
$tExists = $this->token->doesTokenExist('withdraw_funds', $account_id);
|
$tExists = $this->token->doesTokenExist('withdraw_funds', $account_id);
|
||||||
if (!is_array($tData) && $tExists == false) {
|
if (!is_array($tData) && $tExists == false) {
|
||||||
@ -50,7 +50,7 @@ class Payout Extends Base {
|
|||||||
$aData['subject'] = 'Manual payout request confirmation';
|
$aData['subject'] = 'Manual payout request confirmation';
|
||||||
$this->mail->sendMail('notifications/withdraw_funds', $aData);
|
$this->mail->sendMail('notifications/withdraw_funds', $aData);
|
||||||
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// already exists, if it's valid delete it and allow this edit
|
// already exists, if it's valid delete it and allow this edit
|
||||||
if ($strToken === $tData['token']) {
|
if ($strToken === $tData['token']) {
|
||||||
|
|||||||
@ -275,7 +275,7 @@ class User extends Base {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// twofactor - if changepw is enabled we need to create/check the token
|
// twofactor - if changepw is enabled we need to create/check the token
|
||||||
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['changepw']) {
|
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['options']['changepw']) {
|
||||||
$tData = $this->token->getToken($strToken, 'change_pw');
|
$tData = $this->token->getToken($strToken, 'change_pw');
|
||||||
$tExists = $this->token->doesTokenExist('change_pw', $userID);
|
$tExists = $this->token->doesTokenExist('change_pw', $userID);
|
||||||
if (!is_array($tData) && $tExists == false) {
|
if (!is_array($tData) && $tExists == false) {
|
||||||
@ -287,7 +287,7 @@ class User extends Base {
|
|||||||
$aData['subject'] = 'Account password change confirmation';
|
$aData['subject'] = 'Account password change confirmation';
|
||||||
$this->mail->sendMail('notifications/change_pw', $aData);
|
$this->mail->sendMail('notifications/change_pw', $aData);
|
||||||
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// already exists, if it's valid delete it and allow this edit
|
// already exists, if it's valid delete it and allow this edit
|
||||||
if ($strToken === $tData['token']) {
|
if ($strToken === $tData['token']) {
|
||||||
@ -374,7 +374,7 @@ class User extends Base {
|
|||||||
$donate = min(100, max(0, floatval($donate)));
|
$donate = min(100, max(0, floatval($donate)));
|
||||||
|
|
||||||
// twofactor - if details enabled we need to create/check the token
|
// twofactor - if details enabled we need to create/check the token
|
||||||
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['details']) {
|
if ($this->config['twofactor']['enabled'] && $this->config['twofactor']['options']['details']) {
|
||||||
$tData = $this->token->getToken($strToken, 'account_edit');
|
$tData = $this->token->getToken($strToken, 'account_edit');
|
||||||
$tExists = $this->token->doesTokenExist('account_edit', $userID);
|
$tExists = $this->token->doesTokenExist('account_edit', $userID);
|
||||||
if (!is_array($tData) && $tExists == false) {
|
if (!is_array($tData) && $tExists == false) {
|
||||||
@ -386,7 +386,7 @@ class User extends Base {
|
|||||||
$aData['subject'] = 'Account detail change confirmation';
|
$aData['subject'] = 'Account detail change confirmation';
|
||||||
$this->mail->sendMail('notifications/account_edit', $aData);
|
$this->mail->sendMail('notifications/account_edit', $aData);
|
||||||
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
$this->setErrorMessage("A confirmation has been sent to your e-mail");
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// already exists, if it's valid delete it and allow this edit
|
// already exists, if it's valid delete it and allow this edit
|
||||||
if ($strToken === $tData['token']) {
|
if ($strToken === $tData['token']) {
|
||||||
|
|||||||
@ -119,9 +119,9 @@ $config['coldwallet']['threshold'] = 5;
|
|||||||
* changepw = true
|
* changepw = true
|
||||||
*/
|
*/
|
||||||
$config['twofactor']['enabled'] = true;
|
$config['twofactor']['enabled'] = true;
|
||||||
$config['twofactor']['details'] = true;
|
$config['twofactor']['options']['details'] = true;
|
||||||
$config['twofactor']['withdraw'] = true;
|
$config['twofactor']['options']['withdraw'] = true;
|
||||||
$config['twofactor']['changepw'] = true;
|
$config['twofactor']['options']['changepw'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lock account after maximum failed logins
|
* Lock account after maximum failed logins
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
// Make sure we are called from index.php
|
// Make sure we are called from index.php
|
||||||
if (!defined('SECURITY')) die('Hacking attempt');
|
if (!defined('SECURITY')) die('Hacking attempt');
|
||||||
|
|
||||||
define('DB_VERSION', '0.0.2');
|
|
||||||
define('CONFIG_VERSION', '0.0.3');
|
define('CONFIG_VERSION', '0.0.3');
|
||||||
define('MPOS_VERSION', '0.0.1');
|
define('MPOS_VERSION', '0.0.1');
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('account_edit', 360);
|
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('account_edit', 360);
|
||||||
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('change_pw', 360);
|
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('change_pw', 360);
|
||||||
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('withdraw_funds', 360);
|
INSERT INTO `token_types` (`name`, `expiration`) VALUES ('withdraw_funds', 360);
|
||||||
|
INSERT INTO `settings` (`name`, `value`) VALUES ('DB_VERSION', '0.0.3') ON DUPLICATE KEY UPDATE `value` = '0.0.3';
|
||||||
|
INSERT INTO `settings` (`name`, `value`) VALUES ('db_upgrade_required', 0) ON DUPLICATE KEY UPDATE `value` = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user