From 31914b14f3d149e4d72fd101dfe6a1337738107a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 15 May 2012 12:16:25 +0000 Subject: [PATCH] * AsyncServices/Calendar: when multiple alarms / async jobs run at same time, they send mail with from address of first alarm/job caused by ExecMethod re-using objects instanciated in $GLOBALS, which get now unset when user-context needs to change because async job runs under different user --- phpgwapi/inc/class.asyncservice.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index 155f85b6b6..cf04944537 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -401,6 +401,11 @@ class asyncservice // if ($GLOBALS['egw_info']['user']['account_id'] != $job['account_id']) { + // unset all objects in $GLOBALS, which are created and used by ExecMethod, as they can contain user-data + foreach($GLOBALS as $name => $value) + { + if ($name !== 'egw' && is_object($value)) unset($GLOBALS[$name]); + } $domain = $GLOBALS['egw_info']['user']['domain']; $lang = $GLOBALS['egw_info']['user']['preferences']['common']['lang']; unset($GLOBALS['egw_info']['user']);