- [LEMONLDAP-515] Parameter portalRequireOldPassword is now checked in DBI
This commit is contained in:
parent
3780671816
commit
8224d225d4
|
@ -321,8 +321,9 @@ sub changePassword {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Modify the password
|
# Modify the password
|
||||||
|
$self->{portalRequireOldPassword} = 0;
|
||||||
my $result = $self->modifyPassword();
|
my $result = $self->modifyPassword();
|
||||||
|
|
||||||
# Mail token can be used only one time, delete the session if all is ok
|
# Mail token can be used only one time, delete the session if all is ok
|
||||||
if ( $result == PE_PASSWORD_OK or $result == PE_OK ) {
|
if ( $result == PE_PASSWORD_OK or $result == PE_OK ) {
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,14 @@ sub modifyPassword {
|
||||||
# Exit if no password change requested
|
# Exit if no password change requested
|
||||||
return PE_OK unless ( $self->{newpassword} );
|
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
|
# Verify confirmation password matching
|
||||||
return PE_PASSWORD_MISMATCH
|
return PE_PASSWORD_MISMATCH
|
||||||
unless ( $self->{newpassword} eq $self->{confirmpassword} );
|
unless ( $self->{newpassword} eq $self->{confirmpassword} );
|
||||||
|
|
|
@ -35,6 +35,14 @@ sub modifyPassword {
|
||||||
|
|
||||||
# Exit if no password change requested
|
# Exit if no password change requested
|
||||||
return PE_OK unless ( $self->{newpassword} );
|
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
|
# Verify confirmation password matching
|
||||||
return PE_PASSWORD_MISMATCH
|
return PE_PASSWORD_MISMATCH
|
||||||
|
|
Loading…
Reference in New Issue
Block a user