Lines 229-235
cronlogaction() unless $confirm;
Link Here
|
229 |
my $dbh = C4::Context->dbh(); |
229 |
my $dbh = C4::Context->dbh(); |
230 |
my $sth; |
230 |
my $sth; |
231 |
my $sth2; |
231 |
my $sth2; |
232 |
my $count; |
|
|
233 |
|
232 |
|
234 |
if ( $sessions && !$sess_days ) { |
233 |
if ( $sessions && !$sess_days ) { |
235 |
if ($verbose) { |
234 |
if ($verbose) { |
Lines 254-260
elsif ( $sessions && $sess_days > 0 ) {
Link Here
|
254 |
} |
253 |
} |
255 |
|
254 |
|
256 |
if ($zebraqueue_days) { |
255 |
if ($zebraqueue_days) { |
257 |
$count = 0; |
256 |
my $count = 0; |
258 |
print "Zebraqueue purge triggered for $zebraqueue_days days.\n" if $verbose; |
257 |
print "Zebraqueue purge triggered for $zebraqueue_days days.\n" if $verbose; |
259 |
$sth = $dbh->prepare( |
258 |
$sth = $dbh->prepare( |
260 |
q{ |
259 |
q{ |
Lines 280-285
if ($zebraqueue_days) {
Link Here
|
280 |
} |
279 |
} |
281 |
|
280 |
|
282 |
if ($mail) { |
281 |
if ($mail) { |
|
|
282 |
my $count = 0; |
283 |
print "Mail queue purge triggered for $mail days.\n" if $verbose; |
283 |
print "Mail queue purge triggered for $mail days.\n" if $verbose; |
284 |
$count = 0; |
284 |
$count = 0; |
285 |
$sth = $dbh->prepare( |
285 |
$sth = $dbh->prepare( |
Lines 362-368
if ($pListShareInvites) {
Link Here
|
362 |
|
362 |
|
363 |
if ($pDebarments) { |
363 |
if ($pDebarments) { |
364 |
print "Expired patrons restrictions purge triggered for $pDebarments days.\n" if $verbose; |
364 |
print "Expired patrons restrictions purge triggered for $pDebarments days.\n" if $verbose; |
365 |
$count = PurgeDebarments($pDebarments, $confirm); |
365 |
my $count = PurgeDebarments($pDebarments, $confirm); |
366 |
if ( $verbose ) { |
366 |
if ( $verbose ) { |
367 |
say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted"; |
367 |
say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted"; |
368 |
say "Done with restrictions purge."; |
368 |
say "Done with restrictions purge."; |
Lines 371-377
if ($pDebarments) {
Link Here
|
371 |
|
371 |
|
372 |
if($allDebarments) { |
372 |
if($allDebarments) { |
373 |
print "All expired patrons restrictions purge triggered.\n" if $verbose; |
373 |
print "All expired patrons restrictions purge triggered.\n" if $verbose; |
374 |
$count = PurgeDebarments(0, $confirm); |
374 |
my $count = PurgeDebarments(0, $confirm); |
375 |
if ( $verbose ) { |
375 |
if ( $verbose ) { |
376 |
say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted"; |
376 |
say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted"; |
377 |
say "Done with all restrictions purge."; |
377 |
say "Done with all restrictions purge."; |
Lines 380-386
if($allDebarments) {
Link Here
|
380 |
|
380 |
|
381 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
381 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
382 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
382 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
383 |
$count = $unsubscribed_patrons->count; |
383 |
my $count = $unsubscribed_patrons->count; |
384 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ) if $confirm; |
384 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ) if $confirm; |
385 |
say $confirm ? sprintf("Locked %d patrons", $count) : sprintf("%d patrons would have been locked", $count) if $verbose; |
385 |
say $confirm ? sprintf("Locked %d patrons", $count) : sprintf("%d patrons would have been locked", $count) if $verbose; |
386 |
|
386 |
|
Lines 588-594
sub RemoveOldSessions {
Link Here
|
588 |
$sth->execute or die $dbh->errstr; |
588 |
$sth->execute or die $dbh->errstr; |
589 |
$sth->bind_columns( \$id, \$a_session ); |
589 |
$sth->bind_columns( \$id, \$a_session ); |
590 |
$sth2 = $dbh->prepare(q{ DELETE FROM sessions WHERE id=? }); |
590 |
$sth2 = $dbh->prepare(q{ DELETE FROM sessions WHERE id=? }); |
591 |
$count = 0; |
591 |
my $count = 0; |
592 |
|
592 |
|
593 |
while ( $sth->fetch ) { |
593 |
while ( $sth->fetch ) { |
594 |
$lasttime = 0; |
594 |
$lasttime = 0; |
Lines 650-656
sub PurgeZ3950 {
Link Here
|
650 |
sub PurgeDebarments { |
650 |
sub PurgeDebarments { |
651 |
require Koha::Patron::Debarments; |
651 |
require Koha::Patron::Debarments; |
652 |
my ( $days, $doit ) = @_; |
652 |
my ( $days, $doit ) = @_; |
653 |
$count = 0; |
653 |
my $count = 0; |
654 |
$sth = $dbh->prepare( |
654 |
$sth = $dbh->prepare( |
655 |
q{ |
655 |
q{ |
656 |
SELECT borrower_debarment_id |
656 |
SELECT borrower_debarment_id |
657 |
- |
|
|