Lines 48-53
use Koha::Patron::HouseboundRoles;
Link Here
|
48 |
use Koha::Policy::Patrons::Cardnumber; |
48 |
use Koha::Policy::Patrons::Cardnumber; |
49 |
use Koha::Plugins; |
49 |
use Koha::Plugins; |
50 |
use Koha::SMS::Providers; |
50 |
use Koha::SMS::Providers; |
|
|
51 |
use Koha::PatronPasswordHistories; |
51 |
|
52 |
|
52 |
my $input = CGI->new; |
53 |
my $input = CGI->new; |
53 |
my %data; |
54 |
my %data; |
Lines 391-396
if ( $op eq 'cud-save' || $op eq 'cud-insert' ) {
Link Here
|
391 |
push @errors, 'ERROR_password_too_weak' if $error eq 'too_weak'; |
392 |
push @errors, 'ERROR_password_too_weak' if $error eq 'too_weak'; |
392 |
push @errors, 'ERROR_password_has_whitespaces' if $error eq 'has_whitespaces'; |
393 |
push @errors, 'ERROR_password_has_whitespaces' if $error eq 'has_whitespaces'; |
393 |
} |
394 |
} |
|
|
395 |
|
396 |
# Check password history |
397 |
if ($patron && $is_valid) { # Only check if other validations passed and we have a patron |
398 |
my $is_used = Koha::PatronPasswordHistories->has_used_password({ |
399 |
borrowernumber => $patron->borrowernumber, |
400 |
password => $password, |
401 |
current_password => $patron->password |
402 |
}); |
403 |
|
404 |
if ($is_used) { |
405 |
push @errors, 'ERROR_password_used_before'; |
406 |
my $count = C4::Context->preference('PasswordHistoryCount') || 0; |
407 |
$template->param( password_history_count => $count ); |
408 |
} |
409 |
} |
394 |
} |
410 |
} |
395 |
|
411 |
|
396 |
# Validate emails |
412 |
# Validate emails |
Lines 611-619
if ( ( !$nok ) and $nodouble and ( $op eq 'cud-insert' or $op eq 'cud-save' ) )
Link Here
|
611 |
} |
627 |
} |
612 |
} |
628 |
} |
613 |
|
629 |
|
614 |
# should never raise an exception as password validity is checked above |
630 |
# password validity has been checked above |
615 |
my $password = $newdata{password}; |
631 |
my $password = $newdata{password}; |
616 |
if ( $password and $password ne '****' ) { |
632 |
if ( $password and $password ne '****' and $success ) { |
617 |
$patron->set_password( { password => $password } ); |
633 |
$patron->set_password( { password => $password } ); |
618 |
} |
634 |
} |
619 |
|
635 |
|
620 |
- |
|
|