Commit 145fd0a6 by Daniel Ruf

moved $salt to else statement

parent d2e36229
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
{ {
require_once QA_INCLUDE_DIR.'util/string.php'; require_once QA_INCLUDE_DIR.'util/string.php';
$salt=isset($password) ? qa_random_alphanum(16) : null;
if(!qa_php_version_below('5.3.7')){ if(!qa_php_version_below('5.3.7')){
qa_db_query_sub( qa_db_query_sub(
'INSERT INTO ^users (created, createip, email, passhash, level, handle, loggedin, loginip) '. 'INSERT INTO ^users (created, createip, email, passhash, level, handle, loggedin, loginip) '.
...@@ -53,6 +51,8 @@ ...@@ -53,6 +51,8 @@
$ip, $email, isset($password) ? password_hash($password, PASSWORD_BCRYPT) : null, (int)$level, $handle, $ip $ip, $email, isset($password) ? password_hash($password, PASSWORD_BCRYPT) : null, (int)$level, $handle, $ip
); );
} else { } else {
$salt=isset($password) ? qa_random_alphanum(16) : null;
qa_db_query_sub( qa_db_query_sub(
'INSERT INTO ^users (created, createip, email, passsalt, passcheck, level, handle, loggedin, loginip) '. 'INSERT INTO ^users (created, createip, email, passsalt, passcheck, level, handle, loggedin, loginip) '.
'VALUES (NOW(), COALESCE(INET_ATON($), 0), $, $, UNHEX($), #, $, NOW(), COALESCE(INET_ATON($), 0))', 'VALUES (NOW(), COALESCE(INET_ATON($), 0), $, $, UNHEX($), #, $, NOW(), COALESCE(INET_ATON($), 0))',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment