Commit 121e2542 authored by Clément OUDOT's avatar Clément OUDOT

Do not disconnect from LDAP if password modification fails (#1644)

parent 51a9488b
Pipeline #4262 passed with stages
in 10 minutes and 10 seconds
......@@ -8,7 +8,7 @@ use Lemonldap::NG::Portal::Main::Constants
extends 'Lemonldap::NG::Portal::Lib::LDAP',
'Lemonldap::NG::Portal::Password::Base';
our $VERSION = '2.0.0';
our $VERSION = '2.0.2';
sub init {
my ($self) = @_;
......@@ -36,8 +36,6 @@ sub modifyPassword {
1 );
unless ( $code == PE_PASSWORD_OK ) {
$self->ldap->unbind;
$self->{flags}->{ldapActive} = 0;
return $code;
}
......@@ -53,8 +51,6 @@ sub modifyPassword {
unless ( $result->code == 0 ) {
$self->logger->error(
"LDAP modify pwdLastSet error: " . $result->code );
$self->ldap->unbind;
$self->{flags}->{ldapActive} = 0;
return PE_LDAPERROR;
}
......
......@@ -8,7 +8,7 @@ use Lemonldap::NG::Portal::Main::Constants
extends 'Lemonldap::NG::Portal::Lib::LDAP',
'Lemonldap::NG::Portal::Password::Base';
our $VERSION = '2.0.0';
our $VERSION = '2.0.2';
sub init {
my ($self) = @_;
......@@ -43,8 +43,6 @@ sub modifyPassword {
$self->ldap->userModifyPassword( $dn, $pwd, $req->data->{oldpassword} );
unless ( $code == PE_PASSWORD_OK ) {
$self->ldap->unbind;
$self->{flags}->{ldapActive} = 0;
return $code;
}
......@@ -66,8 +64,6 @@ sub modifyPassword {
. $self->conf->{ldapPasswordResetAttribute}
. " error: "
. $result->code );
$self->ldap->unbind;
$self->{flags}->{ldapActive} = 0;
return PE_LDAPERROR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment