View | Details | Raw Unified | Return to bug 40824
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+6 lines)
Lines 203-208 Link Here
203
                                [% IF ( ERROR_invalid_relationship ) %]
203
                                [% IF ( ERROR_invalid_relationship ) %]
204
                                    <li id="ERROR_invalid_relationship">Guarantor relationship cannot be left blank according to configuration.</li>
204
                                    <li id="ERROR_invalid_relationship">Guarantor relationship cannot be left blank according to configuration.</li>
205
                                [% END %]
205
                                [% END %]
206
                                [% IF ( ERROR_password_used_before ) %]
207
                                    <li id="ERROR_used_before">This password has been used before. You cannot reuse any of your last [% password_history_count | html %] passwords.</li>
208
                                [% END %]
206
                            </ul>
209
                            </ul>
207
                        </div>
210
                        </div>
208
                    [% END %]
211
                    [% END %]
Lines 1234-1239 Link Here
1234
                                                [% IF ( ERROR_password_has_whitespaces ) %]
1237
                                                [% IF ( ERROR_password_has_whitespaces ) %]
1235
                                                    <span class="required">Password has leading or trailing whitespaces</span>
1238
                                                    <span class="required">Password has leading or trailing whitespaces</span>
1236
                                                [% END %]
1239
                                                [% END %]
1240
                                                [% IF ( ERROR_password_used_before ) %]
1241
                                                    <span class="required">Password has been used before</span>
1242
                                                [% END %]
1237
                                                <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
1243
                                                <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
1238
                                            </li>
1244
                                            </li>
1239
1245
(-)a/members/memberentry.pl (-3 / +18 lines)
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
- 

Return to bug 40824