View | Details | Raw Unified | Return to bug 24153
Collapse All | Expand All

(-)a/misc/cronjobs/cleanup_database.pl (-8 / +7 lines)
Lines 231-237 cronlogaction() unless $confirm; Link Here
231
my $dbh = C4::Context->dbh();
231
my $dbh = C4::Context->dbh();
232
my $sth;
232
my $sth;
233
my $sth2;
233
my $sth2;
234
my $count;
235
234
236
if ( $sessions && !$sess_days ) {
235
if ( $sessions && !$sess_days ) {
237
    if ($verbose) {
236
    if ($verbose) {
Lines 256-262 elsif ( $sessions && $sess_days > 0 ) { Link Here
256
}
255
}
257
256
258
if ($zebraqueue_days) {
257
if ($zebraqueue_days) {
259
    $count = 0;
258
    my $count = 0;
260
    print "Zebraqueue purge triggered for $zebraqueue_days days.\n" if $verbose;
259
    print "Zebraqueue purge triggered for $zebraqueue_days days.\n" if $verbose;
261
    $sth = $dbh->prepare(
260
    $sth = $dbh->prepare(
262
        q{
261
        q{
Lines 282-287 if ($zebraqueue_days) { Link Here
282
}
281
}
283
282
284
if ($mail) {
283
if ($mail) {
284
    my $count = 0;
285
    print "Mail queue purge triggered for $mail days.\n" if $verbose;
285
    print "Mail queue purge triggered for $mail days.\n" if $verbose;
286
    $count = 0;
286
    $count = 0;
287
    $sth = $dbh->prepare(
287
    $sth = $dbh->prepare(
Lines 364-370 if ($pListShareInvites) { Link Here
364
364
365
if ($pDebarments) {
365
if ($pDebarments) {
366
    print "Expired patrons restrictions purge triggered for $pDebarments days.\n" if $verbose;
366
    print "Expired patrons restrictions purge triggered for $pDebarments days.\n" if $verbose;
367
    $count = PurgeDebarments($pDebarments, $confirm);
367
    my $count = PurgeDebarments($pDebarments, $confirm);
368
    if ( $verbose ) {
368
    if ( $verbose ) {
369
        say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted";
369
        say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted";
370
        say "Done with restrictions purge.";
370
        say "Done with restrictions purge.";
Lines 373-379 if ($pDebarments) { Link Here
373
373
374
if($allDebarments) {
374
if($allDebarments) {
375
    print "All expired patrons restrictions purge triggered.\n" if $verbose;
375
    print "All expired patrons restrictions purge triggered.\n" if $verbose;
376
    $count = PurgeDebarments(0, $confirm);
376
    my $count = PurgeDebarments(0, $confirm);
377
    if ( $verbose ) {
377
    if ( $verbose ) {
378
        say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted";
378
        say $confirm ? "$count restrictions were deleted." : "$count restrictions would have been deleted";
379
        say "Done with all restrictions purge.";
379
        say "Done with all restrictions purge.";
Lines 382-388 if($allDebarments) { Link Here
382
382
383
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference
383
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference
384
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed;
384
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed;
385
$count = $unsubscribed_patrons->count;
385
my $count = $unsubscribed_patrons->count;
386
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ) if $confirm;
386
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ) if $confirm;
387
say $confirm ? sprintf("Locked %d patrons", $count) : sprintf("%d patrons would have been locked", $count) if $verbose;
387
say $confirm ? sprintf("Locked %d patrons", $count) : sprintf("%d patrons would have been locked", $count) if $verbose;
388
388
Lines 590-596 sub RemoveOldSessions { Link Here
590
    $sth->execute or die $dbh->errstr;
590
    $sth->execute or die $dbh->errstr;
591
    $sth->bind_columns( \$id, \$a_session );
591
    $sth->bind_columns( \$id, \$a_session );
592
    $sth2  = $dbh->prepare(q{ DELETE FROM sessions WHERE id=? });
592
    $sth2  = $dbh->prepare(q{ DELETE FROM sessions WHERE id=? });
593
    $count = 0;
593
    my $count = 0;
594
594
595
    while ( $sth->fetch ) {
595
    while ( $sth->fetch ) {
596
        $lasttime = 0;
596
        $lasttime = 0;
Lines 652-658 sub PurgeZ3950 { Link Here
652
sub PurgeDebarments {
652
sub PurgeDebarments {
653
    require Koha::Patron::Debarments;
653
    require Koha::Patron::Debarments;
654
    my ( $days, $doit ) = @_;
654
    my ( $days, $doit ) = @_;
655
    $count = 0;
655
    my $count = 0;
656
    $sth   = $dbh->prepare(
656
    $sth   = $dbh->prepare(
657
        q{
657
        q{
658
            SELECT borrower_debarment_id
658
            SELECT borrower_debarment_id
659
- 

Return to bug 24153