|
Lines 26-31
use constant DEFAULT_LOGS_PURGEDAYS => 180;
Link Here
|
| 26 |
use constant DEFAULT_SEARCHHISTORY_PURGEDAYS => 30; |
26 |
use constant DEFAULT_SEARCHHISTORY_PURGEDAYS => 30; |
| 27 |
use constant DEFAULT_SHARE_INVITATION_EXPIRY_DAYS => 14; |
27 |
use constant DEFAULT_SHARE_INVITATION_EXPIRY_DAYS => 14; |
| 28 |
use constant DEFAULT_DEBARMENTS_PURGEDAYS => 30; |
28 |
use constant DEFAULT_DEBARMENTS_PURGEDAYS => 30; |
|
|
29 |
use constant DEFAULT_EXP_SELFREG_TYPE => 'hard'; |
| 29 |
|
30 |
|
| 30 |
BEGIN { |
31 |
BEGIN { |
| 31 |
# find Koha's Perl modules |
32 |
# find Koha's Perl modules |
|
Lines 76-84
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu
Link Here
|
| 76 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
77 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
| 77 |
Defaults to 30 days if no days specified. |
78 |
Defaults to 30 days if no days specified. |
| 78 |
--all-restrictions purge all expired patrons restrictions. |
79 |
--all-restrictions purge all expired patrons restrictions. |
| 79 |
--del-exp-selfreg Delete expired self registration accounts |
80 |
--del-exp-selfreg Delete expired self registration accounts |
| 80 |
--del-unv-selfreg DAYS Delete unverified self registrations older than DAYS |
81 |
--del-exp-selfreg-type TYPE Option 'hard' completely removes patrons from the database, |
| 81 |
--unique-holidays DAYS Delete all unique holidays older than DAYS |
82 |
Option 'soft' moves patron to deleted patrons table. |
|
|
83 |
--del-unv-selfreg DAYS Delete unverified self registrations older than DAYS |
| 84 |
--unique-holidays DAYS Delete all unique holidays older than DAYS |
| 82 |
--temp-uploads Delete temporary uploads. |
85 |
--temp-uploads Delete temporary uploads. |
| 83 |
--temp-uploads-days DAYS Override the corresponding preference value. |
86 |
--temp-uploads-days DAYS Override the corresponding preference value. |
| 84 |
--uploads-missing FLAG Delete upload records for missing files when FLAG is true, count them otherwise |
87 |
--uploads-missing FLAG Delete upload records for missing files when FLAG is true, count them otherwise |
|
Lines 109-114
my $pListShareInvites;
Link Here
|
| 109 |
my $pDebarments; |
112 |
my $pDebarments; |
| 110 |
my $allDebarments; |
113 |
my $allDebarments; |
| 111 |
my $pExpSelfReg; |
114 |
my $pExpSelfReg; |
|
|
115 |
my $pExpSelfRegType = 'hard'; |
| 112 |
my $pUnvSelfReg; |
116 |
my $pUnvSelfReg; |
| 113 |
my $fees_days; |
117 |
my $fees_days; |
| 114 |
my $special_holidays_days; |
118 |
my $special_holidays_days; |
|
Lines 140-145
GetOptions(
Link Here
|
| 140 |
'restrictions:i' => \$pDebarments, |
144 |
'restrictions:i' => \$pDebarments, |
| 141 |
'all-restrictions' => \$allDebarments, |
145 |
'all-restrictions' => \$allDebarments, |
| 142 |
'del-exp-selfreg' => \$pExpSelfReg, |
146 |
'del-exp-selfreg' => \$pExpSelfReg, |
|
|
147 |
'del-exp-selfreg-type' => \$pExpSelfRegType, |
| 143 |
'del-unv-selfreg' => \$pUnvSelfReg, |
148 |
'del-unv-selfreg' => \$pUnvSelfReg, |
| 144 |
'unique-holidays:i' => \$special_holidays_days, |
149 |
'unique-holidays:i' => \$special_holidays_days, |
| 145 |
'temp-uploads' => \$temp_uploads, |
150 |
'temp-uploads' => \$temp_uploads, |
|
Lines 192-197
unless ( $sessions
Link Here
|
| 192 |
|| $pOldIssues |
197 |
|| $pOldIssues |
| 193 |
|| $pOldReserves |
198 |
|| $pOldReserves |
| 194 |
|| $pTransfers |
199 |
|| $pTransfers |
|
|
200 |
|| ( !defined $pExpSelfRegType || $pExpSelfRegType !~ m/^hard|soft$/ ) |
| 195 |
) { |
201 |
) { |
| 196 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
202 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
| 197 |
usage(1); |
203 |
usage(1); |
|
Lines 354-360
elsif ($verbose) {
Link Here
|
| 354 |
} |
360 |
} |
| 355 |
|
361 |
|
| 356 |
if( $pExpSelfReg ) { |
362 |
if( $pExpSelfReg ) { |
| 357 |
DeleteExpiredSelfRegs(); |
363 |
DeleteExpiredSelfRegs( $pExpSelfRegType ); |
| 358 |
} |
364 |
} |
| 359 |
if( $pUnvSelfReg ) { |
365 |
if( $pUnvSelfReg ) { |
| 360 |
DeleteUnverifiedSelfRegs( $pUnvSelfReg ); |
366 |
DeleteUnverifiedSelfRegs( $pUnvSelfReg ); |
|
Lines 569-575
sub PurgeDebarments {
Link Here
|
| 569 |
} |
575 |
} |
| 570 |
|
576 |
|
| 571 |
sub DeleteExpiredSelfRegs { |
577 |
sub DeleteExpiredSelfRegs { |
| 572 |
my $cnt= C4::Members::DeleteExpiredOpacRegistrations(); |
578 |
my ( $type ) = @_; |
|
|
579 |
my $cnt = C4::Members::DeleteExpiredOpacRegistrations( $type ); |
| 573 |
print "Removed $cnt expired self-registered borrowers\n" if $verbose; |
580 |
print "Removed $cnt expired self-registered borrowers\n" if $verbose; |
| 574 |
} |
581 |
} |
| 575 |
|
582 |
|
| 576 |
- |
|
|