summaryrefslogtreecommitdiff
path: root/lib/Kolab/LDAP.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Kolab/LDAP.pm')
-rw-r--r--lib/Kolab/LDAP.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm
index d3426d1..8756be0 100644
--- a/lib/Kolab/LDAP.pm
+++ b/lib/Kolab/LDAP.pm
@@ -321,7 +321,7 @@ sub create
timeout => 20,
async => $as,
verify => 'none',
- onerror => 'undef'
+ onerror => \&ldap_error
);
} else {
$ldap = Net::LDAP->new(
@@ -330,7 +330,7 @@ sub create
version => 3,
timeout => 20,
async => $as,
- onerror => 'undef'
+ onerror => \&ldap_error
);
}
if (!$ldap) {
@@ -356,7 +356,6 @@ sub destroy
my $ldap = shift;
if (defined($ldap) && ($ldap->isa('Net::LDAP') || $ldap->isa('Net::LDAPS'))) {
- $ldap->abandon;
$ldap->unbind;
$ldap->disconnect;
}
@@ -1009,6 +1008,14 @@ sub make_salt {
return join "", @tab[ map {rand 64} (1 .. $length) ];
}
+sub ldap_error {
+ my $mesg = shift;
+ my $errstr = $mesg->dn || '';
+ $errstr .= ": " if $errstr;
+ $errstr .= $mesg->error if $mesg->error;
+ Kolab::log('L', $errstr, KOLAB_ERROR);
+}
+
1;
__END__