Fix LDAP with internal users (#4453)
* added logging, in case Laminas libs are not available * make sure that internal users can still login if LDAP is activated
This commit is contained in:
@@ -62,12 +62,12 @@ final class LdapCredentialsSubscriber implements EventSubscriberInterface
|
||||
throw new BadCredentialsException('The presented user needs to be a Kimai user.');
|
||||
}
|
||||
|
||||
// removing this code allows to upgrade from local to LDAP users
|
||||
// if (!$user->isLdapUser()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!$this->ldapManager->bind($user->getUserIdentifier(), $presentedPassword)) {
|
||||
// if the login failed and the user is registered with "kimai" auth, simply return:
|
||||
// the FormLogin authenticator will take over and the user can log in via internal database
|
||||
if (!$user->isLdapUser()) {
|
||||
return;
|
||||
}
|
||||
throw new BadCredentialsException('The presented password is invalid.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user