From f71cd37af633ee9328d6e103be8c993f86702366 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 16 Jul 2010 12:04:51 +0000 Subject: [PATCH] use notifications option/configuration to enforce the use of emailadminprofiles only for notifications --- phpgwapi/inc/class.send.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 4b83c1db19..c17ac2c9fc 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -56,11 +56,15 @@ } $this->SetLanguage($lang,$lang_path); $this->IsSmtp(); - - $bopreferences =& CreateObject('felamimail.bopreferences'); + $restoreSession = $getUserDefinedProfiles = true; + // 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; + $bopreferences =& CreateObject('felamimail.bopreferences',$restoreSession); if ($bopreferences) { if ($this->debug) error_log(__METHOD__." using felamimail preferences for mailing."); - $preferences = $bopreferences->getPreferences(); + // if dontUseUserDefinedProfiles is set to yes/true/1 dont retrieve UserdefinedAccount settings + $preferences = $bopreferences->getPreferences($getUserDefinedProfiles); if ($preferences) { $ogServer = $preferences->getOutgoingServer(0); if ($ogServer) {