Update session with pwd db (#595)

This commit is contained in:
Xavier Guimard 2016-07-13 05:10:57 +00:00
parent 3e0d98c14f
commit a802f60e6a
2 changed files with 16 additions and 4 deletions

View File

@ -181,7 +181,8 @@ sub getModule {
}
else {
my $s = ref( $self->$mod );
$s =~ s/^Lemonldap::NG::Portal::(?:(?:Issuer|UserDB|Auth)::)?//;
$s =~
s/^Lemonldap::NG::Portal::(?:(?:Issuer|UserDB|Auth|Password)::)?//;
return $s;
}
}

View File

@ -49,9 +49,20 @@ sub _modifyPassword {
$self->lmLog( 'Update password in session for ' . $req->user, 'debug' );
my $infos;
# TODO: verify newPassword ?
$self->p->updateSession( { _password => $req->{newpassword} } )
if ( $self->conf->{storePassword} );
# Store new password if asked
if ( $self->conf->{storePassword} ) {
$self->p->updateSession(
$req,
{
_passwordDB => $self->getModule( $req, 'password' ),
_password => $req->{newpassword}
}
);
}
else {
$self->p->updateSession( $req,
{ _passwordDB => $self->getModule( $req, 'password' ) } );
}
# Set a flag to ignore password change in Menu
$req->{ignorePasswordChange} = 1;