diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 0f4191257..53b8a148c 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -27,6 +27,7 @@ require_once("../inc/inc.ClassNotificationService.php"); require_once("../inc/inc.ClassEmailNotify.php"); require_once("../inc/inc.ClassUI.php"); require_once("../inc/inc.ClassController.php"); +require_once("../inc/inc.Notification.php"); require_once("../inc/inc.ClassSession.php"); require_once("../inc/inc.ClassPasswordStrength.php"); @@ -68,27 +69,6 @@ if (isset($_COOKIE["mydms_session"])) { $role = $user->getRole(); $dms->noReadForStatus = $role->getNoAccess(); - global $logger; - $notifier = new SeedDMS_NotificationService($logger, $settings); - if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { - if(method_exists($notificationObj, 'preAddService')) { - $notificationObj->preAddService($dms, $notifier); - } - } - } - - if($settings->_enableEmail) { - $notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword), 'email'); - } - - if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { - if(method_exists($notificationObj, 'postAddService')) { - $notificationObj->postAddService($dms, $notifier); - } - } - } include $settings->_rootDir . "languages/" . $resArr["language"] . "/lang.inc"; } else { $user = null; diff --git a/restapi/index.php b/restapi/index.php index c053be7ae..7b113d821 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -15,28 +15,6 @@ require_once("../inc/inc.ClassEmailNotify.php"); require_once("../inc/inc.Notification.php"); require_once("../inc/inc.ClassController.php"); -$notifier = new SeedDMS_NotificationService($logger, $settings); - -if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { - if(method_exists($notificationObj, 'preAddService')) { - $notificationObj->preAddService($dms, $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, $notifier); - } - } -} - require "vendor/autoload.php"; use Psr\Container\ContainerInterface; diff --git a/webdav/index.php b/webdav/index.php index e148a8029..a70b701d4 100644 --- a/webdav/index.php +++ b/webdav/index.php @@ -15,28 +15,6 @@ require_once("../inc/inc.ClassEmailNotify.php"); require_once("../inc/inc.Notification.php"); require_once("../inc/inc.ClassController.php"); -$notifier = new SeedDMS_NotificationService($logger, $settings); - -if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { - if(method_exists($notificationObj, 'preAddService')) { - $notificationObj->preAddService($dms, $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, $notifier); - } - } -} - include("webdav.php"); $server = new HTTP_WebDAV_Server_SeedDMS(); $server->ServeRequest($dms, $settings, $logger, $notifier, $authenticator);