Changeset 2004


Ignore:
Timestamp:
04/28/17 10:54:46 (7 years ago)
Author:
nanardon
Message:

Properly identifie user changing password

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/Accounts.pm

    r2002 r2004  
    175175 
    176176sub ChangeUserPassword { 
    177     my ($self, $username, $password) = @_; 
     177    my ($self, $username, $password, $force) = @_; 
    178178 
    179179    my $base = $self->db; 
     
    187187    # synchaccess do not manage connect() at time, opening a 
    188188    # backdoor then :\ 
    189     foreach ($sync->bases) { $_->{_user} = undef } 
     189    foreach ($sync->bases) { $_->{_user} = $base->{_user} } 
    190190 
    191191    my $suser = $sync->get_object_ifexists('user', $username); 
    192192    my $msg = $user->check_password($password); 
    193     if ($msg ne 'ok') { 
     193    if ($msg ne 'ok' && !$force) { 
    194194        return $msg . ', mot de passe inchangé'; 
    195195    } elsif ($suser && $suser->_set_password($password)) { 
Note: See TracChangeset for help on using the changeset viewer.