Bugzilla – Attachment 121401 Details for
Bug 28457
cleanup_database.pl self-registration options are not configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28457: Add configuration to cleanup_database.pl for self-registration
Bug-28457-Add-configuration-to-cleanupdatabasepl-f.patch (text/plain), 4.25 KB, created by
David Cook
on 2021-05-26 01:28:35 UTC
(
hide
)
Description:
Bug 28457: Add configuration to cleanup_database.pl for self-registration
Filename:
MIME Type:
Creator:
David Cook
Created:
2021-05-26 01:28:35 UTC
Size:
4.25 KB
patch
obsolete
>From 78d7b1fa20c22373f53f15be4ef690eb6acdf2e3 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 26 May 2021 01:21:32 +0000 >Subject: [PATCH] Bug 28457: Add configuration to cleanup_database.pl for > self-registration > >This patch fixes the --del-unv-selfreg option so that it can actually >accept a DAYS parameter. (Note that backwards compatibility is preserved >so that not specifying DAYS will still work.) > >This patch also uses the following self registration system preferences >to trigger the cleanup: >PatronSelfRegistrationExpireTemporaryAccountsDelay >PatronSelfRegistrationVerifyByEmail > >Note that --del-unv-selfreg will override an instance's system preference. > >This means that on a package install the cleanup will just work. > >Test plan: >0. Apply patch >1. perl ./misc/cronjobs/cleanup_database.pl -v >You did not specify any cleanup work for the script to do. > >2. perl ./misc/cronjobs/cleanup_database.pl -v --del-exp-selfreg >Confirm flag not passed, running in dry-run mode... >Start lock unsubscribed, anonymize and delete >0 patrons would have been locked >0 patrons would have been anonymized >0 patrons would have been deleted >self-registered borrowers may be deleted > >3. perl ./misc/cronjobs/cleanup_database.pl -v --del-unv-selfreg >Confirm flag not passed, running in dry-run mode... >Start lock unsubscribed, anonymize and delete >0 patrons would have been locked >0 patrons would have been anonymized >0 patrons would have been deleted >unverified self-registrations may be deleted after 1 days > >4. perl ./misc/cronjobs/cleanup_database.pl -v --del-unv-selfreg 3 >Confirm flag not passed, running in dry-run mode... >Start lock unsubscribed, anonymize and delete >0 patrons would have been locked >0 patrons would have been anonymized >0 patrons would have been deleted >unverified self-registrations may be deleted after 3 days > >5. Set "PatronSelfRegistrationExpireTemporaryAccountsDelay" to 1 >6. Set "PatronSelfRegistrationVerifyByEmail" to "Require" > >7. perl ./misc/cronjobs/cleanup_database.pl -v >Confirm flag not passed, running in dry-run mode... >Start lock unsubscribed, anonymize and delete >0 patrons would have been locked >0 patrons would have been anonymized >0 patrons would have been deleted >self-registered borrowers may be deleted >unverified self-registrations may be deleted after 1 days > >8. perl ./misc/cronjobs/cleanup_database.pl -v --del-unv-selfreg 2 >Confirm flag not passed, running in dry-run mode... >Start lock unsubscribed, anonymize and delete >0 patrons would have been locked >0 patrons would have been anonymized >0 patrons would have been deleted >self-registered borrowers may be deleted >unverified self-registrations may be deleted after 2 days >--- > misc/cronjobs/cleanup_database.pl | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 1897111496..a7f643ab7a 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -130,7 +130,20 @@ my $pListShareInvites; > my $pDebarments; > my $allDebarments; > my $pExpSelfReg; >+if ( >+ C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay') && >+ C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay') > 0 >+ ){ >+ $pExpSelfReg = 1; >+} > my $pUnvSelfReg; >+if ( >+ C4::Context->preference('PatronSelfRegistrationVerifyByEmail') >+ ){ >+ #Default to 1 day expiry, which can be overriden by CLI option >+ #FIXME: Add a system preference for specifying this value >+ $pUnvSelfReg = 1; >+} > my $fees_days; > my $special_holidays_days; > my $temp_uploads; >@@ -168,7 +181,7 @@ GetOptions( > 'restrictions:i' => \$pDebarments, > 'all-restrictions' => \$allDebarments, > 'del-exp-selfreg' => \$pExpSelfReg, >- 'del-unv-selfreg' => \$pUnvSelfReg, >+ 'del-unv-selfreg:1' => \$pUnvSelfReg, > 'unique-holidays:i' => \$special_holidays_days, > 'temp-uploads' => \$temp_uploads, > 'temp-uploads-days:i' => \$temp_uploads_days, >@@ -461,7 +474,7 @@ if( $pUnvSelfReg ) { > if ( $confirm ) { > DeleteUnverifiedSelfRegs( $pUnvSelfReg ); > } elsif ( $verbose ) { >- say "unverified self-registrations may be deleted"; >+ say "unverified self-registrations may be deleted after $pUnvSelfReg days"; > } > } > >-- >2.11.0
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 28457
:
121401
|
158297