@@ -, +, @@ self-registration --- misc/cronjobs/cleanup_database.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) --- a/misc/cronjobs/cleanup_database.pl +++ a/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"; } } --