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