[Web] Remove redundant password hash checks (#4180)
Co-authored-by: Thomas Ramage <tramage@eucmail.com>
This commit is contained in:
@@ -979,13 +979,7 @@ function edit_user_account($_data) {
|
||||
if (password_check($password_new, $password_new2) !== true) {
|
||||
return false;
|
||||
}
|
||||
// support pre hashed passwords
|
||||
if (preg_match('/^{(ARGON2I|ARGON2ID|BLF-CRYPT|CLEAR|CLEARTEXT|CRYPT|DES-CRYPT|LDAP-MD5|MD5|MD5-CRYPT|PBKDF2|PLAIN|PLAIN-MD4|PLAIN-MD5|PLAIN-TRUNC|PLAIN-TRUNC|SHA|SHA1|SHA256|SHA256-CRYPT|SHA512|SHA512-CRYPT|SMD5|SSHA|SSHA256|SSHA512)}/i', $password)) {
|
||||
$password_hashed = $password_new;
|
||||
}
|
||||
else {
|
||||
$password_hashed = hash_password($password_new);
|
||||
}
|
||||
$password_hashed = hash_password($password_new);
|
||||
$stmt = $pdo->prepare("UPDATE `mailbox` SET `password` = :password_hashed,
|
||||
`attributes` = JSON_SET(`attributes`, '$.force_pw_update', '0'),
|
||||
`attributes` = JSON_SET(`attributes`, '$.passwd_update', NOW())
|
||||
|
Reference in New Issue
Block a user