Lines 332-353
if($allDebarments) {
Link Here
|
332 |
|
332 |
|
333 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
333 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
334 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
334 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
|
|
335 |
$count = $unsubscribed_patrons->count; |
335 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ); |
336 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ); |
336 |
say sprintf "Locked %d patrons", $unsubscribed_patrons->count if $verbose; |
337 |
say sprintf "Locked %d patrons", $count if $verbose; |
337 |
|
338 |
|
338 |
# Anonymize patron data, depending on PatronAnonymizeDelay |
339 |
# Anonymize patron data, depending on PatronAnonymizeDelay |
339 |
my $anonymize_candidates = Koha::Patrons->search_anonymize_candidates( { locked => 1 } ); |
340 |
my $anonymize_candidates = Koha::Patrons->search_anonymize_candidates( { locked => 1 } ); |
|
|
341 |
$count = $anonymize_candidates->count; |
340 |
$anonymize_candidates->anonymize; |
342 |
$anonymize_candidates->anonymize; |
341 |
say sprintf "Anonymized %s patrons", $anonymize_candidates->count if $verbose; |
343 |
say sprintf "Anonymized %s patrons", $count if $verbose; |
342 |
|
344 |
|
343 |
# Remove patron data, depending on PatronRemovalDelay (will raise an exception if problem encountered |
345 |
# Remove patron data, depending on PatronRemovalDelay (will raise an exception if problem encountered |
344 |
my $anonymized_patrons = Koha::Patrons->search_anonymized; |
346 |
my $anonymized_patrons = Koha::Patrons->search_anonymized; |
|
|
347 |
$count = $anonymized_patrons->count; |
345 |
$anonymized_patrons->delete( { move => 1 } ); |
348 |
$anonymized_patrons->delete( { move => 1 } ); |
346 |
if ($@) { |
349 |
if ($@) { |
347 |
warn $@; |
350 |
warn $@; |
348 |
} |
351 |
} |
349 |
elsif ($verbose) { |
352 |
elsif ($verbose) { |
350 |
say sprintf "Deleted %d patrons", $anonymized_patrons->count; |
353 |
say sprintf "Deleted %d patrons", $count; |
351 |
} |
354 |
} |
352 |
|
355 |
|
353 |
if( $pExpSelfReg ) { |
356 |
if( $pExpSelfReg ) { |
354 |
- |
|
|