Do not use subroutine parameters to be compliant with Choice feature (#302)

This commit is contained in:
Clément Oudot 2011-05-30 20:53:03 +00:00
parent 4152643ddd
commit 6a1619be4e
2 changed files with 6 additions and 6 deletions

View File

@ -247,6 +247,7 @@ sub changePassword {
$self->{newpassword} = $password; $self->{newpassword} = $password;
$self->{confirmpassword} = $password; $self->{confirmpassword} = $password;
$self->{forceReset} = 1;
} }
# Else a password is required # Else a password is required
@ -256,7 +257,7 @@ sub changePassword {
} }
# Modify the password # Modify the password
my $result = $self->modifyPassword( $self->param('reset') ); 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 ) { if ( $result == PE_PASSWORD_OK ) {

View File

@ -30,12 +30,11 @@ sub passwordDBInit {
PE_OK; PE_OK;
} }
## @apmethod int modifyPassword(boolean reset) ## @apmethod int modifyPassword()
# Modify the password by LDAP mechanism. # Modify the password by LDAP mechanism.
# @param reset Force pwdReset flag to TRUE
# @return Lemonldap::NG::Portal constant # @return Lemonldap::NG::Portal constant
sub modifyPassword { sub modifyPassword {
my ($self,$reset) = splice @_; my $self = shift;
# Exit method if no password change requested # Exit method if no password change requested
return PE_OK unless ( $self->{newpassword} ); return PE_OK unless ( $self->{newpassword} );
@ -66,8 +65,8 @@ sub modifyPassword {
return $code unless ( $code == PE_PASSWORD_OK ); return $code unless ( $code == PE_PASSWORD_OK );
# If Password Policy and reset asked, set the PwdReset flag # If password policy and force reset, set pwdReset flag
if ( $self->{ldapPpolicyControl} and $reset) { if ( $self->{ldapPpolicyControl} and $self->{forceReset} ) {
my $result = my $result =
$self->ldap->modify( $self->{dn}, $self->ldap->modify( $self->{dn},
replace => { 'pwdReset' => 'TRUE' } ); replace => { 'pwdReset' => 'TRUE' } );