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

(-)a/Koha/Patrons/Import.pm (-16 / +16 lines)
Lines 294-315 sub import_patrons { Link Here
294
                try {
294
                try {
295
                    $patron->set_password({ password => $borrower{password} });
295
                    $patron->set_password({ password => $borrower{password} });
296
                }
296
                }
297
				catch {
297
                catch {
298
					if ( $_->isa('Koha::Exceptions::Password::TooShort') ) {
298
                    if ( $_->isa('Koha::Exceptions::Password::TooShort') ) {
299
						push @errors, { passwd_too_short => 1, borrowernumber => $borrowernumber, length => $_->{length}, min_length => $_->{min_length} };
299
                        push @errors, { passwd_too_short => 1, borrowernumber => $borrowernumber, length => $_->{length}, min_length => $_->{min_length} };
300
					}
300
                    }
301
					elsif ( $_->isa('Koha::Exceptions::Password::WhitespaceCharacters') ) {
301
                    elsif ( $_->isa('Koha::Exceptions::Password::WhitespaceCharacters') ) {
302
						push @errors, { passwd_whitespace => 1, borrowernumber => $borrowernumber } ;
302
                        push @errors, { passwd_whitespace => 1, borrowernumber => $borrowernumber } ;
303
					}
303
                    }
304
					elsif ( $_->isa('Koha::Exceptions::Password::TooWeak') ) {
304
                    elsif ( $_->isa('Koha::Exceptions::Password::TooWeak') ) {
305
						push @errors, { passwd_too_weak => 1, borrowernumber => $borrowernumber } ;
305
                        push @errors, { passwd_too_weak => 1, borrowernumber => $borrowernumber } ;
306
					}
306
                    }
307
					elsif ( $_->isa('Koha::Exceptions::Password::Plugin') ) {
307
                    elsif ( $_->isa('Koha::Exceptions::Password::Plugin') ) {
308
						push @errors, { passwd_plugin_err => 1, borrowernumber => $borrowernumber } ;
308
                        push @errors, { passwd_plugin_err => 1, borrowernumber => $borrowernumber } ;
309
					}
309
                    }
310
					else {
310
                    else {
311
						push @errors, { passwd_unknown_err => 1, borrowernumber => $borrowernumber } ;
311
                        push @errors, { passwd_unknown_err => 1, borrowernumber => $borrowernumber } ;
312
					}
312
                    }
313
                }
313
                }
314
            }
314
            }
315
            if ($extended) {
315
            if ($extended) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt (-1 / +1 lines)
Lines 117-123 Link Here
117
                    [% END %]
117
                    [% END %]
118
                    [% IF e.passwd_too_short %]
118
                    [% IF e.passwd_too_short %]
119
                        <li class="line_error">
119
                        <li class="line_error">
120
                            Password is too short for patron with borrowernumber [% e.borrowernumber | html %]. Minimum length is [% e.min_length %], length is [% e.length %]
120
                            Password is too short for patron with borrowernumber [% e.borrowernumber | html %]. Minimum length is [% e.min_length | html %], length is [% e.length | html %]
121
                        </li>
121
                        </li>
122
                    [% END %]
122
                    [% END %]
123
                    [% IF e.passwd_whitespace %]
123
                    [% IF e.passwd_whitespace %]
(-)a/t/db_dependent/Koha/Patrons/Import.t (-2 lines)
Lines 491-497 subtest 'test_import_with_password_overwrite' => sub { Link Here
491
    $ernest->store;
491
    $ernest->store;
492
492
493
    $result = $patrons_import->import_patrons($params_4, $defaults);
493
    $result = $patrons_import->import_patrons($params_4, $defaults);
494
    warn Data::Dumper::Dumper( $result );
495
    $ernest = Koha::Patrons->find({ userid => 'ErnestP' });
494
    $ernest = Koha::Patrons->find({ userid => 'ErnestP' });
496
    is($ernest->surname,'Worrell',"Patron is overwritten, surname changed");
495
    is($ernest->surname,'Worrell',"Patron is overwritten, surname changed");
497
    is($ernest->password,$orig_pass,"Patron is imported, password is not changed for staff");
496
    is($ernest->password,$orig_pass,"Patron is imported, password is not changed for staff");
498
- 

Return to bug 23473