diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index 1f2f617d6a..6143c9f4aa 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -103,6 +103,11 @@ sub checkpw_ldap { my ($dbh, $userid, $password) = @_; my @hosts = split(',', $prefhost); my $db = Net::LDAP->new(\@hosts); + unless ( $db ) { + warn "LDAP connexion failed"; + return 0; + } + #$debug and $db->debug(5); my $userldapentry;