Do not use subroutine parameters to be compliant with Choice feature (#302)
This commit is contained in:
parent
4152643ddd
commit
6a1619be4e
|
@ -247,6 +247,7 @@ sub changePassword {
|
|||
|
||||
$self->{newpassword} = $password;
|
||||
$self->{confirmpassword} = $password;
|
||||
$self->{forceReset} = 1;
|
||||
}
|
||||
|
||||
# Else a password is required
|
||||
|
@ -256,7 +257,7 @@ sub changePassword {
|
|||
}
|
||||
|
||||
# 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
|
||||
if ( $result == PE_PASSWORD_OK ) {
|
||||
|
|
|
@ -30,12 +30,11 @@ sub passwordDBInit {
|
|||
PE_OK;
|
||||
}
|
||||
|
||||
## @apmethod int modifyPassword(boolean reset)
|
||||
## @apmethod int modifyPassword()
|
||||
# Modify the password by LDAP mechanism.
|
||||
# @param reset Force pwdReset flag to TRUE
|
||||
# @return Lemonldap::NG::Portal constant
|
||||
sub modifyPassword {
|
||||
my ($self,$reset) = splice @_;
|
||||
my $self = shift;
|
||||
|
||||
# Exit method if no password change requested
|
||||
return PE_OK unless ( $self->{newpassword} );
|
||||
|
@ -66,8 +65,8 @@ sub modifyPassword {
|
|||
|
||||
return $code unless ( $code == PE_PASSWORD_OK );
|
||||
|
||||
# If Password Policy and reset asked, set the PwdReset flag
|
||||
if ( $self->{ldapPpolicyControl} and $reset) {
|
||||
# If password policy and force reset, set pwdReset flag
|
||||
if ( $self->{ldapPpolicyControl} and $self->{forceReset} ) {
|
||||
my $result =
|
||||
$self->ldap->modify( $self->{dn},
|
||||
replace => { 'pwdReset' => 'TRUE' } );
|
||||
|
|
Loading…
Reference in New Issue
Block a user