Bugzilla – Attachment 119461 Details for
Bug 21549
Lock expired patron accounts after x days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21549: (QA follow-up) Get pref at start of run and rename variable
Bug-21549-QA-follow-up-Get-pref-at-start-of-run-an.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2021-04-12 14:23:47 UTC
(
hide
)
Description:
Bug 21549: (QA follow-up) Get pref at start of run and rename variable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-12 14:23:47 UTC
Size:
1.92 KB
patch
obsolete
>From fa0a0c857d4ad707bc04cd94be2ecc0322f5a514 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 19 Mar 2021 12:03:15 +0000 >Subject: [PATCH] Bug 21549: (QA follow-up) Get pref at start of run and rename > variable > >This patch ensures the script will lock patrons if the pref is set but no other actions >specified > >It also changes the variable name to be a bit more explicit > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > misc/cronjobs/cleanup_database.pl | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 10ff3e69854..c4a86d18555 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -142,6 +142,7 @@ my $pOldReserves; > my $pTransfers; > my ( $pPseudoTransactions, $pPseudoTransactionsFrom, $pPseudoTransactionsTo ); > my $pMessages; >+my $lock_days = C4::Context->preference('LockExpiredDelay'); > > GetOptions( > 'h|help' => \$help, >@@ -222,6 +223,7 @@ unless ( $sessions > || $pPseudoTransactionsFrom > || $pPseudoTransactionsTo > || $pMessages >+ || defined $lock_days && $lock_days ne q{} > ) { > print "You did not specify any cleanup work for the script to do.\n\n"; > usage(1); >@@ -401,10 +403,9 @@ if($allDebarments) { > } > > # Lock expired patrons? >-my $days = C4::Context->preference('LockExpiredDelay'); >-if( defined $days && $days ne q{} ) { >+if( defined $lock_days && $lock_days ne q{} ) { > say "Start locking expired patrons" if $verbose; >- my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $days })->search({ login_attempts => { '!=' => -1 } }); >+ my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } }); > my $count = $expired_patrons->count; > $expired_patrons->lock({ remove => 1 }) if $confirm; > if( $verbose ) { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21549
:
108000
|
108001
|
111480
|
111481
|
113914
|
113915
|
118493
|
118494
|
118495
|
118496
|
118517
|
118518
|
118519
|
118520
|
118521
|
119457
|
119458
|
119459
|
119460
| 119461 |
119462
|
119463
|
119464
|
119525
|
119526
|
119527