diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-20 01:42:15 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-20 01:42:15 -0500 |
commit | 2dddd8e1742bf2e8ebe9f2d3e560bc78bba95cff (patch) | |
tree | 9bc5739f2a67e846fcddc641937da34ee0362804 /FS/bin/freeside-queued | |
parent | 866994096d21b914815cb06353397dc4d00438f3 (diff) |
RT#14829: automatic payments triggered by bill now show up as Payment by fs_queue
Diffstat (limited to 'FS/bin/freeside-queued')
-rw-r--r-- | FS/bin/freeside-queued | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued index 7c4cf1b64..398b03d12 100644 --- a/FS/bin/freeside-queued +++ b/FS/bin/freeside-queued @@ -218,8 +218,13 @@ while (1) { # don't put @args in the log, may expose passwords $log->info('starting job ('.$ljob->job.')'); warn 'running "&'. $ljob->job. '('. join(', ', @args). ")\n" if $DEBUG; + # switch user only if a job user is available + my $oldCurrentUser = $FS::CurrentUser::CurrentUser; + my $jobuser = $ljob->access_user; + local $FS::CurrentUser::CurrentUser = $jobuser if $jobuser; local $FS::UID::AutoCommit = 0; # so that we can clean up failures eval $eval; #throw away return value? suppose so + $FS::CurrentUser::CurrentUser = $oldCurrentUser if $jobuser; if ( $@ ) { dbh->rollback; my %hash = $ljob->hash; |