mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-12-15 19:06:03 +00:00
[Web] fix set_tfa for ldap users
This commit is contained in:
@@ -1065,13 +1065,19 @@ function set_tfa($_data) {
|
|||||||
|
|
||||||
// check mailbox confirm password
|
// check mailbox confirm password
|
||||||
if ($access_denied === null) {
|
if ($access_denied === null) {
|
||||||
$stmt = $pdo->prepare("SELECT `password` FROM `mailbox`
|
$stmt = $pdo->prepare("SELECT `password`, `authsource` FROM `mailbox`
|
||||||
WHERE `username` = :username");
|
WHERE `username` = :username");
|
||||||
$stmt->execute(array(':username' => $username));
|
$stmt->execute(array(':username' => $username));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if ($row) {
|
if ($row) {
|
||||||
if (!verify_hash($row['password'], $_data["confirm_password"])) $access_denied = true;
|
if ($row['authsource'] == 'ldap'){
|
||||||
else $access_denied = false;
|
$iam_settings = identity_provider('get');
|
||||||
|
if (!ldap_mbox_login($username, $row['password'], $iam_settings)) $access_denied = true;
|
||||||
|
else $access_denied = false;
|
||||||
|
} else {
|
||||||
|
if (!verify_hash($row['password'], $_data["confirm_password"])) $access_denied = true;
|
||||||
|
else $access_denied = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user