[Koha-bugs] [Bug 28457] cleanup_database.pl self-registration options are not configurable

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 3 00:41:02 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28457

David Cook <dcook at prosentient.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #121401|0                           |1
        is obsolete|                            |

--- Comment #7 from David Cook <dcook at prosentient.com.au> ---
Created attachment 158297
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158297&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list