1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 04:32:01 +02:00

Merge pull request #3247 from SimSync/fix_3126_3143

Fixes #3126 & #3143 Backend used wrong field to hashword
This commit is contained in:
Cameron 2018-07-04 17:41:46 -07:00 committed by GitHub
commit 1b8f698b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -502,7 +502,13 @@ class users_admin_ui extends e_admin_ui
else
{
$new_data['user_password'] = e107::getUserSession()->HashPassword($new_data['user_password'], $new_data['user_login']);
// issues #3126, #3143: Login not working after admin set a new password using the backend
// Backend used user_login instead of user_loginname (used in usersettings) and did't escape the password.
$savePassword = $new_data['user_password'];
$loginname = $new_data['user_loginname'] ? $new_data['user_loginname'] : $old_data['user_loginname'];
$email = (isset($new_data['user_email']) && $new_data['user_email']) ? $new_data['user_email'] : $old_data['user_email'];
$new_data['user_password'] = e107::getDb()->escape(e107::getUserSession()->HashPassword($savePassword, $loginname), false);
e107::getMessage()->addDebug("Password Hash: ".$new_data['user_password']);
}