mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
try to resolve a use-session-stored-data related problem; make sure account_id and prefs are restored after send_notification
This commit is contained in:
parent
9c1cb15fbd
commit
7744905ba8
@ -690,25 +690,31 @@ abstract class bo_tracking
|
||||
if (!$email) return false;
|
||||
|
||||
if (!$this->save_prefs) $this->save_prefs = $GLOBALS['egw_info']['user'];
|
||||
|
||||
$save_account_id = $GLOBALS['egw_info']['user']['account_id'];
|
||||
if (is_numeric($user_or_lang)) // user --> read everything from his prefs
|
||||
{
|
||||
$GLOBALS['egw_info']['user']['account_id'] = $user_or_lang;
|
||||
$GLOBALS['egw']->preferences->__construct($user_or_lang);
|
||||
$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository(false); // no session prefs!
|
||||
|
||||
$returnfalsenow = false;
|
||||
if ($check && $this->check2pref) $check = $this->check2pref[$check];
|
||||
if ($check && !$GLOBALS['egw_info']['user']['preferences'][$this->app][$check])
|
||||
{
|
||||
return false; // no notification requested
|
||||
$returnfalsenow = true;//return false; // no notification requested
|
||||
}
|
||||
if ($check && $GLOBALS['egw_info']['user']['preferences'][$this->app][$check] === 'assignment' && !$assignment_changed)
|
||||
if (!$returnfalsenow && $check && $GLOBALS['egw_info']['user']['preferences'][$this->app][$check] === 'assignment' && !$assignment_changed)
|
||||
{
|
||||
return false; // only notification about changed assignment requested
|
||||
$returnfalsenow = true;//return false; // only notification about changed assignment requested
|
||||
}
|
||||
if($this->user == $user_or_lang && !$this->notify_current_user)
|
||||
if(!$returnfalsenow && $this->user == $user_or_lang && !$this->notify_current_user)
|
||||
{
|
||||
return false; // no popup for own actions
|
||||
$returnfalsenow = true;//return false; // no popup for own actions
|
||||
}
|
||||
if ($returnfalsenow)
|
||||
{
|
||||
$GLOBALS['egw_info']['user']['account_id'] = $save_account_id;
|
||||
$GLOBALS['egw_info']['user'] = $this->save_prefs;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -762,6 +768,8 @@ abstract class bo_tracking
|
||||
}
|
||||
catch (Exception $exception)
|
||||
{
|
||||
$GLOBALS['egw_info']['user']['account_id'] = $save_account_id;
|
||||
$GLOBALS['egw_info']['user'] = $this->save_prefs;
|
||||
$this->errors[] = $exception->getMessage();
|
||||
return false;
|
||||
}
|
||||
@ -769,6 +777,8 @@ abstract class bo_tracking
|
||||
error_log('tracking: cannot send any notifications because notifications is not installed');
|
||||
}
|
||||
|
||||
$GLOBALS['egw_info']['user']['account_id'] = $save_account_id;
|
||||
$GLOBALS['egw_info']['user'] = $this->save_prefs;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,9 @@ class send extends egw_mailer
|
||||
*
|
||||
* To be able to call PHPMailer's Send function, we check if a subject, body or address is set and call it in that case,
|
||||
* else we do our constructors work.
|
||||
* @param string $_app the app that is responsible for the sending itself, if available an appspecific profile is fetched/merged
|
||||
*/
|
||||
function send()
|
||||
function send($_app='felamimail')
|
||||
{
|
||||
if ($this->debug && is_numeric($this->debug)) $this->SMTPDebug = $this->debug;
|
||||
if ($this->Subject || $this->Body || count($this->to))
|
||||
@ -40,7 +41,7 @@ class send extends egw_mailer
|
||||
|
||||
$this->CharSet = translation::charset();
|
||||
$this->IsSmtp();
|
||||
$restoreSession = $getUserDefinedProfiles = true;
|
||||
$restoreSession = $getUserDefinedProfiles = false; // no caching for profiles used for notification any more
|
||||
// if dontUseUserDefinedProfiles is set to yes/true/1 dont restore the session AND dont retrieve UserdefinedAccount settings
|
||||
$notification_config = config::read('notifications');
|
||||
if ($notification_config['dontUseUserDefinedProfiles']) $restoreSession = $getUserDefinedProfiles = false;
|
||||
@ -55,7 +56,8 @@ class send extends egw_mailer
|
||||
if ($bopreferences) {
|
||||
if ($this->debug) error_log(__METHOD__." using felamimail preferences for mailing.");
|
||||
// if dontUseUserDefinedProfiles is set to yes/true/1 dont retrieve UserdefinedAccount settings
|
||||
$preferences = $bopreferences->getPreferences($getUserDefinedProfiles);
|
||||
$preferences = $bopreferences->getPreferences($getUserDefinedProfiles,0,$_app);
|
||||
if ($this->debug) error_log(__METHOD__.__LINE__.' Preferences fetched:'.array2string($preferences));
|
||||
if ($preferences) {
|
||||
$ogServer = $preferences->getOutgoingServer(0);
|
||||
if ($ogServer) {
|
||||
|
Loading…
Reference in New Issue
Block a user