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

(-)a/misc/cronjobs/cleanup_database.pl (-4 / +4 lines)
Lines 142-147 my $pOldReserves; Link Here
142
my $pTransfers;
142
my $pTransfers;
143
my ( $pPseudoTransactions, $pPseudoTransactionsFrom, $pPseudoTransactionsTo );
143
my ( $pPseudoTransactions, $pPseudoTransactionsFrom, $pPseudoTransactionsTo );
144
my $pMessages;
144
my $pMessages;
145
my $lock_days = C4::Context->preference('LockExpiredDelay');
145
146
146
GetOptions(
147
GetOptions(
147
    'h|help'            => \$help,
148
    'h|help'            => \$help,
Lines 222-227 unless ( $sessions Link Here
222
    || $pPseudoTransactionsFrom
223
    || $pPseudoTransactionsFrom
223
    || $pPseudoTransactionsTo
224
    || $pPseudoTransactionsTo
224
    || $pMessages
225
    || $pMessages
226
    || defined $lock_days && $lock_days ne q{}
225
) {
227
) {
226
    print "You did not specify any cleanup work for the script to do.\n\n";
228
    print "You did not specify any cleanup work for the script to do.\n\n";
227
    usage(1);
229
    usage(1);
Lines 401-410 if($allDebarments) { Link Here
401
}
403
}
402
404
403
# Lock expired patrons?
405
# Lock expired patrons?
404
my $days = C4::Context->preference('LockExpiredDelay');
406
if( defined $lock_days && $lock_days ne q{} ) {
405
if( defined $days && $days ne q{} ) {
406
    say "Start locking expired patrons" if $verbose;
407
    say "Start locking expired patrons" if $verbose;
407
    my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $days })->search({ login_attempts => { '!=' => -1 } });
408
    my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } });
408
    my $count = $expired_patrons->count;
409
    my $count = $expired_patrons->count;
409
    $expired_patrons->lock({ remove => 1 }) if $confirm;
410
    $expired_patrons->lock({ remove => 1 }) if $confirm;
410
    if( $verbose ) {
411
    if( $verbose ) {
411
- 

Return to bug 21549