Browse Source

* LDV::LDAP : properly disconnect

master
Alex 'AdUser' Z 10 years ago
parent
commit
0683c0caaf
  1. 4
      lib/LDV/LDAP.pm

4
lib/LDV/LDAP.pm

@ -68,6 +68,7 @@ sub create {
sn => 'created', sn => 'created',
]); ]);
$conn->unbind; $conn->unbind;
$conn->disconnect;
return $result->error if ($result->code); return $result->error if ($result->code);
return; return;
} }
@ -79,6 +80,7 @@ sub delete {
my $dn = $self->_uid_to_dn($uid); my $dn = $self->_uid_to_dn($uid);
my $result = $conn->delete($dn); my $result = $conn->delete($dn);
$conn->unbind; $conn->unbind;
$conn->disconnect;
return $result->error if ($result->code); return $result->error if ($result->code);
return; return;
} }
@ -90,6 +92,7 @@ sub get {
my $mesg = $conn->search(base => $self->{userbase}, scope => 'one', my $mesg = $conn->search(base => $self->{userbase}, scope => 'one',
deref => 'never', filter => $filter); deref => 'never', filter => $filter);
$conn->unbind; $conn->unbind;
$conn->disconnect;
return unless $mesg->count; return unless $mesg->count;
my $entry = $mesg->pop_entry(); my $entry = $mesg->pop_entry();
my $data = {}; my $data = {};
@ -136,6 +139,7 @@ sub update {
} }
my $result = $conn->modify($dn, changes => \@chg); my $result = $conn->modify($dn, changes => \@chg);
$conn->unbind; $conn->unbind;
$conn->disconnect;
return $result->error if ($result->code); return $result->error if ($result->code);
return; return;

Loading…
Cancel
Save