Bugzilla – Attachment 87007 Details for
Bug 22577
Cronjobs (and other scripts) should be attributed to a 'real' user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22577: Update cronjobs to set userenv
Bug-22577-Update-cronjobs-to-set-userenv.patch (text/plain), 20.49 KB, created by
Martin Renvoize (ashimema)
on 2019-03-26 10:18:12 UTC
(
hide
)
Description:
Bug 22577: Update cronjobs to set userenv
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-03-26 10:18:12 UTC
Size:
20.49 KB
patch
obsolete
>From 0f542f84c76ba0a23f2709d6a5e11a3956c870bc Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 26 Mar 2019 10:16:21 +0000 >Subject: [PATCH] Bug 22577: Update cronjobs to set userenv > >--- > misc/cronjobs/advance_notices.pl | 5 ++++- > misc/cronjobs/automatic_item_modification_by_age.pl | 5 +++++ > misc/cronjobs/automatic_renewals.pl | 4 ++++ > misc/cronjobs/batch_anonymise.pl | 4 ++++ > misc/cronjobs/build_browser_and_cloud.pl | 4 ++++ > misc/cronjobs/cart_to_shelf.pl | 4 ++++ > misc/cronjobs/check-url-quick.pl | 5 +++++ > misc/cronjobs/cleanup_database.pl | 4 ++++ > misc/cronjobs/cloud-kw.pl | 6 +++++- > misc/cronjobs/create_koc_db.pl | 4 ++++ > misc/cronjobs/delete_items.pl | 5 +++++ > misc/cronjobs/delete_patrons.pl | 4 ++++ > misc/cronjobs/delete_records_via_leader.pl | 5 +++++ > misc/cronjobs/edi_cron.pl | 5 +++++ > misc/cronjobs/gather_print_notices.pl | 4 ++++ > misc/cronjobs/holds/auto_unsuspend_holds.pl | 4 ++++ > misc/cronjobs/holds/build_holds_queue.pl | 4 ++++ > misc/cronjobs/holds/cancel_expired_holds.pl | 4 ++++ > misc/cronjobs/holds/cancel_unfilled_holds.pl | 4 ++++ > misc/cronjobs/import_webservice_batch.pl | 4 ++++ > misc/cronjobs/j2a.pl | 4 ++++ > misc/cronjobs/longoverdue.pl | 4 ++++ > misc/cronjobs/membership_expiry.pl | 4 ++++ > misc/cronjobs/merge_authorities.pl | 11 ++++++++--- > misc/cronjobs/notice_unprocessed_suggestions.pl | 5 +++++ > misc/cronjobs/overdue_notices.pl | 4 ++++ > misc/cronjobs/process_message_queue.pl | 4 ++++ > misc/cronjobs/purge_suggestions.pl | 4 ++++ > misc/cronjobs/reconcile_balances.pl | 5 ++++- > misc/cronjobs/runreport.pl | 4 ++++ > misc/cronjobs/serialsUpdate.pl | 4 ++++ > misc/cronjobs/share_usage_with_koha_community.pl | 4 ++++ > misc/cronjobs/staticfines.pl | 4 ++++ > misc/cronjobs/stockrotation.pl | 5 +++++ > .../cronjobs/thirdparty/TalkingTech_itiva_outbound.pl | 5 +++++ > misc/cronjobs/update_totalissues.pl | 4 ++++ > 36 files changed, 157 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 91bf352b89..829d96bc51 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -223,7 +223,10 @@ END_WARN > unless ($confirm) { > pod2usage(1); > } >- >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > # The fields that will be substituted into <<items.content>> >diff --git a/misc/cronjobs/automatic_item_modification_by_age.pl b/misc/cronjobs/automatic_item_modification_by_age.pl >index 51effd32b1..57ec035c05 100755 >--- a/misc/cronjobs/automatic_item_modification_by_age.pl >+++ b/misc/cronjobs/automatic_item_modification_by_age.pl >@@ -20,6 +20,11 @@ my $result = GetOptions( > pod2usage(1) if $help; > $verbose = 1 unless $confirm; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > # Load configuration from the syspref > my $syspref_content = C4::Context->preference('automatic_item_modification_by_age_configuration'); > my $rules = eval { JSON::from_json( $syspref_content ) }; >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index b50a6d565a..98883e5db6 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -68,6 +68,10 @@ GetOptions( > > pod2usage(0) if $help; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 }); >diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl >index 013f7d1179..328ae29110 100755 >--- a/misc/cronjobs/batch_anonymise.pl >+++ b/misc/cronjobs/batch_anonymise.pl >@@ -67,6 +67,10 @@ if ( !$days ) { > usage(1); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my ($year,$month,$day) = Today(); >diff --git a/misc/cronjobs/build_browser_and_cloud.pl b/misc/cronjobs/build_browser_and_cloud.pl >index d5e0d1a8f5..280b1e47a4 100755 >--- a/misc/cronjobs/build_browser_and_cloud.pl >+++ b/misc/cronjobs/build_browser_and_cloud.pl >@@ -62,6 +62,10 @@ my $browser_subfield = $2; > warn "browser : $browser_tag / $browser_subfield" unless $batch; > die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $dbh = C4::Context->dbh; >diff --git a/misc/cronjobs/cart_to_shelf.pl b/misc/cronjobs/cart_to_shelf.pl >index 965f7dd0d4..dfa3aff5f6 100755 >--- a/misc/cronjobs/cart_to_shelf.pl >+++ b/misc/cronjobs/cart_to_shelf.pl >@@ -64,6 +64,10 @@ unless ($hours) { > die "ERROR: No --hours (-h) option defined"; > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $query = "SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > ?"; >diff --git a/misc/cronjobs/check-url-quick.pl b/misc/cronjobs/check-url-quick.pl >index 22d2dfe461..ff62c55d9d 100755 >--- a/misc/cronjobs/check-url-quick.pl >+++ b/misc/cronjobs/check-url-quick.pl >@@ -43,6 +43,11 @@ GetOptions( > 'tags=s{,}' => \@tags, > ); > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > # Validate tags to check > { > my %h = map { $_ => undef } @tags; >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 3e6c504532..fa176f3f91 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -176,6 +176,10 @@ if ($pDebarments && $allDebarments) { > usage(1); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $dbh = C4::Context->dbh(); >diff --git a/misc/cronjobs/cloud-kw.pl b/misc/cronjobs/cloud-kw.pl >index 96864156ef..a748153e58 100755 >--- a/misc/cronjobs/cloud-kw.pl >+++ b/misc/cronjobs/cloud-kw.pl >@@ -42,8 +42,12 @@ sub usage { > exit; > } > >-usage() if $help || !$conf; >+usage() if $help || !$conf; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my @clouds; >diff --git a/misc/cronjobs/create_koc_db.pl b/misc/cronjobs/create_koc_db.pl >index 2b5b33aab9..89922d44d7 100755 >--- a/misc/cronjobs/create_koc_db.pl >+++ b/misc/cronjobs/create_koc_db.pl >@@ -118,6 +118,10 @@ GetOptions( > pod2usage(1) if $help; > pod2usage( -verbose => 2 ) if $man; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > > my %wanted_borrowers_columns = map { $_ => 1 } qw/borrowernumber cardnumber surname firstname address city phone dateofbirth/; > my %wanted_issues_columns = map { $_ => 1 } qw/borrowernumber date_due itemcallnumber title itemtype/; >diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl >index 78a9b35b8d..073632cbb4 100755 >--- a/misc/cronjobs/delete_items.pl >+++ b/misc/cronjobs/delete_items.pl >@@ -7,6 +7,11 @@ use C4::Circulation; > use Modern::Perl; > use Pod::Usage; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > my $dbh = C4::Context->dbh(); > > my $query = { >diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl >index cb59465df4..fd5a3eeb87 100755 >--- a/misc/cronjobs/delete_patrons.pl >+++ b/misc/cronjobs/delete_patrons.pl >@@ -41,6 +41,10 @@ unless ( $not_borrowed_since or $expired_before or $last_seen or $category_code > pod2usage(q{At least one filter is mandatory}); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $members = GetBorrowersToExpunge( >diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl >index 41b22bb7cb..c511774e7e 100755 >--- a/misc/cronjobs/delete_records_via_leader.pl >+++ b/misc/cronjobs/delete_records_via_leader.pl >@@ -77,6 +77,11 @@ This script has the following parameters : > exit(); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > my @metadatas = # Should be replaced by a call to C4::Search on zebra index > # Record-status when bug 15537 will be pushed > Koha::Biblio::Metadatas->search( { format => 'marcxml', schema => C4::Context->preference('marcflavour'), metadata => { LIKE => '%<leader>_____d%' } } ); >diff --git a/misc/cronjobs/edi_cron.pl b/misc/cronjobs/edi_cron.pl >index c23341ad26..02c6fdcc19 100755 >--- a/misc/cronjobs/edi_cron.pl >+++ b/misc/cronjobs/edi_cron.pl >@@ -36,6 +36,11 @@ use Koha::EDI qw( process_quote process_invoice process_ordrsp); > use Koha::Edifact::Transport; > use Fcntl qw( :DEFAULT :flock :seek ); > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > my $logdir = C4::Context->config('logdir'); > > # logging set to trace as this may be what you >diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl >index ca99635346..873c430bec 100755 >--- a/misc/cronjobs/gather_print_notices.pl >+++ b/misc/cronjobs/gather_print_notices.pl >@@ -79,6 +79,10 @@ if ( $ods and @letter_codes != 1 ) { > > $delimiter ||= q|,|; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $today_iso = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ) ; >diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl >index d17dfb55b0..8d977da990 100755 >--- a/misc/cronjobs/holds/auto_unsuspend_holds.pl >+++ b/misc/cronjobs/holds/auto_unsuspend_holds.pl >@@ -32,6 +32,10 @@ BEGIN { > use C4::Reserves; > use C4::Log; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > AutoUnsuspendReserves(); >diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl >index be50de705e..de00b801b3 100755 >--- a/misc/cronjobs/holds/build_holds_queue.pl >+++ b/misc/cronjobs/holds/build_holds_queue.pl >@@ -18,6 +18,10 @@ BEGIN { > use C4::HoldsQueue qw(CreateQueue); > use C4::Log; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > CreateQueue(); >diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl >index f721553bb5..2cb5820618 100755 >--- a/misc/cronjobs/holds/cancel_expired_holds.pl >+++ b/misc/cronjobs/holds/cancel_expired_holds.pl >@@ -32,6 +32,10 @@ BEGIN { > use C4::Reserves; > use C4::Log; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > CancelExpiredReserves(); >diff --git a/misc/cronjobs/holds/cancel_unfilled_holds.pl b/misc/cronjobs/holds/cancel_unfilled_holds.pl >index 8c7f928ae0..a3bab3426e 100755 >--- a/misc/cronjobs/holds/cancel_unfilled_holds.pl >+++ b/misc/cronjobs/holds/cancel_unfilled_holds.pl >@@ -35,6 +35,10 @@ use Koha::Calendar; > use Koha::DateUtils; > use Koha::Libraries; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > =head1 NAME >diff --git a/misc/cronjobs/import_webservice_batch.pl b/misc/cronjobs/import_webservice_batch.pl >index 0e1384f827..2942ddf103 100755 >--- a/misc/cronjobs/import_webservice_batch.pl >+++ b/misc/cronjobs/import_webservice_batch.pl >@@ -50,6 +50,10 @@ EOF > ; > exit; > } >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > > my $batch_ids = GetStagedWebserviceBatches() or exit; > >diff --git a/misc/cronjobs/j2a.pl b/misc/cronjobs/j2a.pl >index ba90ad0ccd..73dc7a4f1a 100755 >--- a/misc/cronjobs/j2a.pl >+++ b/misc/cronjobs/j2a.pl >@@ -125,6 +125,10 @@ if ( not $fromcat && $tocat ) { #make sure we've specified the info we need. > exit; > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $dbh = C4::Context->dbh; >diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl >index f895f6d451..b16b0c80ca 100755 >--- a/misc/cronjobs/longoverdue.pl >+++ b/misc/cronjobs/longoverdue.pl >@@ -228,6 +228,10 @@ unless ($confirm) { > print "### TEST MODE -- NO ACTIONS TAKEN ###\n"; > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > # In my opinion, this line is safe SQL to have outside the API. --atz >diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl >index 1b6ea81d43..d172d552d3 100755 >--- a/misc/cronjobs/membership_expiry.pl >+++ b/misc/cronjobs/membership_expiry.pl >@@ -157,6 +157,10 @@ GetOptions( > pod2usage( -verbose => 2 ) if $man; > pod2usage(1) if $help || !$confirm; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $expdays = C4::Context->preference('MembershipExpiryDaysNotice'); >diff --git a/misc/cronjobs/merge_authorities.pl b/misc/cronjobs/merge_authorities.pl >index 4682694433..2db41de955 100755 >--- a/misc/cronjobs/merge_authorities.pl >+++ b/misc/cronjobs/merge_authorities.pl >@@ -19,9 +19,14 @@ GetOptions( > ); > > $|=1; # flushes output >-if( $params->{batch} ) { >- handle_batch( $params ); >-} else { >+if ( $params->{batch} ) { >+ C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+ ); >+ handle_batch($params); >+} >+else { > pod2usage(1); > } > >diff --git a/misc/cronjobs/notice_unprocessed_suggestions.pl b/misc/cronjobs/notice_unprocessed_suggestions.pl >index 598ef5a4b4..e2a970d9a3 100755 >--- a/misc/cronjobs/notice_unprocessed_suggestions.pl >+++ b/misc/cronjobs/notice_unprocessed_suggestions.pl >@@ -22,6 +22,11 @@ if ($help) { > pod2usage( verbose => 2 ); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > unless (@days) { > pod2usage(q{At least one day parameter should be given}); > exit; >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 8c42335c2c..b249f2aeb0 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -326,6 +326,10 @@ GetOptions( > pod2usage(1) if $help; > pod2usage( -verbose => 2 ) if $man; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction() unless $test_mode; > > if ( defined $csvfilename && $csvfilename =~ /^-/ ) { >diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl >index 3e0ef5173a..93e355b207 100755 >--- a/misc/cronjobs/process_message_queue.pl >+++ b/misc/cronjobs/process_message_queue.pl >@@ -66,6 +66,10 @@ ENDUSAGE > > die $usage if $help; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > C4::Letters::SendQueuedMessages( >diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl >index 58a9a1dc12..7a1575a36d 100755 >--- a/misc/cronjobs/purge_suggestions.pl >+++ b/misc/cronjobs/purge_suggestions.pl >@@ -63,6 +63,10 @@ if( !$confirm || $help || !defined($days) ) { > print "No confirm parameter passed!\n\n" if !$confirm && !$help; > print $usage; > } elsif( $days and $days > 0 ) { >+ C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+ ); > cronlogaction( " ( days: $days )"); > DelSuggestionsOlderThan($days); > } else { >diff --git a/misc/cronjobs/reconcile_balances.pl b/misc/cronjobs/reconcile_balances.pl >index 1bd9dc277e..4913fddd67 100755 >--- a/misc/cronjobs/reconcile_balances.pl >+++ b/misc/cronjobs/reconcile_balances.pl >@@ -76,7 +76,10 @@ GetOptions( > ) or pod2usage(2); > > pod2usage(1) if $help; >- >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my @patron_ids = map { $_->borrowernumber } Koha::Account::Lines->search( >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index c89a6d4844..549bf26cdb 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -204,6 +204,10 @@ pod2usage( -verbose => 2 ) if ($man); > pod2usage( -verbose => 2 ) if ($help and $verbose); > pod2usage(1) if $help; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > unless ($format) { >diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl >index a478476981..b1ede3c355 100755 >--- a/misc/cronjobs/serialsUpdate.pl >+++ b/misc/cronjobs/serialsUpdate.pl >@@ -79,6 +79,10 @@ GetOptions( > pod2usage(1) if $help; > pod2usage( -verbose => 2 ) if $man; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > $verbose and !$confirm and print "### Database will not be modified ###\n"; >diff --git a/misc/cronjobs/share_usage_with_koha_community.pl b/misc/cronjobs/share_usage_with_koha_community.pl >index 9039558302..c8cc83b3f7 100755 >--- a/misc/cronjobs/share_usage_with_koha_community.pl >+++ b/misc/cronjobs/share_usage_with_koha_community.pl >@@ -35,6 +35,10 @@ Setting the quiet flag will silence this message. > exit 1; > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $need_update = ($force ? 1 : C4::UsageStats::NeedUpdate() ); >diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl >index 5803c89a2a..a14abbc31f 100755 >--- a/misc/cronjobs/staticfines.pl >+++ b/misc/cronjobs/staticfines.pl >@@ -91,6 +91,10 @@ This script has the following parameters : > ENDUSAGE > die $usage if $help; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $dbh = C4::Context->dbh; >diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl >index 083c14766a..8cb43f0e44 100755 >--- a/misc/cronjobs/stockrotation.pl >+++ b/misc/cronjobs/stockrotation.pl >@@ -113,6 +113,11 @@ use C4::Context; > use C4::Letters; > use Koha::StockRotationRotas; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > my $admin_email = ''; > my $branch = 0; > my $execute = 0; >diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >index d1ff3925fd..993f0f95e1 100755 >--- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >+++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >@@ -89,6 +89,11 @@ $library_code ||= ''; > > pod2usage( -verbose => 1 ) if $help; > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); >+ > # output log or STDOUT > my $OUT; > if ( defined $outfile ) { >diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl >index affa2a7e34..c155052525 100755 >--- a/misc/cronjobs/update_totalissues.pl >+++ b/misc/cronjobs/update_totalissues.pl >@@ -95,6 +95,10 @@ if ( not $result or $want_help ) { > usage(); > } > >+C4::Context->set_userenv( >+ '-1', '-1', undef, 'CRON', 'CRON', undef, >+ undef, undef, undef, undef, undef >+); > cronlogaction(); > > my $dbh = C4::Context->dbh; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22577
:
86991
|
86992
|
86993
|
87007
|
87008
|
87013
|
87014
|
87015
|
87017
|
87028
|
87029
|
87030
|
87031
|
87032
|
87053
|
87054
|
87055
|
87056
|
87057
|
87058
|
87059
|
87060