|
Lines 69-74
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu
Link Here
|
| 69 |
days. Defaults to 14 days if no days specified. |
69 |
days. Defaults to 14 days if no days specified. |
| 70 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
70 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
| 71 |
Defaults to 30 days if no days specified. |
71 |
Defaults to 30 days if no days specified. |
|
|
72 |
--del-exp-selfreg Delete expired self registration accounts |
| 73 |
--del-unv-selfreg DAYS Delete unverified self registrations older than DAYS |
| 72 |
USAGE |
74 |
USAGE |
| 73 |
exit $_[0]; |
75 |
exit $_[0]; |
| 74 |
} |
76 |
} |
|
Lines 76-82
USAGE
Link Here
|
| 76 |
my ( |
78 |
my ( |
| 77 |
$help, $sessions, $sess_days, $verbose, $zebraqueue_days, |
79 |
$help, $sessions, $sess_days, $verbose, $zebraqueue_days, |
| 78 |
$mail, $purge_merged, $pImport, $pLogs, $pSearchhistory, |
80 |
$mail, $purge_merged, $pImport, $pLogs, $pSearchhistory, |
| 79 |
$pZ3950, $pListShareInvites, $pDebarments, |
81 |
$pZ3950, $pListShareInvites, $pDebarments, $pExpSelfReg, $pUnvSelfReg, |
| 80 |
); |
82 |
); |
| 81 |
|
83 |
|
| 82 |
GetOptions( |
84 |
GetOptions( |
|
Lines 93-98
GetOptions(
Link Here
|
| 93 |
'searchhistory:i' => \$pSearchhistory, |
95 |
'searchhistory:i' => \$pSearchhistory, |
| 94 |
'list-invites:i' => \$pListShareInvites, |
96 |
'list-invites:i' => \$pListShareInvites, |
| 95 |
'restrictions:i' => \$pDebarments, |
97 |
'restrictions:i' => \$pDebarments, |
|
|
98 |
'del-exp-selfreg' => \$pExpSelfReg, |
| 99 |
'del-unv-selfreg' => \$pUnvSelfReg, |
| 96 |
) || usage(1); |
100 |
) || usage(1); |
| 97 |
|
101 |
|
| 98 |
# Use default values |
102 |
# Use default values |
|
Lines 118-125
unless ( $sessions
Link Here
|
| 118 |
|| $pSearchhistory |
122 |
|| $pSearchhistory |
| 119 |
|| $pZ3950 |
123 |
|| $pZ3950 |
| 120 |
|| $pListShareInvites |
124 |
|| $pListShareInvites |
| 121 |
|| $pDebarments ) |
125 |
|| $pDebarments |
| 122 |
{ |
126 |
|| $pExpSelfReg |
|
|
127 |
|| $pUnvSelfReg ) { |
| 123 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
128 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
| 124 |
usage(1); |
129 |
usage(1); |
| 125 |
} |
130 |
} |
|
Lines 238-243
if ($pDebarments) {
Link Here
|
| 238 |
print "$count restrictions were deleted.\nDone with restrictions purge.\n" if $verbose; |
243 |
print "$count restrictions were deleted.\nDone with restrictions purge.\n" if $verbose; |
| 239 |
} |
244 |
} |
| 240 |
|
245 |
|
|
|
246 |
if( $pExpSelfReg ) { |
| 247 |
DeleteExpiredSelfRegs(); |
| 248 |
} |
| 249 |
if( $pUnvSelfReg ) { |
| 250 |
DeleteUnverifiedSelfRegs( $pUnvSelfReg ); |
| 251 |
} |
| 252 |
|
| 241 |
exit(0); |
253 |
exit(0); |
| 242 |
|
254 |
|
| 243 |
sub RemoveOldSessions { |
255 |
sub RemoveOldSessions { |
|
Lines 324-326
sub PurgeDebarments {
Link Here
|
| 324 |
} |
336 |
} |
| 325 |
return $count; |
337 |
return $count; |
| 326 |
} |
338 |
} |
|
|
339 |
|
| 340 |
sub DeleteExpiredSelfRegs { |
| 341 |
my $cnt= C4::Members::DeleteExpiredOpacRegistrations(); |
| 342 |
print "Removed $cnt expired self-registered borrowers\n" if $verbose; |
| 343 |
} |
| 344 |
|
| 345 |
sub DeleteUnverifiedSelfRegs { |
| 346 |
my $cnt= C4::Members::DeleteUnverifiedOpacRegistrations( $_[0] ); |
| 347 |
print "Removed $cnt unverified self-registrations\n" if $verbose; |
| 348 |
} |