summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-queued
diff options
context:
space:
mode:
Diffstat (limited to 'FS/bin/freeside-queued')
-rw-r--r--FS/bin/freeside-queued6
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued
index 7c4cf1b64..36871b295 100644
--- a/FS/bin/freeside-queued
+++ b/FS/bin/freeside-queued
@@ -219,7 +219,11 @@ while (1) {
$log->info('starting job ('.$ljob->job.')');
warn 'running "&'. $ljob->job. '('. join(', ', @args). ")\n" if $DEBUG;
local $FS::UID::AutoCommit = 0; # so that we can clean up failures
- eval $eval; #throw away return value? suppose so
+ do {
+ # switch user only if a job user is available
+ local $FS::CurrentUser::CurrentUser = $ljob->access_user || $FS::CurrentUser::CurrentUser;
+ eval $eval; #throw away return value? suppose so
+ };
if ( $@ ) {
dbh->rollback;
my %hash = $ljob->hash;