forked from lix-project/hydra
Merge pull request #808 from andir/ldap
ldap: only try the LDAP realm when it is configured
This commit is contained in:
commit
733bbc131d
|
@ -425,7 +425,7 @@
|
||||||
binddn: "cn=root,dc=example"
|
binddn: "cn=root,dc=example"
|
||||||
bindpw: notapassword
|
bindpw: notapassword
|
||||||
start_tls: 0
|
start_tls: 0
|
||||||
start_tls_options
|
start_tls_options:
|
||||||
verify: none
|
verify: none
|
||||||
user_basedn: "ou=users,dc=example"
|
user_basedn: "ou=users,dc=example"
|
||||||
user_filter: "(&(objectClass=inetOrgPerson)(cn=%s))"
|
user_filter: "(&(objectClass=inetOrgPerson)(cn=%s))"
|
||||||
|
|
|
@ -29,7 +29,7 @@ sub login_POST {
|
||||||
error($c, "You must specify a user name.") if $username eq "";
|
error($c, "You must specify a user name.") if $username eq "";
|
||||||
error($c, "You must specify a password.") if $password 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);
|
doLDAPLogin($self, $c, $username);
|
||||||
} elsif ($c->authenticate({username => $username, password => $password})) {}
|
} elsif ($c->authenticate({username => $username, password => $password})) {}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue