Follow authentication process if password modification is OK (#345)

This commit is contained in:
Clément Oudot 2011-06-29 12:47:25 +00:00
parent 0d26de1f00
commit 9a2264927c
2 changed files with 22 additions and 2 deletions

View File

@ -34,7 +34,8 @@ sub menuInit {
$self->{user} = $self->{sessionInfo}->{_user};
# Try to change password
$self->{menuError} = $self->_subProcess(qw(passwordDBInit modifyPassword));
$self->{menuError} = $self->_subProcess(qw(passwordDBInit modifyPassword))
unless $self->{ignorePasswordChange};
# Default menu error code
$self->{menuError} ||= $self->{error};

View File

@ -1786,7 +1786,26 @@ sub passwordDBInit {
return $self->SUPER::passwordDBInit();
}
# modifyPassword(): must be implemented in PasswordDB* module
## @apmethod int modifyPassword()
# Call modifyPassword from PasswordDB* module
# Continue auth process if password change is ok
# @return Lemonldap::NG::Portal constant
sub modifyPassword {
my $self = shift;
my $res = $self->SUPER::modifyPassword();
# Continue process if password change is ok
if ( $res == PE_PASSWORD_OK ) {
# Set a flag to ignore password change in Menu
$self->{ignorePasswordChange} = 1;
return PE_OK;
}
return $res;
}
##@apmethod int setSessionInfo()
# Set ipAddr, xForwardedForAddr, startTime, updateTime, _utime and _userDB