mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-01-02 03:38:23 +02:00
[Web] check if $iam_provider is null on ldap_mbox_login
This commit is contained in:
parent
0b9b8c9060
commit
f9304dcd9b
@ -2,7 +2,7 @@
|
||||
function check_login($user, $pass, $app_passwd_data = false, $extra = null) {
|
||||
global $pdo;
|
||||
global $redis;
|
||||
|
||||
|
||||
$is_internal = $extra['is_internal'];
|
||||
$role = $extra['role'];
|
||||
|
||||
@ -194,7 +194,7 @@ function user_login($user, $pass, $extra = null){
|
||||
$result = ldap_mbox_login($user, $pass, $iam_settings, array('is_internal' => $is_internal, 'create' => true));
|
||||
if ($result !== false) return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($row['active'] != 1) {
|
||||
return false;
|
||||
}
|
||||
@ -313,7 +313,7 @@ function user_login($user, $pass, $extra = null){
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
function apppass_login($user, $pass, $app_passwd_data, $extra = null){
|
||||
@ -364,7 +364,7 @@ function apppass_login($user, $pass, $app_passwd_data, $extra = null){
|
||||
':user' => $user,
|
||||
));
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if ($protocol && $row[$protocol . '_access'] != '1'){
|
||||
continue;
|
||||
@ -476,7 +476,7 @@ function keycloak_mbox_login_rest($user, $pass, $iam_settings, $extra = null){
|
||||
}
|
||||
function ldap_mbox_login($user, $pass, $iam_settings, $extra = null){
|
||||
global $pdo;
|
||||
|
||||
|
||||
$iam_provider = identity_provider();
|
||||
$is_internal = $extra['is_internal'];
|
||||
$create = $extra['create'];
|
||||
@ -491,6 +491,9 @@ function ldap_mbox_login($user, $pass, $iam_settings, $extra = null){
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!$iam_provider) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$ldap_query = $iam_provider->query();
|
||||
|
Loading…
Reference in New Issue
Block a user