From 7e4514c450d75330a26802abe03fc47ae262afb6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:21:22 +0100 Subject: [PATCH 01/13] onPreRemoveDocument hook returns when return value is a boolean --- SeedDMS_Core/Core/inc.ClassDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index cdd5ca03f..6d9108b5d 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -2189,7 +2189,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ if(isset($this->_dms->callbacks['onPreRemoveDocument'])) { foreach($this->_dms->callbacks['onPreRemoveDocument'] as $callback) { $ret = call_user_func($callback[0], $callback[1], $this); - if($ret === false) + if(is_bool($ret)) return $ret; } } From cfec7323d7229f379a3d3e98f9770bba74e22cb8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:22:35 +0100 Subject: [PATCH 02/13] add hooks on[Post|Pre]RemoveFromDatabaseFolder on[Post|Pre]RemoveFolder is called before and after any removal --- SeedDMS_Core/Core/inc.ClassFolder.php | 34 +++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassFolder.php b/SeedDMS_Core/Core/inc.ClassFolder.php index b7b29500b..b6ff9e035 100644 --- a/SeedDMS_Core/Core/inc.ClassFolder.php +++ b/SeedDMS_Core/Core/inc.ClassFolder.php @@ -967,8 +967,8 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { $db = $this->_dms->getDB(); /* Check if 'onPreRemoveFolder' callback is set */ - if(isset($this->_dms->callbacks['onPreRemoveFolder'])) { - foreach($this->_dms->callbacks['onPreRemoveFolder'] as $callback) { + if(isset($this->_dms->callbacks['onPreRemoveFromDatabaseFolder'])) { + foreach($this->_dms->callbacks['onPreRemoveFromDatabaseFolder'] as $callback) { $ret = call_user_func($callback[0], $callback[1], $this); if(is_bool($ret)) return $ret; @@ -1008,10 +1008,10 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { $db->commitTransaction(); /* Check if 'onPostRemoveFolder' callback is set */ - if(isset($this->_dms->callbacks['onPostRemoveFolder'])) { - foreach($this->_dms->callbacks['onPostRemoveFolder'] as $callback) { - /** @noinspection PhpStatementHasEmptyBodyInspection */ - if(!call_user_func($callback[0], $callback[1], $this->_id)) { + if(isset($this->_dms->callbacks['onPostRemoveFromDatabaseFolder'])) { + foreach($this->_dms->callbacks['onPostRemoveFromDatabaseFolder'] as $callback) { + /** @noinspection PhpStatementHasEmptyBodyInspection */ + if(!call_user_func($callback[0], $callback[1], $this->_id)) { } } } @@ -1035,6 +1035,15 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { return false; } + /* Check if 'onPreRemoveFolder' callback is set */ + if(isset($this->_dms->callbacks['onPreRemoveFolder'])) { + foreach($this->_dms->callbacks['onPreRemoveFolder'] as $callback) { + $ret = call_user_func($callback[0], $callback[1], $this); + if(is_bool($ret)) + return $ret; + } + } + //Entfernen der Unterordner und Dateien $res = $this->getSubFolders(); if (is_bool($res) && !$res) return false; @@ -1055,7 +1064,18 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { } } - return $this->removeFromDatabase(); + $ret = $this->removeFromDatabase(); + if(!$ret) + return $ret; + + /* Check if 'onPostRemoveFolder' callback is set */ + if(isset($this->_dms->callbacks['onPostRemoveFolder'])) { + foreach($this->_dms->callbacks['onPostRemoveFolder'] as $callback) { + call_user_func($callback[0], $callback[1], $this); + } + } + + return $ret; } /* }}} */ /** From cf64a440da76fe02674150894fe657e07f86ebbd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:24:59 +0100 Subject: [PATCH 03/13] init $indexconf --- op/op.RemoveDocument.php | 1 + 1 file changed, 1 insertion(+) diff --git a/op/op.RemoveDocument.php b/op/op.RemoveDocument.php index afdcceb8b..be3f53b5e 100644 --- a/op/op.RemoveDocument.php +++ b/op/op.RemoveDocument.php @@ -62,6 +62,7 @@ if($settings->_enableFullSearch) { $indexconf['Indexer']::init($settings->_stopWordsFile); } else { $index = null; + $indexconf = null; } $folder = $document->getFolder(); From 7f0a8d1094225c40c1412928be713dc759432983 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:25:16 +0100 Subject: [PATCH 04/13] no need to include Init.php twice --- op/op.Ajax.php | 1 - 1 file changed, 1 deletion(-) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index db700478a..7f9a6da89 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -22,7 +22,6 @@ include("../inc/inc.Utils.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); -include("../inc/inc.Init.php"); include("../inc/inc.DBInit.php"); include("../inc/inc.ClassNotificationService.php"); include("../inc/inc.ClassEmailNotify.php"); From f5f28d9e30e445b5992959bf42e09e250115339c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:35:06 +0100 Subject: [PATCH 05/13] use controller and check for extensions --- utils/adddoc.php | 135 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 102 insertions(+), 33 deletions(-) diff --git a/utils/adddoc.php b/utils/adddoc.php index 80c92386a..2564f6764 100644 --- a/utils/adddoc.php +++ b/utils/adddoc.php @@ -1,5 +1,9 @@ _extraPath)) - ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); +//if(isset($settings->_extraPath)) +// ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); -require_once("SeedDMS/Core.php"); +//require_once("SeedDMS/Core.php"); if(isset($options['F'])) { $folderid = (int) $options['F']; @@ -119,18 +124,26 @@ if(isset($options['V'])) { if($reqversion<1) $reqversion=1; -$db = new SeedDMS_Core_DatabaseAccess($settings->_dbDriver, $settings->_dbHostname, $settings->_dbUser, $settings->_dbPass, $settings->_dbDatabase); -$db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostname . "\""); +include("../inc/inc.Settings.php"); +include("../inc/inc.Init.php"); +include("../inc/inc.Extension.php"); +include("../inc/inc.DBInit.php"); +include("../inc/inc.ClassNotificationService.php"); +include("../inc/inc.ClassEmailNotify.php"); +include("../inc/inc.ClassController.php"); + +//$db = new SeedDMS_Core_DatabaseAccess($settings->_dbDriver, $settings->_dbHostname, $settings->_dbUser, $settings->_dbPass, $settings->_dbDatabase); +//$db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostname . "\""); //$db->_conn->debug = 1; -$dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffsetDir); -if(!$dms->checkVersion()) { - echo "Database update needed."; - exit; -} +//$dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffsetDir); +//if(!$dms->checkVersion()) { +// echo "Database update needed."; +// exit; +//} -/* Parse categories */ +/* Parse categories {{{ */ $categories = array(); if(isset($options['K'])) { $categorynames = explode(',', $options['K']); @@ -142,9 +155,9 @@ if(isset($options['K'])) { echo "Category '".$categoryname."' not found\n"; } } -} +} /* }}} */ -/* Parse document attributes. */ +/* Parse document attributes. {{{ */ $document_attributes = array(); if (isset($options['a'])) { $docattr = array(); @@ -168,9 +181,9 @@ if (isset($options['a'])) { } $document_attributes[$attrdef->getID()] = $attrVal; } -} +} /* }}} */ -/* Parse version attributes. */ +/* Parse version attributes. {{{ */ $version_attributes = array(); if (isset($options['A'])) { $verattr = array(); @@ -194,15 +207,9 @@ if (isset($options['A'])) { } $version_attributes[$attrdef->getID()] = $attrVal; } -} +} /* }}} */ - -$dms->setRootFolderID($settings->_rootFolderID); -$dms->setMaxDirID($settings->_maxDirID); -$dms->setEnableConverting($settings->_enableConverting); -$dms->setViewOnlineFileTypes($settings->_viewOnlineFileTypes); - -/* Create a global user object */ +/* Create a global user object {{{ */ if($username) { if(!($user = $dms->getUserByLogin($username))) { echo "No such user '".$username."'."; @@ -211,6 +218,34 @@ if($username) { } else $user = $dms->getUser(1); +$dms->setUser($user); +/* }}} */ + +/* Create a global notifier object {{{ */ +$notifier = new SeedDMS_NotificationService(); + +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); + } + } +} +/* }}} */ + +/* Check if file is readable {{{ */ if(is_readable($filename)) { if(filesize($filename)) { $finfo = new finfo(FILEINFO_MIME_TYPE); @@ -226,6 +261,7 @@ if(is_readable($filename)) { echo "File is not readable\n"; exit(1); } +/* }}} */ $folder = $dms->getFolder($folderid); @@ -244,7 +280,6 @@ if (!is_numeric($sequence)) { exit(1); } -//$expires = ($_POST["expires"] == "true") ? mktime(0,0,0, sanitizeString($_POST["expmonth"]), sanitizeString($_POST["expday"]), sanitizeString($_POST["expyear"])) : false; $expires = false; if(!$name) @@ -254,13 +289,47 @@ $filetmp = $filename; $reviewers = array(); $approvers = array(); -$res = $folder->addDocument($name, $comment, $expires, $user, $keywords, - $categories, $filetmp, basename($filename), - $filetype, $mimetype, $sequence, $reviewers, - $approvers, $reqversion, $version_comment, - $document_attributes, $version_attributes); +if($settings->_enableFullSearch) { + $index = $indexconf['Indexer']::open($settings->_luceneDir); + $indexconf['Indexer']::init($settings->_stopWordsFile); +} else { + $index = null; + $indexconf = null; +} -if (is_bool($res) && !$res) { +$controller = Controller::factory('AddDocument'); +$controller->setParam('documentsource', 'script'); +$controller->setParam('folder', $folder); +$controller->setParam('index', $index); +$controller->setParam('indexconf', $indexconf); +$controller->setParam('name', $name); +$controller->setParam('comment', $comment); +$controller->setParam('expires', $expires); +$controller->setParam('keywords', $keywords); +$controller->setParam('categories', $categories); +$controller->setParam('owner', $user); +$controller->setParam('userfiletmp', $filetmp); +$controller->setParam('userfilename', basename($filename)); +$controller->setParam('filetype', $filetype); +$controller->setParam('userfiletype', $mimetype); +$minmax = $folder->getDocumentsMinMax(); +if($settings->_defaultDocPosition == 'start') + $controller->setParam('sequence', $minmax['min'] - 1); +else + $controller->setParam('sequence', $minmax['max'] + 1); +$controller->setParam('reviewers', $reviewers); +$controller->setParam('approvers', $approvers); +$controller->setParam('reqversion', $reqversion); +$controller->setParam('versioncomment', $version_comment); +$controller->setParam('attributes', $document_attributes); +$controller->setParam('attributesversion', $version_attributes); +$controller->setParam('workflow', null); +$controller->setParam('notificationgroups', array()); +$controller->setParam('notificationusers', array()); +$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText); +$controller->setParam('defaultaccessdocs', $settings->_defaultAccessDocs); + +if(!$document = $controller->run()) { echo "Could not add document to folder\n"; exit(1); } From ed93657566cc45c8b26960cf16670ec874e06b39 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 12:36:24 +0100 Subject: [PATCH 06/13] use extensions and controller --- webdav/index.php | 14 +++--- webdav/webdav.php | 111 +++++++++++++++++++++++++++++++++------------- 2 files changed, 86 insertions(+), 39 deletions(-) diff --git a/webdav/index.php b/webdav/index.php index 377e80789..52a80179d 100644 --- a/webdav/index.php +++ b/webdav/index.php @@ -1,13 +1,12 @@ _dbDriver, $settings->_dbHostname, $settings->_dbUser, $settings->_dbPass, $settings->_dbDatabase); -$db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostname . "\""); -$db->getResult("set names 'utf8'"); - -$dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffsetDir); if($settings->_logFileEnable) { if ($settings->_logFileRotation=="h") $logname=date("YmdH", time()); @@ -19,6 +18,7 @@ if($settings->_logFileEnable) { $log = null; } +include("webdav.php"); $server = new HTTP_WebDAV_Server_SeedDMS(); $server->ServeRequest($dms, $log); //$files = array(); diff --git a/webdav/webdav.php b/webdav/webdav.php index 716c6cfb7..805de36b6 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -1,10 +1,6 @@ _coreDir)) - require_once($settings->_coreDir.'/Core.php'); -else - require_once('SeedDMS/Core.php'); /** * SeedDMS access using WebDAV @@ -270,7 +266,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $files["files"][] = $this->fileinfo($obj); // information for contained resources requested? - if (get_class($obj) == 'SeedDMS_Core_Folder' && !empty($options["depth"])) { + if (get_class($obj) == $this->dms->getClassname('folder') && !empty($options["depth"])) { $subfolders = $obj->getSubFolders(); $subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $this->user, M_READ); @@ -320,7 +316,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $info["props"] = array(); // type and size (caller already made sure that path exists) - if (get_class($obj) == 'SeedDMS_Core_Folder') { + if (get_class($obj) == $this->dms->getClassname('folder')) { // modification time /* folders do not have a modification time */ $info["props"][] = $this->mkprop("getlastmodified", time()); @@ -421,7 +417,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if (!$obj) return false; // is this a collection? - if (get_class($obj) == 'SeedDMS_Core_Folder') { + if (get_class($obj) == $this->dms->getClassname('folder')) { return $this->GetDir($obj, $options); } @@ -502,7 +498,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server foreach ($objs as $obj) { $filename = $obj->getName(); $fullpath = $_fullpath.$filename; - if(get_class($obj) == 'SeedDMS_Core_Folder') { + if(get_class($obj) == $this->dms->getClassname('folder')) { $fullpath .= '/'; $filename .= '/'; $filesize = 0; @@ -553,7 +549,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $parent = ''; $folder = $this->reverseLookup($parent.'/'); - if (!$folder || get_class($folder) != "SeedDMS_Core_Folder") { + if (!$folder || get_class($folder) != $this->dms->getClassname('folder')) { return "409 Conflict"; } @@ -658,7 +654,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server } /* Check if parent of new folder is a folder */ - if (get_class($folder) != 'SeedDMS_Core_Folder') { + if (get_class($folder) != $this->dms->getClassname('folder')) { return "403 Forbidden"; } @@ -696,6 +692,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function DELETE($options) /* {{{ */ { + global $settings, $indexconf; + $this->log_options('DELETE', $options); // get folder or document from path @@ -712,7 +710,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "403 Forbidden"; } - if (get_class($obj) == 'SeedDMS_Core_Folder') { + if (get_class($obj) == $this->dms->getClassname('folder')) { if($obj->hasDocuments() || $obj->hasSubFolders()) { return "409 Conflict"; } @@ -720,15 +718,20 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "409 Conflict"; } } else { - // check if user is admin - // only admins may delete documents - /* There is not reason to allow only admins to remove a document - if(!$this->user->isAdmin()) { - return "403 Forbidden"; + if($settings->_enableFullSearch) { + $index = $indexconf['Indexer']::open($settings->_luceneDir); + $indexconf['Indexer']::init($settings->_stopWordsFile); + } else { + $index = null; + $indexconf = null; } - */ - if(!$obj->remove()) { + $controller = Controller::factory('RemoveDocument'); + $controller->setParam('document', $obj); + $controller->setParam('index', $index); + $controller->setParam('indexconf', $indexconf); + if(!$controller->run()) { +// if(!$obj->remove()) { return "409 Conflict"; } } @@ -782,12 +785,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "403 Forbidden"; } - if(get_class($objdest) == 'SeedDMS_Core_Document') { + if(get_class($objdest) == $this->dms->getClassname('document')) { /* If destination object is a document it must be overwritten */ if (!$options["overwrite"]) { return "412 precondition failed"; } - if(get_class($objsource) == 'SeedDMS_Core_Folder') { + if(get_class($objsource) == $this->dms->getClassname('folder')) { return "400 Bad request"; } @@ -808,11 +811,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $objsource->remove(); return "204 No Content"; - } elseif(get_class($objdest) == 'SeedDMS_Core_Folder') { + } elseif(get_class($objdest) == $this->dms->getClassname('folder')) { /* Set the new Folder of the source object */ - if(get_class($objsource) == 'SeedDMS_Core_Document') + if(get_class($objsource) == $this->dms->getClassname('document')) $objsource->setFolder($objdest); - elseif(get_class($objsource) == 'SeedDMS_Core_Folder') + elseif(get_class($objsource) == $this->dms->getClassname('folder')) $objsource->setParent($objdest); else return "500 Internal server error"; @@ -830,6 +833,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function COPY($options, $del=false) /* {{{ */ { + global $settings, $indexconf; + if(!$del) $this->log_options('COPY', $options); @@ -852,7 +857,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if (!$objsource) return "404 Not found"; - if (get_class($objsource) == 'SeedDMS_Core_Folder' && ($options["depth"] != "infinity")) { + if (get_class($objsource) == $this->dms->getClassname('folder') && ($options["depth"] != "infinity")) { // RFC 2518 Section 9.2, last paragraph return "400 Bad request"; } @@ -880,12 +885,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server } /* If destination object is a document it must be overwritten */ - if(get_class($objdest) == 'SeedDMS_Core_Document') { + if(get_class($objdest) == $this->dms->getClassname('document')) { if (!$options["overwrite"]) { return "412 precondition failed"; } /* Copying a folder into a document makes no sense */ - if(get_class($objsource) == 'SeedDMS_Core_Folder') { + if(get_class($objsource) == $this->dms->getClassname('folder')) { return "400 Bad request"; } @@ -902,12 +907,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $objdest->setName($objsource->getName()); return "204 No Content"; - } elseif(get_class($objdest) == 'SeedDMS_Core_Folder') { + } elseif(get_class($objdest) == $this->dms->getClassname('folder')) { if($this->logger) $this->logger->log('COPY: copy \''.$objdest->getName().'\' to folder '.$objdest->getName().'', PEAR_LOG_INFO); /* Currently no support for copying folders */ - if(get_class($objsource) == 'SeedDMS_Core_Folder') { + if(get_class($objsource) == $this->dms->getClassname('folder')) { if($this->logger) $this->logger->log('COPY: source is a folder '.$objsource->getName().'', PEAR_LOG_INFO); @@ -921,7 +926,49 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $content = $objsource->getLatestContent(); $fspath = $this->dms->contentDir.'/'.$content->getPath(); - if(!$newdoc = $objdest->addDocument($newdocname, '', 0, $this->user, '', array(), $fspath, $content->getOriginalFileName(), $content->getFileType(), $content->getMimeType(), 0, array(), array(), 0, "")) { + if($settings->_enableFullSearch) { + $index = $indexconf['Indexer']::open($settings->_luceneDir); + $indexconf['Indexer']::init($settings->_stopWordsFile); + } else { + $index = null; + $indexconf = null; + } + + $controller = Controller::factory('AddDocument'); + $controller->setParam('documentsource', 'webdav'); + $controller->setParam('folder', $objdest); + $controller->setParam('index', $index); + $controller->setParam('indexconf', $indexconf); + $controller->setParam('name', $newdocname); + $controller->setParam('comment', ''); + $controller->setParam('expires', 0); + $controller->setParam('keywords', ''); + $controller->setParam('categories', array()); + $controller->setParam('owner', $this->user); + $controller->setParam('userfiletmp', $fspath); + $controller->setParam('userfilename', $content->getOriginalFileName()); + $controller->setParam('filetype', $content->getFileType()); + $controller->setParam('userfiletype', $content->getMimeType()); + $minmax = $objdest->getDocumentsMinMax(); + if($settings->_defaultDocPosition == 'start') + $controller->setParam('sequence', $minmax['min'] - 1); + else + $controller->setParam('sequence', $minmax['max'] + 1); + $controller->setParam('reviewers', array()); + $controller->setParam('approvers', array()); + $controller->setParam('reqversion', 0); + $controller->setParam('versioncomment', ''); + $controller->setParam('attributes', array()); + $controller->setParam('attributesversion', array()); + $controller->setParam('workflow', null); + $controller->setParam('notificationgroups', array()); + $controller->setParam('notificationusers', array()); + $controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText); + $controller->setParam('defaultaccessdocs', $settings->_defaultAccessDocs); + + if(!$document = $controller->run()) { + +// if(!$newdoc = $objdest->addDocument($newdocname, '', 0, $this->user, '', array(), $fspath, $content->getOriginalFileName(), $content->getFileType(), $content->getMimeType(), 0, array(), array(), 0, "")) { if($this->logger) $this->logger->log('COPY: error copying object', PEAR_LOG_INFO); return "409 Conflict"; @@ -1016,7 +1063,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "200 OK"; // TODO recursive locks on directories not supported yet - if (get_class($obj) == 'SeedDMS_Core_Folder' && !empty($options["depth"])) { + if (get_class($obj) == $this->dms->getClassname('folder') && !empty($options["depth"])) { return "409 Conflict"; } @@ -1054,7 +1101,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "204 No Content"; // TODO recursive locks on directories not supported yet - if (get_class($obj) == 'SeedDMS_Core_Folder' && !empty($options["depth"])) { + if (get_class($obj) == $this->dms->getClassname('folder') && !empty($options["depth"])) { return "409 Conflict"; } @@ -1091,7 +1138,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server } // Folders cannot be locked - if(get_class($obj) == 'SeedDMS_Core_Folder') { + if(get_class($obj) == $this->dms->getClassname('folder')) { if($this->logger) $this->logger->log('checkLock: object is a folder', PEAR_LOG_INFO); return false; From 00429e6e3a84439fc96fdc02254968145d3ff77a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 7 Mar 2018 15:10:19 +0100 Subject: [PATCH 07/13] remove old code, add some more comments --- utils/adddoc.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/utils/adddoc.php b/utils/adddoc.php index 2564f6764..d26b891bb 100644 --- a/utils/adddoc.php +++ b/utils/adddoc.php @@ -56,16 +56,9 @@ if(isset($options['v']) || isset($options['verѕion'])) { /* Set alternative config file */ if(isset($options['config'])) { define('SEEDDMS_CONFIG_FILE', $options['config']); -// $settings = new Settings($options['config']); -} else { -// $settings = new Settings(); } -//if(isset($settings->_extraPath)) -// ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); - -//require_once("SeedDMS/Core.php"); - +/* Set parent folder */ if(isset($options['F'])) { $folderid = (int) $options['F']; } else { @@ -74,16 +67,19 @@ if(isset($options['F'])) { exit(1); } +/* Set comment of document */ $comment = ''; if(isset($options['c'])) { $comment = $options['c']; } +/* Set comment of version */ $version_comment = ''; if(isset($options['C'])) { $version_comment = $options['C']; } +/* Set keywords */ $keywords = ''; if(isset($options['k'])) { $keywords = $options['k']; @@ -132,17 +128,6 @@ include("../inc/inc.ClassNotificationService.php"); include("../inc/inc.ClassEmailNotify.php"); include("../inc/inc.ClassController.php"); -//$db = new SeedDMS_Core_DatabaseAccess($settings->_dbDriver, $settings->_dbHostname, $settings->_dbUser, $settings->_dbPass, $settings->_dbDatabase); -//$db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostname . "\""); -//$db->_conn->debug = 1; - - -//$dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffsetDir); -//if(!$dms->checkVersion()) { -// echo "Database update needed."; -// exit; -//} - /* Parse categories {{{ */ $categories = array(); if(isset($options['K'])) { From 7f2dd8513fac02e92679585f311cf0764f168545 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 8 Mar 2018 15:13:17 +0100 Subject: [PATCH 08/13] fix creation of preview if SeedDMS_Core_DocumentContent has been derived --- SeedDMS_Preview/Preview/Previewer.php | 3 ++- SeedDMS_Preview/package.xml | 26 +++++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index b9ed617ac..23c5a97de 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -57,9 +57,10 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { return false; $document = $object->getDocument(); + $dms = $document->_dms; $dir = $this->previewDir.'/'.$document->getDir(); switch(get_class($object)) { - case "SeedDMS_Core_DocumentContent": + case $dms->getClassname('documentcontent'): $target = $dir.'p'.$object->getVersion().'-'.$width; break; case "SeedDMS_Core_DocumentFile": diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index e446eaf34..2afd6da7b 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,10 +11,10 @@ uwe@steinmann.cx yes - 2018-01-18 + 2018-03-08 - 1.2.7 + 1.2.8 1.2.0 @@ -23,9 +23,7 @@ GPL License -add SeedDMS_Preview_Base::sendFile() as a replacement for readfile() which uses -mod_xsendfile if available -execWithTimeout() reads data from stderr and returns it together with stdout in array +preview is also created if SeedDMS_Core_DocumentContent has a child class @@ -354,5 +352,23 @@ SeedDMS_Preview_Base::setConverters() overrides existing converters. New method SeedDMS_Preview_Base::addConverters() merges new converters with old ones. + + 2018-01-18 + + + 1.2.7 + 1.2.0 + + + stable + stable + + GPL License + +add SeedDMS_Preview_Base::sendFile() as a replacement for readfile() which uses +mod_xsendfile if available +execWithTimeout() reads data from stderr and returns it together with stdout in array + + From aa29cbf073e705673c0323f1176124c4753cd2ce Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 8 Mar 2018 17:20:15 +0100 Subject: [PATCH 09/13] various new translations --- languages/ar_EG/lang.inc | 6 +++--- languages/cs_CZ/lang.inc | 4 ++-- languages/el_GR/lang.inc | 42 ++++++++++++++++++++-------------------- languages/fr_FR/lang.inc | 12 ++++++------ languages/nl_NL/lang.inc | 4 ++-- languages/pt_BR/lang.inc | 4 ++-- languages/tr_TR/lang.inc | 12 ++++++------ 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/languages/ar_EG/lang.inc b/languages/ar_EG/lang.inc index bf8f33c47..d844604b7 100644 --- a/languages/ar_EG/lang.inc +++ b/languages/ar_EG/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (1284) +// Translators: Admin (1286) $text = array( '2_factor_auth' => '', @@ -282,7 +282,7 @@ URL: [url]', 'content' => 'المحتوى', 'continue' => 'استمرار', 'converter_new_cmd' => '', -'converter_new_mimetype' => '', +'converter_new_mimetype' => 'ﻥﻮﻋ ﺝﺪﻳﺩ ﻢﻧ ﺎﻟﻮﺛﺎﺌﻗ', 'copied_to_checkout_as' => '', 'create_download_link' => '', 'create_fulltext_index' => 'انشاء فهرس للنص الكامل', @@ -314,7 +314,7 @@ URL: [url]', 'documentcontent' => '', 'documents' => 'المستندات', 'documents_checked_out_by_you' => '', -'documents_expired' => '', +'documents_expired' => 'ﻮﺛﺎﺌﻗ ﻢﻨﺘﻬﻳﺓ', 'documents_in_process' => 'مستندات رهن المعالجة', 'documents_locked' => '', 'documents_locked_by_you' => 'المستندات محمية من التعديل بواسطتك', diff --git a/languages/cs_CZ/lang.inc b/languages/cs_CZ/lang.inc index cbc1e6318..9fbdb846c 100644 --- a/languages/cs_CZ/lang.inc +++ b/languages/cs_CZ/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (738), kreml (455) +// Translators: Admin (739), kreml (455) $text = array( '2_factor_auth' => '', @@ -1575,7 +1575,7 @@ URL: [url]', 'toggle_manager' => 'Přepnout správce', 'toggle_qrcode' => '', 'to_before_from' => 'Datum ukončení nesmí být před datem zahájení', -'transfer_document' => '', +'transfer_document' => 'Přenést dokument', 'transfer_no_read_access' => '', 'transfer_no_write_access' => '', 'transfer_objects' => '', diff --git a/languages/el_GR/lang.inc b/languages/el_GR/lang.inc index 26908ea1f..67152e207 100644 --- a/languages/el_GR/lang.inc +++ b/languages/el_GR/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (231) +// Translators: Admin (251) $text = array( '2_factor_auth' => '', @@ -30,10 +30,10 @@ $text = array( 'access_control_is_off' => '', 'access_denied' => '', 'access_inheritance' => '', -'access_mode' => '', -'access_mode_all' => '', +'access_mode' => 'Είδος πρόσβασης', +'access_mode_all' => 'Πλήρης πρόσβαση', 'access_mode_none' => '', -'access_mode_read' => '', +'access_mode_read' => 'Δικαιώματα ανάγνωσης', 'access_mode_readwrite' => '', 'access_permission_changed_email' => '', 'access_permission_changed_email_body' => '', @@ -66,7 +66,7 @@ $text = array( 'add_revision' => '', 'add_role' => '', 'add_subfolder' => 'Νέος υποφάκελος', -'add_to_clipboard' => '', +'add_to_clipboard' => 'Προσθήκη στο πρόχειρο', 'add_to_transmittal' => '', 'add_transmittal' => '', 'add_user' => 'Νέος χρήστης', @@ -273,7 +273,7 @@ $text = array( 'create_fulltext_index' => '', 'create_fulltext_index_warning' => '', 'creation_date' => 'Δημιουργήθηκε', -'cs_CZ' => '', +'cs_CZ' => 'Τσέχικα', 'current_password' => '', 'current_quota' => '', 'current_state' => '', @@ -291,7 +291,7 @@ $text = array( 'details' => 'Λεπτομέρειες', 'details_version' => 'Λεπτομέρειες για την έκδοση: [version]', 'de_DE' => 'German/Γερμανικά', -'disclaimer' => '', +'disclaimer' => 'Διαβαθμισμένη περιοχή. Η πρόσβαση επιτρέπεται μόνο σε εξουσιοδοτημένο προσωπικό. Κάθε παράβαση διώκεται σύμφωνα με τους εθνικούς και διεθνής νόμους.', 'discspace' => '', 'docs_in_reception_no_access' => '', 'docs_in_revision_no_access' => '', @@ -382,7 +382,7 @@ $text = array( 'edit_default_keywords' => '', 'edit_document_access' => '', 'edit_document_notify' => '', -'edit_document_props' => '', +'edit_document_props' => 'Επεξεργασία εγγράφου', 'edit_event' => '', 'edit_existing_access' => '', 'edit_existing_attribute_groups' => '', @@ -507,8 +507,8 @@ $text = array( 'hours' => 'ώρες', 'hr_HR' => '', 'human_readable' => '', -'hu_HU' => '', -'id' => '', +'hu_HU' => 'Ουγγρικά', +'id' => 'ID', 'identical_version' => '', 'import' => '', 'importfs' => '', @@ -558,7 +558,7 @@ $text = array( 'in_workflow' => '', 'is_disabled' => '', 'is_hidden' => '', -'it_IT' => '', +'it_IT' => 'Ιταλικά', 'january' => 'Ιανουάριος', 'js_form_error' => '', 'js_form_errors' => '', @@ -588,7 +588,7 @@ $text = array( 'keywords' => 'Κλειδιά', 'keywords_loading' => 'Παρακαλούμε αναμείνατε. Φόρτωση λίστας λέξεων κλειδιών', 'keyword_exists' => 'Το κλειδί υπάρχει', -'ko_KR' => '', +'ko_KR' => 'Κορεάτικα', 'language' => 'Γλώσσα', 'lastaccess' => '', 'last_update' => 'Τελευταία Αναναίωση', @@ -606,7 +606,7 @@ $text = array( 'list_hooks' => '', 'local_file' => '', 'locked_by' => '', -'lock_document' => '', +'lock_document' => 'Κλείδωμα', 'lock_message' => '', 'lock_status' => 'Κατάσταση', 'login' => 'Είσοδος', @@ -687,7 +687,7 @@ URL: [url]', 'new_subfolder_email_subject' => '', 'new_user_image' => '', 'next_state' => '', -'nl_NL' => '', +'nl_NL' => 'Δανέζικα', 'no' => 'Όχι', 'notify_added_email' => '', 'notify_added_email_body' => '', @@ -901,7 +901,7 @@ URL: [url]', 'role_name' => '', 'role_type' => '', 'role_user' => 'Χρήστης', -'ro_RO' => '', +'ro_RO' => 'Ρουμάνικα', 'run_subworkflow' => '', 'run_subworkflow_email_body' => '', 'run_subworkflow_email_subject' => '', @@ -1300,7 +1300,7 @@ URL: [url]', 'sign_in' => 'Σύνδεση', 'sign_out' => 'Αποσύνδεση', 'sign_out_user' => 'Αποσύνδεση χρήστη', -'sk_SK' => '', +'sk_SK' => 'Σλοβάκικα', 'space_used_on_data_folder' => '', 'splash_added_to_clipboard' => '', 'splash_add_access' => '', @@ -1318,7 +1318,7 @@ URL: [url]', 'splash_document_checkedout' => '', 'splash_document_edited' => '', 'splash_document_indexed' => '', -'splash_document_locked' => '', +'splash_document_locked' => 'Κλειδωμένο έγγραφο', 'splash_document_unlocked' => '', 'splash_edit_access' => '', 'splash_edit_attribute' => '', @@ -1459,12 +1459,12 @@ URL: [url]', 'transmittal_size' => '', 'tree_loading' => '', 'trigger_workflow' => '', -'tr_TR' => '', +'tr_TR' => 'Τούρκικα', 'tuesday' => 'Τρίτη', 'tuesday_abbr' => '', 'type_of_hook' => '', 'type_to_search' => '', -'uk_UA' => '', +'uk_UA' => 'Ουκρανικά', 'under_folder' => '', 'unknown_attrdef' => '', 'unknown_command' => '', @@ -1559,7 +1559,7 @@ URL: [url]', 'x_more_objects' => '', 'year_view' => '', 'yes' => 'Ναι', -'zh_CN' => '', -'zh_TW' => '', +'zh_CN' => 'Κινέζικα (CN)', +'zh_TW' => 'Κινέζικα (TW)', ); ?> diff --git a/languages/fr_FR/lang.inc b/languages/fr_FR/lang.inc index 37ff6d619..dcc7701f2 100644 --- a/languages/fr_FR/lang.inc +++ b/languages/fr_FR/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (1079), jeromerobert (50), lonnnew (9), Oudiceval (650) +// Translators: Admin (1079), jeromerobert (50), lonnnew (9), Oudiceval (657) $text = array( '2_factor_auth' => 'Authentification forte', @@ -338,7 +338,7 @@ URL: [url]', 'documents_to_revise' => 'Documents en attente de votre révision', 'documents_user_draft' => 'Ébauches', 'documents_user_expiration' => 'Documents expirés', -'documents_user_needs_correction' => '', +'documents_user_needs_correction' => 'Documents nécessitant une correction', 'documents_user_no_reception' => 'Documents sans réception', 'documents_user_obsolete' => 'Documents obsolètes', 'documents_user_reception' => 'Documents en attente de réception', @@ -450,7 +450,7 @@ Le lien est valide jusqu’au [valid]. 'edit_comment' => 'Modifier le commentaire', 'edit_default_keywords' => 'Modifier les mots-clés', 'edit_document_access' => 'Modifier les droits d\'accès', -'edit_document_notify' => 'Notifications de documents', +'edit_document_notify' => 'Notification de document', 'edit_document_props' => 'Modifier le document', 'edit_event' => 'Modifier l\'événement', 'edit_existing_access' => 'Modifier la liste des droits d\'accès', @@ -458,7 +458,7 @@ Le lien est valide jusqu’au [valid]. 'edit_existing_notify' => 'Modifier les notifications', 'edit_folder_access' => 'Modifier les droits d\'accès', 'edit_folder_attrdefgrp' => 'Modifier les groupes d’attributs', -'edit_folder_notify' => 'Liste de notification de dossiers', +'edit_folder_notify' => 'Notification de dossier', 'edit_folder_props' => 'Modifier le dossier', 'edit_group' => 'Modifier un groupe', 'edit_online' => 'Modification en ligne', @@ -587,7 +587,7 @@ URL: [url]', 'group_exists' => 'Ce groupe existe déjà.', 'group_info' => 'Informations du groupe', 'group_management' => 'Gestion des groupes', -'group_members' => 'Membres de groupes', +'group_members' => 'Membres du groupe', 'group_receipt_summary' => 'Vue d’ensemble groupe réception', 'group_review_summary' => 'Vue d’ensemble groupe vérification', 'guest_login' => 'Se connecter comme invité', @@ -810,7 +810,7 @@ URL: [url]', 'no_default_keywords' => 'Aucun mot-clé disponible', 'no_docs_checked_out' => '', 'no_docs_locked' => 'Aucun document verrouillé', -'no_docs_needs_correction' => '', +'no_docs_needs_correction' => 'Aucun document ne nécessite de correction', 'no_docs_rejected' => 'Aucun document rejeté.', 'no_docs_to_approve' => 'Aucun document ne nécessite actuellement une approbation', 'no_docs_to_look_at' => 'Aucun document à surveiller', diff --git a/languages/nl_NL/lang.inc b/languages/nl_NL/lang.inc index dd6ce0e76..756b117f5 100644 --- a/languages/nl_NL/lang.inc +++ b/languages/nl_NL/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (745), gijsbertush (610), pepijn (45), reinoutdijkstra@hotmail.com (270) +// Translators: Admin (746), gijsbertush (610), pepijn (45), reinoutdijkstra@hotmail.com (270) $text = array( '2_factor_auth' => '2-factor-authenticatie', @@ -1125,7 +1125,7 @@ URL: [url]', 'select_one' => 'Selecteer een', 'select_user' => '', 'select_users' => 'Klik om gebruikers te selecteren', -'select_value' => '', +'select_value' => 'selecteer waarde', 'select_workflow' => 'Selecteer workflow', 'send_email' => 'Verstuur email', 'send_login_data' => 'Verstuur Login-data', diff --git a/languages/pt_BR/lang.inc b/languages/pt_BR/lang.inc index 1387a841a..2aeb42b51 100644 --- a/languages/pt_BR/lang.inc +++ b/languages/pt_BR/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (972), flaviove (627), lfcristofoli (352) +// Translators: Admin (973), flaviove (627), lfcristofoli (352) $text = array( '2_factor_auth' => '', @@ -1706,7 +1706,7 @@ URL: [url]', 'workflow_summary' => 'Sumário de fluxo de trabalho', 'workflow_transition_without_user_group' => '', 'workflow_user_summary' => 'Sumário de usuário', -'x_more_objects' => '', +'x_more_objects' => 'mais itens', 'year_view' => 'Visualização Anual', 'yes' => 'Sim', 'zh_CN' => 'Chinês (CN)', diff --git a/languages/tr_TR/lang.inc b/languages/tr_TR/lang.inc index 90f5428cf..9779e58a8 100644 --- a/languages/tr_TR/lang.inc +++ b/languages/tr_TR/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (1059), aydin (83) +// Translators: Admin (1064), aydin (83) $text = array( '2_factor_auth' => '', @@ -597,7 +597,7 @@ URL: [url]', 'index_error' => '', 'index_folder' => 'Klasörü indeksle', 'index_pending' => '', -'index_waiting' => '', +'index_waiting' => 'Bekliyor', 'individuals' => 'Bireysel', 'indivіduals_in_groups' => '', 'info_recipients_tab_not_released' => '', @@ -1090,7 +1090,7 @@ URL: [url]', 'select_one' => 'Birini seçiniz', 'select_user' => '', 'select_users' => 'Kullanıcı seçmek için tıklayın', -'select_value' => '', +'select_value' => 'Değeri seç', 'select_workflow' => 'İş akışı seç', 'send_email' => '', 'send_login_data' => '', @@ -1582,9 +1582,9 @@ URL: [url]', 'toggle_manager' => 'Değişim yönetimi', 'toggle_qrcode' => '', 'to_before_from' => 'Bitiş tarihi başlama tarihinden önce olamaz', -'transfer_document' => '', +'transfer_document' => 'Dokumanı gönder', 'transfer_no_read_access' => '', -'transfer_no_write_access' => '', +'transfer_no_write_access' => 'Kullanıcının klasör üzerinde yazma hakkı yok', 'transfer_objects' => '', 'transfer_objects_to_user' => '', 'transfer_to_user' => '', @@ -1710,7 +1710,7 @@ URL: [url]', 'workflow_summary' => 'İş akış özeti', 'workflow_transition_without_user_group' => '', 'workflow_user_summary' => 'Kullanıcı özeti', -'x_more_objects' => '', +'x_more_objects' => '[number] více objektů', 'year_view' => 'Yıllık Görünüm', 'yes' => 'Evet', 'zh_CN' => 'Çince', From b85030803b3a6a41cfffd8482ccf2e2107f078ae Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 9 Mar 2018 08:12:01 +0100 Subject: [PATCH 10/13] add entry for 5.1.6 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index f189e1120..6b2e222cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,8 @@ - attribute values can be deleted from all folders, documents - new settings to disallow upload of documents with just a reviewer in traditional workflow mode +- webdav and various script use the controller framework instead of calling + SeedDMS_Core methods -------------------------------------------------------------------------------- Changes in version 5.1.5 From afcea34cf887ed78813dfedb47d364a9a86902d8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 9 Mar 2018 10:23:21 +0100 Subject: [PATCH 11/13] add info about email configuration --- doc/README.Notification | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/README.Notification b/doc/README.Notification index c00664cee..d6fef8db3 100644 --- a/doc/README.Notification +++ b/doc/README.Notification @@ -3,7 +3,17 @@ Notifications Most changes made to documents or folders in SeedDMS can be monitored by the users. Notifications are send by email if a user or group -has subscribed it. +has subscribed to it. Setting up email is often troublesome, if you +are not running SeedDMS on a Linux server with a running mail server. +In that case you do not have to fill out any of the email settings +except for the From address ('Send from' on the 'System' tab of the +configuration). Mail is send by PHP's mail() function. If the SMTP +host in the configuration is filled out, SeedDMS will use the PEAR +Mail package for delivering mail to the configured server. If you +also fill out the SMTP user, authentication with the SMTP server +will also be done. Some servers like smtp.gmail.com may still complain +about an invalid authentification. You should then check in your +google account if less secure apps are allowed. The following notifications are send to all users and groups having registered a notification for the event: From 261c65033d6d7042a3d494f142cd1eb7c56d08b2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 9 Mar 2018 10:23:44 +0100 Subject: [PATCH 12/13] set socket_options, do not check ssl peer name and certificate --- inc/inc.ClassEmailNotify.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/inc.ClassEmailNotify.php b/inc/inc.ClassEmailNotify.php index e94ac0e53..ae5cfbb04 100644 --- a/inc/inc.ClassEmailNotify.php +++ b/inc/inc.ClassEmailNotify.php @@ -118,9 +118,13 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { } if($this->smtp_user) { $mail_params['auth'] = true; + // $mail_params['debug'] = true; $mail_params['username'] = $this->smtp_user; $mail_params['password'] = $this->smtp_password; } + /* See ticket #384 */ + $mail_params['socket_options'] = array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false)); + $mail = Mail::factory('smtp', $mail_params); } else { $mail = Mail::factory('mail', $mail_params); From e2944660210e6ba37f0b7b452932978afc54c215 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 9 Mar 2018 10:24:54 +0100 Subject: [PATCH 13/13] add entry for 5.1.6 --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 6b2e222cd..111701e52 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,7 +5,7 @@ - mayApprove() and mayReview() require the status of the document to be S_DRAFT_APP resp. S_DRAFT_REV - add preview for webm videos (Closes #374) -- add support for apache mod_xsendfile, minor optimization of file download +- add support for apache mod_xsendfile, minor optimization of file download (see #382) - animate button to download more objects in folder list when loading is active - use converters for creating preview images as configured in settings (Closes #389) - propperly check if user is already in database when doing ldap auth (Closes #388) @@ -18,6 +18,7 @@ workflow mode - webdav and various script use the controller framework instead of calling SeedDMS_Core methods +- do not verify peer name and certificate when connecting to smtp server -------------------------------------------------------------------------------- Changes in version 5.1.5