Disable 2FA through Email Fix #249

And fixed an issue with email activation link when registering an account.
This commit is contained in:
Znote
2017-01-21 23:08:46 +01:00
parent 013e8f1174
commit d5cabac14a
4 changed files with 100 additions and 31 deletions

View File

@@ -1173,11 +1173,12 @@ function user_create_account($register_data, $maildata) {
$account_id = user_id($register_data['name']);
$activeKey = rand(100000000,999999999);
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `activekey`, `flag`) VALUES ('$account_id', '$ip', '$created', '$activeKey', '$flag')");
$active = ($maildata['register']) ? 0 : 1;
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `active`, `activekey`, `flag`) VALUES ('$account_id', '$ip', '$created', '$active', '$activeKey', '$flag')");
if ($maildata['register']) {
$thisurl = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$thisurl = config('site_url') . "$_SERVER[REQUEST_URI]";
$thisurl .= "?authenticate&u=".$account_id."&k=".$activeKey;
$mailer = new Mail($maildata);