Bug 10384: fall back to normal authentication if LDAP server is not available
[koha.git] / C4 / Auth_with_ldap.pm
index 1f2f617..6143c9f 100644 (file)
@@ -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;