diff --git a/public/include/classes/payout.class.php b/public/include/classes/payout.class.php index 96cd5141..02c7ae84 100644 --- a/public/include/classes/payout.class.php +++ b/public/include/classes/payout.class.php @@ -38,7 +38,7 @@ class Payout Extends Base { **/ public function createPayout($account_id=NULL, $strToken) { // 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'); $tExists = $this->token->doesTokenExist('withdraw_funds', $account_id); if (!is_array($tData) && $tExists == false) { @@ -50,7 +50,7 @@ class Payout Extends Base { $aData['subject'] = 'Manual payout request confirmation'; $this->mail->sendMail('notifications/withdraw_funds', $aData); $this->setErrorMessage("A confirmation has been sent to your e-mail"); - return false; + return true; } else { // already exists, if it's valid delete it and allow this edit if ($strToken === $tData['token']) { diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 9f026d59..99275636 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -275,7 +275,7 @@ class User extends Base { return false; } // 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'); $tExists = $this->token->doesTokenExist('change_pw', $userID); if (!is_array($tData) && $tExists == false) { @@ -287,7 +287,7 @@ class User extends Base { $aData['subject'] = 'Account password change confirmation'; $this->mail->sendMail('notifications/change_pw', $aData); $this->setErrorMessage("A confirmation has been sent to your e-mail"); - return false; + return true; } else { // already exists, if it's valid delete it and allow this edit if ($strToken === $tData['token']) { @@ -374,7 +374,7 @@ class User extends Base { $donate = min(100, max(0, floatval($donate))); // 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'); $tExists = $this->token->doesTokenExist('account_edit', $userID); if (!is_array($tData) && $tExists == false) { @@ -386,7 +386,7 @@ class User extends Base { $aData['subject'] = 'Account detail change confirmation'; $this->mail->sendMail('notifications/account_edit', $aData); $this->setErrorMessage("A confirmation has been sent to your e-mail"); - return false; + return true; } else { // already exists, if it's valid delete it and allow this edit if ($strToken === $tData['token']) { diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index 57ac68ba..07c20eb0 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -119,9 +119,9 @@ $config['coldwallet']['threshold'] = 5; * changepw = true */ $config['twofactor']['enabled'] = true; -$config['twofactor']['details'] = true; -$config['twofactor']['withdraw'] = true; -$config['twofactor']['changepw'] = true; +$config['twofactor']['options']['details'] = true; +$config['twofactor']['options']['withdraw'] = true; +$config['twofactor']['options']['changepw'] = true; /** * Lock account after maximum failed logins diff --git a/public/include/version.inc.php b/public/include/version.inc.php index f7feed1f..ffc53d5c 100644 --- a/public/include/version.inc.php +++ b/public/include/version.inc.php @@ -3,7 +3,6 @@ // Make sure we are called from index.php if (!defined('SECURITY')) die('Hacking attempt'); -define('DB_VERSION', '0.0.2'); define('CONFIG_VERSION', '0.0.3'); define('MPOS_VERSION', '0.0.1'); diff --git a/sql/013_tokentype_update.sql b/sql/013_tokentype_update.sql index 6c4e5c46..d1e09e20 100644 --- a/sql/013_tokentype_update.sql +++ b/sql/013_tokentype_update.sql @@ -1,3 +1,5 @@ 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 ('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;