Lines 307-328
if($allDebarments) {
Link Here
|
307 |
|
307 |
|
308 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
308 |
# Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference |
309 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
309 |
my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; |
|
|
310 |
$count = $unsubscribed_patrons->count; |
310 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ); |
311 |
$unsubscribed_patrons->lock( { expire => 1, remove => 1 } ); |
311 |
say sprintf "Locked %d patrons", $unsubscribed_patrons->count if $verbose; |
312 |
say sprintf "Locked %d patrons", $count if $verbose; |
312 |
|
313 |
|
313 |
# Anonymize patron data, depending on PatronAnonymizeDelay |
314 |
# Anonymize patron data, depending on PatronAnonymizeDelay |
314 |
my $anonymize_candidates = Koha::Patrons->search_anonymize_candidates( { locked => 1 } ); |
315 |
my $anonymize_candidates = Koha::Patrons->search_anonymize_candidates( { locked => 1 } ); |
|
|
316 |
$count = $anonymize_candidates->count; |
315 |
$anonymize_candidates->anonymize; |
317 |
$anonymize_candidates->anonymize; |
316 |
say sprintf "Anonymized %s patrons", $anonymize_candidates->count if $verbose; |
318 |
say sprintf "Anonymized %s patrons", $count if $verbose; |
317 |
|
319 |
|
318 |
# Remove patron data, depending on PatronRemovalDelay (will raise an exception if problem encountered |
320 |
# Remove patron data, depending on PatronRemovalDelay (will raise an exception if problem encountered |
319 |
my $anonymized_patrons = Koha::Patrons->search_anonymized; |
321 |
my $anonymized_patrons = Koha::Patrons->search_anonymized; |
|
|
322 |
$count = $anonymized_patrons->count; |
320 |
$anonymized_patrons->delete( { move => 1 } ); |
323 |
$anonymized_patrons->delete( { move => 1 } ); |
321 |
if ($@) { |
324 |
if ($@) { |
322 |
warn $@; |
325 |
warn $@; |
323 |
} |
326 |
} |
324 |
elsif ($verbose) { |
327 |
elsif ($verbose) { |
325 |
say sprintf "Deleted %d patrons", $anonymized_patrons->count; |
328 |
say sprintf "Deleted %d patrons", $count; |
326 |
} |
329 |
} |
327 |
|
330 |
|
328 |
if( $pExpSelfReg ) { |
331 |
if( $pExpSelfReg ) { |
329 |
- |
|
|