From a87e7506908e0c407aaeeae824cb4510d69438e6 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 19 Jul 2010 07:33:39 +0000 Subject: [PATCH] use notifications option/configuration to enforce the use of emailadminprofiles only for notifications --- felamimail/inc/class.bopreferences.inc.php | 4 ++-- notifications/lang/egw_de.lang | 4 ++++ notifications/lang/egw_en.lang | 4 ++++ notifications/templates/default/config.tpl | 12 ++++++++++++ phpgwapi/inc/class.send.inc.php | 10 +++++++--- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/felamimail/inc/class.bopreferences.inc.php b/felamimail/inc/class.bopreferences.inc.php index 9cc285e28b..d4e24fa894 100644 --- a/felamimail/inc/class.bopreferences.inc.php +++ b/felamimail/inc/class.bopreferences.inc.php @@ -202,7 +202,7 @@ return array(); } - function getPreferences() + function getPreferences($getUserDefinedProfiles=true) { if (isset($this->sessionData['profileData']) && is_a($this->sessionData['profileData'],'ea_preferences')) { $this->profileData = $this->sessionData['profileData']; @@ -214,7 +214,7 @@ if(!is_a($profileData, 'ea_preferences') || !is_a($profileData->ic_server[0], 'defaultimap')) { return false; } - if($profileData->userDefinedAccounts && $GLOBALS['egw_info']['user']['apps']['felamimail']) { + if($profileData->userDefinedAccounts && $GLOBALS['egw_info']['user']['apps']['felamimail'] && $getUserDefinedProfiles) { // get user defined accounts $accountData = $this->getAccountData($profileData); diff --git a/notifications/lang/egw_de.lang b/notifications/lang/egw_de.lang index c7c0af2183..8b5a6c5fd8 100644 --- a/notifications/lang/egw_de.lang +++ b/notifications/lang/egw_de.lang @@ -1,5 +1,7 @@ all possible notification backends notifications de alle verfügbaren Benachrichtigungs-Schnittstellen +check both (first try (active) user defined account, if none use emailadmin profile) admin de Prüfe beides (wenn vorhanden verwende das aktive Benutzerdefinierte Konto, sonst das Emailadminprofil) choose a notification-chain. you will be notified over the backends included in the chain.
note: if a notification-chain is marked as "disabled", your administrator does not allow one or more of the backends included in the chain and notifications falls back to "e-mail" while notifying you. notifications de Wählen Sie eine Benachrichtigungskette. Sie werden über die Schnittstellen benachrichtigt, die in der Kette enthalten sind.
Bitte beachten: Wenn eine Benachrichtigungskette als "deaktiviert" markiert ist oder Ihr Administrator erlaubt ein oder mehrere Schnittstellen nicht, die in der Kette enthalten sind, so weicht die EGroupware-Benachrichtigung auf die Methode "E-Mail" aus. +choose from mailsettings used for notification admin de Auswahl der für die Benachrichtigung per eMail verwendeten Mailprofile common chains notifications de Einfache Ketten disabled chains notifications de Deaktivierte Ketten do not notify me at all notifications de benachrichtige mich niemals @@ -12,6 +14,7 @@ egroupware-popup first, if that fails notify me by e-mail notifications de zuers egroupware-popup first, if that fails notify me by sms notifications de zuerst EGroupware-Popup. Wenn dies fehl schlägt, benachrichtige mich per SMS. egroupware-popup only notifications de nur EGroupware-Popup egroupware-popup verbosity notifications de EGroupware-Popup Mitteilungspriorität +emailadmin profile only (do not use user defined (active) mail profiles for notification) admin de Nur Emailadmin Profil (aktive Benutzerdefinierte Konten werden nicht für die Notifizierung per eMail verwendet) enable egroupware-popup backend admin de EGroupware-Popup Schnittstelle aktivieren enable sms backend admin de SMS Schnittstelle aktivieren enable windows-popup backend admin de Windows-Popup Schnittstelle aktivieren @@ -21,6 +24,7 @@ from notifications de von how verbose should the egroupware-popup behave if a notification is sent to the user:
low: just display the notification bell in the topmenu - topmenu must be enabled!
medium: bring notification window to front
high: bring notification window to front and let the browser do something to announce itself notifications de Wie hoch soll das EGroupware-Popup die Priorität setzen wenn eine Benachrichtigung an den Benutzer gesendet wird:
Niedrig: Es wird nur die Benachrichtigungsglocke im Topmenü angezeigt - das Topmenü muss hierfür eingeschaltet sein!
Mittel: Holt das Benachrichtigungsfenster in den Vordergrund
Hoch: Holt das Benachrichtigungsfenster in den Vordergrund und aktiviert den Browser zur besseren Erkennung der Benachrichtigung. if set, embedded links get rendered special for external clients notifications de Wenn diese Option aktiviert ist, werden in der Benachrichtigungs-E-Mail "eingebettete Links" für externe E-Mail-Clients besondert behandelt. linked entries: common de Verknüpfte Einträge: +mail backend admin de Mail Schnittstelle maximum sms messages per notification admin de Maximale Anzahl an SMS Nachrichten pro Benachrichtigung message from notifications de Nachricht von minutes notifications de Minuten diff --git a/notifications/lang/egw_en.lang b/notifications/lang/egw_en.lang index 28755d326e..22927644c8 100644 --- a/notifications/lang/egw_en.lang +++ b/notifications/lang/egw_en.lang @@ -1,5 +1,7 @@ all possible notification backends notifications en all possible notification backends +check both (first try (active) user defined account, if none use emailadmin profile) admin en Check both (first try (active) User defined account, if none use emailadmin profile) choose a notification-chain. you will be notified over the backends included in the chain.
note: if a notification-chain is marked as "disabled", your administrator does not allow one or more of the backends included in the chain and notifications falls back to "e-mail" while notifying you. notifications en Choose a notification-chain. You will be notified over the backends included in the chain.
Note: If a notification-chain is marked as "disabled", your Administrator does not allow one or more of the backends included in the chain, the notifications falls back to "E-Mail" while notifying you. +choose from mailsettings used for notification admin en choose from mailsettings used for email notification common chains notifications en common chains disabled chains notifications en disabled chains do not notify me at all notifications en do not notify me at all @@ -12,6 +14,7 @@ egroupware-popup first, if that fails notify me by e-mail notifications en EGrou egroupware-popup first, if that fails notify me by sms notifications en EGroupware-Popup first, if that fails notify me by SMS egroupware-popup only notifications en EGroupware-Popup only egroupware-popup verbosity notifications en EGroupware-Popup verbosity +emailadmin profile only (do not use user defined (active) mail profiles for notification) admin en Emailadmin Profile only (Do not use User defined (active) Mail Profiles for Notification) enable egroupware-popup backend admin en enable EGroupware-Popup backend enable sms backend admin en enable SMS backend enable windows-popup backend admin en enable Windows-Popup backend @@ -21,6 +24,7 @@ from notifications en from how verbose should the egroupware-popup behave if a notification is sent to the user:
low: just display the notification bell in the topmenu - topmenu must be enabled!
medium: bring notification window to front
high: bring notification window to front and let the browser do something to announce itself notifications en How verbose should the EGroupware-Popup behave if a notification is sent to the user:
low: just display the notification bell in the topmenu - topmenu must be enabled!
medium: bring notification window to front
high: bring notification window to front and let the browser do something to announce itself if set, embedded links get rendered special for external clients notifications en If set, embedded links get rendered special for external clients linked entries: common en linked entries: +mail backend admin en Mail backend maximum sms messages per notification admin en maximum SMS messages per notification message from notifications en message from minutes notifications en minutes diff --git a/notifications/templates/default/config.tpl b/notifications/templates/default/config.tpl index bda08019d4..1eac222768 100644 --- a/notifications/templates/default/config.tpl +++ b/notifications/templates/default/config.tpl @@ -66,6 +66,18 @@ + +  {lang_Mail_backend} + + + {lang_choose_from_mailsettings_used_for_notification} + + + + diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 916ff16776..1fe8e93805 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) {