Incremented version, moved config options, return vals fixed in 2f checks

This commit is contained in:
xisi 2014-01-15 03:07:43 -05:00
parent ef904858ae
commit bfd803ec28
5 changed files with 11 additions and 10 deletions

View File

@ -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']) {

View File

@ -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']) {

View File

@ -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

View File

@ -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');

View File

@ -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;