Lines 22-27
use namespace::clean;
Link Here
|
22 |
use Carp; |
22 |
use Carp; |
23 |
use Text::CSV; |
23 |
use Text::CSV; |
24 |
use Encode qw( decode_utf8 ); |
24 |
use Encode qw( decode_utf8 ); |
|
|
25 |
use Try::Tiny; |
25 |
|
26 |
|
26 |
use C4::Members; |
27 |
use C4::Members; |
27 |
use C4::Members::Attributes qw(:all); |
28 |
use C4::Members::Attributes qw(:all); |
Lines 290-296
sub import_patrons {
Link Here
|
290 |
} |
291 |
} |
291 |
} |
292 |
} |
292 |
if ($overwrite_passwords){ |
293 |
if ($overwrite_passwords){ |
293 |
$patron->set_password({ password => $borrower{password} }); |
294 |
try { |
|
|
295 |
$patron->set_password({ password => $borrower{password} }); |
296 |
} |
297 |
catch { |
298 |
if ( $_->isa('Koha::Exceptions::Password::TooShort') ) { |
299 |
push @errors, { passwd_too_short => 1, borrowernumber => $borrowernumber, length => $_->{length}, min_length => $_->{min_length} }; |
300 |
} |
301 |
elsif ( $_->isa('Koha::Exceptions::Password::WhitespaceCharacters') ) { |
302 |
push @errors, { passwd_whitespace => 1, borrowernumber => $borrowernumber } ; |
303 |
} |
304 |
elsif ( $_->isa('Koha::Exceptions::Password::TooWeak') ) { |
305 |
push @errors, { passwd_too_weak => 1, borrowernumber => $borrowernumber } ; |
306 |
} |
307 |
elsif ( $_->isa('Koha::Exceptions::Password::Plugin') ) { |
308 |
push @errors, { passwd_plugin_err => 1, borrowernumber => $borrowernumber } ; |
309 |
} |
310 |
else { |
311 |
push @errors, { passwd_unknown_err => 1, borrowernumber => $borrowernumber } ; |
312 |
} |
313 |
} |
294 |
} |
314 |
} |
295 |
if ($extended) { |
315 |
if ($extended) { |
296 |
if ($ext_preserve) { |
316 |
if ($ext_preserve) { |