no need to create notification service a second time

This commit is contained in:
Uwe Steinmann 2023-03-31 12:00:56 +02:00
parent 23a94f8ac8
commit 7790f483f0
3 changed files with 1 additions and 65 deletions

View File

@ -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");
@ -63,27 +64,6 @@ if (isset($_COOKIE["mydms_session"])) {
$dms->setRootFolderID($user->getHomeFolder());
}
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;

View File

@ -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;

View File

@ -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);