LDAP: only try LDAP authentication when the realm is configured

This commit is contained in:
Andreas Rammhold 2020-09-12 19:56:46 +02:00
parent ee60f4ccd9
commit 6a07712e1d

View file

@ -29,7 +29,7 @@ sub login_POST {
error($c, "You must specify a user name.") if $username eq "";
error($c, "You must specify a password.") if $password eq "";
if ($c->authenticate({username => $username, password => $password}, 'ldap')) {
if ($c->get_auth_realm('ldap') && $c->authenticate({username => $username, password => $password}, 'ldap')) {
doLDAPLogin($self, $c, $username);
} elsif ($c->authenticate({username => $username, password => $password})) {}
else {