Commit 0fe2fc1d authored by Clément OUDOT's avatar Clément OUDOT

Bypass error screen for LDAP password reset (#1639)

parent 121e2542
Pipeline #4263 passed with stages
in 10 minutes and 2 seconds
...@@ -5,7 +5,7 @@ use Mouse; ...@@ -5,7 +5,7 @@ use Mouse;
use Lemonldap::NG::Portal::Main::Constants use Lemonldap::NG::Portal::Main::Constants
qw(PE_OK PE_LDAPCONNECTFAILED PE_PP_CHANGE_AFTER_RESET PE_PP_PASSWORD_EXPIRED); qw(PE_OK PE_LDAPCONNECTFAILED PE_PP_CHANGE_AFTER_RESET PE_PP_PASSWORD_EXPIRED);
our $VERSION = '2.0.0'; our $VERSION = '2.0.2';
# Inheritance: UserDB::LDAP provides all needed ldap functions # Inheritance: UserDB::LDAP provides all needed ldap functions
extends extends
...@@ -38,12 +38,15 @@ sub authenticate { ...@@ -38,12 +38,15 @@ sub authenticate {
password => $req->data->{password} ); password => $req->data->{password} );
# Remember password if password reset needed # Remember password if password reset needed
$req->data->{oldpassword} = $self->{password} if (
if (
$res == PE_PP_CHANGE_AFTER_RESET $res == PE_PP_CHANGE_AFTER_RESET
or ( $res == PE_PP_PASSWORD_EXPIRED or ( $res == PE_PP_PASSWORD_EXPIRED
and $self->conf->{ldapAllowResetExpiredPassword} ) and $self->conf->{ldapAllowResetExpiredPassword} )
); )
{
$req->data->{oldpassword} = $self->{password};
$req->data->{noerror} = 1;
}
return $res; return $res;
......
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