|
Lines 305-314
sub search_anonymize_candidates {
Link Here
|
| 305 |
my $str = $parser->format_datetime($dt); |
305 |
my $str = $parser->format_datetime($dt); |
| 306 |
$cond->{dateexpiry} = { '<=' => $str }; |
306 |
$cond->{dateexpiry} = { '<=' => $str }; |
| 307 |
$cond->{anonymized} = 0; # not yet done |
307 |
$cond->{anonymized} = 0; # not yet done |
| 308 |
if ( $params->{locked} ) { |
308 |
my $fails = C4::Context->preference('FailedLoginAttempts'); |
| 309 |
my $fails = C4::Context->preference('FailedLoginAttempts') || 0; |
309 |
|
|
|
310 |
if ( $params->{locked} && $fails && $fails > 0 ) { # $fails should actually not be negative btw |
| 310 |
$cond->{login_attempts} = |
311 |
$cond->{login_attempts} = |
| 311 |
[ -and => { '!=' => undef }, { -not_in => [ 0, 1 .. $fails - 1 ] } ]; # -not_in does not like undef |
312 |
[ -and => { '!=' => undef }, { -not_in => [ 0, 1 .. $fails - 1 ] } ]; # -not_in does not like undef |
|
|
313 |
} elsif ( $params->{locked} ) { |
| 314 |
$cond->{login_attempts} = -1; |
| 312 |
} |
315 |
} |
| 313 |
return $class->search($cond); |
316 |
return $class->search($cond); |
| 314 |
} |
317 |
} |
| 315 |
- |
|
|