Commit c88fb8ba by Scott

Replace version checks with predefined constant

parent f2e6f702
......@@ -44,7 +44,7 @@
{
require_once QA_INCLUDE_DIR.'util/string.php';
if (!qa_php_version_below('5.3.7')) {
if (QA_PASSWORD_HASH) {
qa_db_query_sub(
'INSERT INTO ^users (created, createip, email, passhash, level, handle, loggedin, loginip) '.
'VALUES (NOW(), COALESCE(INET_ATON($), 0), $, $, #, $, NOW(), COALESCE(INET_ATON($), 0))',
......@@ -163,7 +163,7 @@
require_once QA_INCLUDE_DIR.'util/string.php';
if (!qa_php_version_below('5.3.7')) {
if (QA_PASSWORD_HASH) {
qa_db_query_sub(
'UPDATE ^users SET passhash=$, passsalt=NULL, passcheck=NULL WHERE userid=$',
password_hash($password, PASSWORD_BCRYPT), $userid
......
......@@ -56,7 +56,7 @@
$doconfirms = qa_opt('confirm_user_emails') && $useraccount['level'] < QA_USER_LEVEL_EXPERT;
$isconfirmed = ($useraccount['flags'] & QA_USER_FLAGS_EMAIL_CONFIRMED) ? true : false;
if (!qa_php_version_below('5.3.7')) {
if (QA_PASSWORD_HASH) {
$haspasswordold = isset($useraccount['passsalt']) && isset($useraccount['passcheck']);
$haspassword = isset($useraccount['passhash']);
} else {
......@@ -211,7 +211,7 @@
else {
$errors = array();
if (!qa_php_version_below('5.3.7')) {
if (QA_PASSWORD_HASH) {
if (
($haspasswordold && (strtolower(qa_db_calc_passcheck($inoldpassword, $useraccount['passsalt'])) != strtolower($useraccount['passcheck']))) ||
(!$haspasswordold && $haspassword && !password_verify($inoldpassword,$useraccount['passhash']))
......
......@@ -68,7 +68,7 @@
$inuserid=$matchusers[0];
$userinfo=qa_db_select_with_pending(qa_db_user_account_selectspec($inuserid, true));
if (!qa_php_version_below('5.3.7')) {
if (QA_PASSWORD_HASH) {
$haspassword=isset($userinfo['passhash']);
$haspasswordold=isset($userinfo['passsalt']) && isset($userinfo['passcheck']);
......
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