- [LEMONLDAP-515] Parameter portalRequireOldPassword is now checked in DBI

This commit is contained in:
Sandro Cazzaniga 2012-08-31 13:00:06 +00:00
parent 3780671816
commit 8224d225d4
3 changed files with 18 additions and 1 deletions

View File

@ -321,8 +321,9 @@ sub changePassword {
}
# Modify the password
$self->{portalRequireOldPassword} = 0;
my $result = $self->modifyPassword();
# Mail token can be used only one time, delete the session if all is ok
if ( $result == PE_PASSWORD_OK or $result == PE_OK ) {

View File

@ -41,6 +41,14 @@ sub modifyPassword {
# Exit if no password change requested
return PE_OK unless ( $self->{newpassword} );
# Check if portal require old password
if ( $self->{portalRequireOldPassword } ) {
unless ( $self->{oldpassword} ) {
$self->lmLog( "Portal require old password", 'error' );
return PE_PP_MUST_SUPPLY_OLD_PASSWORD;
}
}
# Verify confirmation password matching
return PE_PASSWORD_MISMATCH
unless ( $self->{newpassword} eq $self->{confirmpassword} );

View File

@ -35,6 +35,14 @@ sub modifyPassword {
# Exit if no password change requested
return PE_OK unless ( $self->{newpassword} );
# Check if portal require old password
if ( $self->{portalRequireOldPassword} ) {
unless ( $self->{oldpassword} ) {
$self->lmLog( "Portal require old password", 'error');
return PE_PP_MUST_SUPPLY_OLD_PASSSWORD;
}
}
# Verify confirmation password matching
return PE_PASSWORD_MISMATCH