Force unbind in LDAP configuration backend

This commit is contained in:
Clément Oudot 2009-06-15 15:16:12 +00:00
parent 36c9aa2409
commit 7c5d3dd7a4

View File

@ -44,6 +44,7 @@ sub available {
my ($cfgNum) = ( $cn =~ /lmConf-(\d*)/ ); my ($cfgNum) = ( $cn =~ /lmConf-(\d*)/ );
push @conf, $cfgNum; push @conf, $cfgNum;
} }
$self->ldap->unbind() && delete $self->{ldap};
return sort { $a <=> $b } @conf; return sort { $a <=> $b } @conf;
} }
@ -141,7 +142,7 @@ sub store {
); );
$self->logError($add) if ( $add->code ); $self->logError($add) if ( $add->code );
$self->ldap->unbind() && delete $self->{ldap};
$self->unlock; $self->unlock;
return $fields->{cfgNum}; return $fields->{cfgNum};
} }
@ -170,6 +171,7 @@ sub load {
$f->{$k} = $v; $f->{$k} = $v;
} }
} }
$self->ldap->unbind() && delete $self->{ldap};
return $f; return $f;
} }
@ -178,6 +180,7 @@ sub delete {
my $confDN = "cn=lmConf-" . $cfgNum . "," . $self->{ldapConfBase}; my $confDN = "cn=lmConf-" . $cfgNum . "," . $self->{ldapConfBase};
my $delete = $self->ldap->delete($confDN); my $delete = $self->ldap->delete($confDN);
$self->ldap->unbind() && delete $self->{ldap};
$self->logError($delete) if ( $delete->code ); $self->logError($delete) if ( $delete->code );
} }