diff options
| author | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-20 01:42:15 -0500 |
|---|---|---|
| committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-24 17:49:06 -0500 |
| commit | 98ed783317fe098b221dda211ef6264cf6334c43 (patch) | |
| tree | cc2a3c1337f365033714a85379e0ade88469f504 /FS/bin | |
| parent | 0d678bcd0d18621ede25d0465b71e919e1c5212e (diff) | |
RT#14829: automatic payments triggered by bill now show up as Payment by fs_queue
Diffstat (limited to 'FS/bin')
| -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 f5284e708..82dc81407 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; |
