From 6132c364de4f1700cc48aa1f1dd0c141dec6f667 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 9 Mar 2016 18:25:17 +0100 Subject: [PATCH] call hooks before and after setting notification service --- inc/inc.Authentication.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/inc/inc.Authentication.php b/inc/inc.Authentication.php index 1a7b77314..f91efff8b 100644 --- a/inc/inc.Authentication.php +++ b/inc/inc.Authentication.php @@ -91,11 +91,30 @@ $theme = $resArr["theme"]; $lang = $resArr["language"]; $dms->setUser($user); + $notifier = new SeedDMS_NotificationService(); + +if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { + if(method_exists($notificationObj, 'preAddService')) { + $notificationObj->postAddService($dms, $settings, $notifier); + } + } +} + if($settings->_enableEmail) { $notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword)); } +if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { + if(method_exists($notificationObj, 'postAddService')) { + $notificationObj->postAddService($dms, $settings, $notifier); + } + } +} + + /* Include the language file as specified in the session. If that is not * available use the language from the settings */