support pre-hashed passwords (#3884)

master
Joerg Lehmann 2020-12-02 20:32:39 +01:00 committed by GitHub
parent 6f6f52f380
commit bcffebaabe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1054,7 +1054,12 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
);
return false;
}
$password_hashed = hash_password($password);
// support pre hashed passwords
if(preg_match('/^{SSHA256}|{SHA512-CRYPT}|{SSHA512}|{MD5-CRYPT}|{PLAIN-MD5}/i', $password)) {
$password_hashed = $password;
} else {
$password_hashed = hash_password($password);
}
}
else {
$_SESSION['return'][] = array(