diff --git a/.htaccess b/.htaccess index 4c5031251..69e29975e 100644 --- a/.htaccess +++ b/.htaccess @@ -8,7 +8,7 @@ Header set X-Content-Type-Options: "nosniff" RewriteEngine On #RewriteRule "^favicon\.ico$" "-" [L] #RewriteRule "^(favicon\.ico)$" %{HTTP_HOST}/views/bootstrap/images/favicon.svg [L,NC] -RewriteRule "(favicon\.ico)" /views/bootstrap/images/favicon.svg [L,NC] +RewriteRule "^(favicon\.ico)" /views/bootstrap/images/favicon.svg [L,NC] # Store the current location in an environment variable CWD to use # mod_rewrite in .htaccess files without knowing the RewriteBase @@ -32,7 +32,7 @@ RewriteRule ^ext/[^/]+/icon.(?:png|svg)$ - [L] RewriteCond %{REQUEST_URI} "ext/[^/]+/" RewriteRule !^ext/[^/]+/.*(?:op|out|res|node_modules) - [F] RewriteCond %{REQUEST_URI} "ext/[^/]+/res/.*$" [NC] -RewriteRule !^ext/[^/]+/res/.*\.(?:css|js|png|gif|svg|html|woff) - [F] +RewriteRule !^ext/[^/]+/res/.*\.(?:css|js|png|gif|svg|ico|html|woff) - [F] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ext/.*$ - [L] diff --git a/CHANGELOG b/CHANGELOG index b358b2dfc..29b77e3ef 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,9 +7,16 @@ - do not use md5 password hashing anymore, hashes will be updated automatically when passwords are reset +-------------------------------------------------------------------------------- + Changes in version 6.0.22 +-------------------------------------------------------------------------------- +- merge changes up to 5.1.28 + -------------------------------------------------------------------------------- Changes in version 6.0.21 -------------------------------------------------------------------------------- +- merge changes up to 5.1.27 +- add new check for documents with identical sequence numbers in a folder -------------------------------------------------------------------------------- Changes in version 6.0.20 @@ -245,6 +252,19 @@ - add document list which can be exported as an archive - search results can be exported +-------------------------------------------------------------------------------- + Changes in version 5.1.29 +-------------------------------------------------------------------------------- +- fix php errors in restapi +- fix 'maximum size' error when uploading a file with drag&drop +- update jquery to 3.6.1 (only bootstrap4 theme) +- introduce authentication service +- new hook in restapi to add middleware +- previews for png, txt, pdf in different directories +- various improvements of fulltext service +- show number of documents per category in category manager +- show number of keywords per category in keyword manager + -------------------------------------------------------------------------------- Changes in version 5.1.28 -------------------------------------------------------------------------------- @@ -252,6 +272,21 @@ with 0 bytes was created by the user - fix repair of wrong file extension - fix regression in password forgotten function +- fix security issue when creating hash in password forgotten operation +- add initial support for logging and notifications in rest api +- add rest api calls to get attributes of a document version and to set + attributes of folders, documents, and document versions +- fixed various errors in swagger.yaml +- use methods in inc/inc.ClassNotificationService.php for webdav +- clear login failures when login by webdav succeeds +- output log of restapi in LogManagement +- new hook to add more tabs for sections in LogManagement +- rest api returns version attributes as 'version_attributes' (was + 'version-attributes'), each attribute also contains the name +- new hook in rest api to add more routes in extensions +- uploaded several documents at once by fast upload will assign random + sequence number to allow manually sorting the documents afterwards +- fix counting of login failures if both ldap and db authentication is done -------------------------------------------------------------------------------- Changes in version 5.1.27 diff --git a/Makefile b/Makefile index cc2deac8d..64114fe21 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,9 @@ repository: doc: $(PHPDOC) -d SeedDMS_Core --ignore 'getusers.php,getfoldertree.php,config.php,reverselookup.php' --force -t html +# Download apigen with +# composer create-project --no-dev apigen/apigen:^7.0@alpha tools/apigen apidoc: - apigen generate -s SeedDMS_Core --exclude tests -d html + tools/apigen/bin/apigen SeedDMS_Core/Core --exclude "tests/*" --output html .PHONY: doc webdav webapp repository diff --git a/SeedDMS_Core/Core/inc.ClassAttribute.php b/SeedDMS_Core/Core/inc.ClassAttribute.php index a9c8b3838..a8c5254ce 100644 --- a/SeedDMS_Core/Core/inc.ClassAttribute.php +++ b/SeedDMS_Core/Core/inc.ClassAttribute.php @@ -120,6 +120,27 @@ class SeedDMS_Core_Attribute { /* {{{ */ */ function getValue() { return $this->_value; } + /** + * Return attribute value parsed into a php type or object + * + * This function will return the value of multi value attributes + * including the separator char. + * + * @return string the attribute value as it is stored in the database. + */ + function getParsedValue() { /* {{{ */ + switch($this->_attrdef->getType()) { + case SeedDMS_Core_AttributeDefinition::type_float: + return (float) $this->_value; + case SeedDMS_Core_AttributeDefinition::type_boolean: + return (bool) $this->_value; + case SeedDMS_Core_AttributeDefinition::type_int: + return (int) $this->_value; + default: + return $this->_value; + } + } /* }}} */ + /** * Return attribute values as an array * @@ -247,7 +268,7 @@ class SeedDMS_Core_Attribute { /* {{{ */ break; case $this->_dms->getClassname('folder'): if(trim($value) === '') - $queryStr = "DELETE FROM `tblFolderAttributes WHERE` `folder` = " . $this->_obj->getID() . " AND `attrdef` = " . $this->_attrdef->getId(); + $queryStr = "DELETE FROM `tblFolderAttributes` WHERE `folder` = " . $this->_obj->getID() . " AND `attrdef` = " . $this->_attrdef->getId(); else $queryStr = "UPDATE `tblFolderAttributes` SET `value` = ".$db->qstr($value)." WHERE `folder` = " . $this->_obj->getID() . " AND `attrdef` = " . $this->_attrdef->getId(); break; @@ -1232,7 +1253,7 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */ * @param boolean $new set to true if the value is new value and not taken from * an existing attribute * (this will only be passed to the onAttributeValidate callback) - * @return boolean true if validation succeds, otherwise false + * @return boolean true if validation succeeds, otherwise false */ function validate($attrvalue, $object=null, $new=false) { /* {{{ */ /* Check if 'onAttributeValidate' callback is set */ diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index 127c850ef..bfa196e93 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -451,6 +451,7 @@ class SeedDMS_Core_DMS { $this->classnames['folder'] = 'SeedDMS_Core_Folder'; $this->classnames['document'] = 'SeedDMS_Core_Document'; $this->classnames['documentcontent'] = 'SeedDMS_Core_DocumentContent'; + $this->classnames['documentfile'] = 'SeedDMS_Core_DocumentFile'; $this->classnames['user'] = 'SeedDMS_Core_User'; $this->classnames['role'] = 'SeedDMS_Core_Role'; $this->classnames['apikey'] = 'SeedDMS_Core_ApiKey'; @@ -4131,6 +4132,41 @@ class SeedDMS_Core_DMS { } /* }}} */ + /** + * Returns folders which contain documents with none unique sequence number + * + * This method is for finding folders with documents not having a + * unique sequence number. Those documents cannot propperly be sorted + * by sequence and changing their position is impossible if more than + * two documents with the same sequence number exists, e.g. + * doc 1: 3 + * doc 2: 5 + * doc 3: 5 + * doc 4: 5 + * doc 5: 7 + * If document 4 was to be moved between doc 1 and 2 it get sequence + * number 4 ((5+3)/2). + * But if document 4 was to be moved between doc 2 and 3 it will again + * have sequence number 5. + * + * @return array|bool + */ + function getDuplicateSequenceNo() { /* {{{ */ + $queryStr = "SELECT DISTINCT `folder` FROM (SELECT `folder`, `sequence`, count(*) c FROM `tblDocuments` GROUP BY `folder`, `sequence` HAVING c > 1) a"; + $resArr = $this->db->getResultArray($queryStr); + if ($resArr === false) + return false; + + $folders = array(); + foreach($resArr as $row) { + $folder = $this->getFolder($row['folder']); + if($folder) + $folders[] = $folder; + } + return $folders; + + } /* }}} */ + /** * Returns a list of reviews, approvals, receipts, revisions which are not * linked to a user, group anymore diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index d5cde08ee..c0f3de3e0 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -124,7 +124,7 @@ define("S_LOG_SLEEPING", -3); /** * Class to represent a document in the document management system * - * A document in SeedDMS is similar to files in a regular file system. + * A document in SeedDMS is similar to a file in a regular file system. * Documents may have any number of content elements * ({@link SeedDMS_Core_DocumentContent}). These content elements are often * called versions ordered in a timely manner. The most recent content element @@ -139,7 +139,7 @@ define("S_LOG_SLEEPING", -3); * @author Markus Westphal, Malcolm Cowe, Matteo Lucarelli, * Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, - * 2010 Matteo Lucarelli, 2010 Uwe Steinmann + * 2010 Matteo Lucarelli, 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ @@ -1202,7 +1202,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ $db->rollbackTransaction(); return false; } - if(!SeedDMS_Core_File::removeFile($info['filename'])) { + if(file_exists($info['filename']) && !SeedDMS_Core_File::removeFile($info['filename'])) { $db->rollbackTransaction(); return false; } @@ -2325,7 +2325,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ } foreach($resArr as $res) { $file = $this->_dms->contentDir . $this->getDir().'r'.$res['reviewLogID']; - if(file_exists($file)) + if(SeedDMS_Core_File::file_exists($file)) SeedDMS_Core_File::removeFile($file); } } @@ -2354,7 +2354,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ } foreach($resArr as $res) { $file = $this->_dms->contentDir . $this->getDir().'a'.$res['approveLogID']; - if(file_exists($file)) + if(SeedDMS_Core_File::file_exists($file)) SeedDMS_Core_File::removeFile($file); } } @@ -2458,7 +2458,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ return false; } - if (file_exists( $this->_dms->contentDir.$version->getPath() )) + if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir.$version->getPath() )) if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir.$version->getPath() )) { $db->rollbackTransaction(); return false; @@ -2714,7 +2714,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ if ((is_bool($resArr) && !$resArr) || count($resArr)==0) return false; $resArr = $resArr[0]; - $file = new SeedDMS_Core_DocumentFile($resArr["id"], $this, $resArr["userID"], $resArr["comment"], $resArr["date"], $resArr["dir"], $resArr["fileType"], $resArr["mimeType"], $resArr["orgFileName"], $resArr["name"],$resArr["version"],$resArr["public"]); + $classname = $this->_dms->getClassname('documentfile'); + $file = new $classname($resArr["id"], $this, $resArr["userID"], $resArr["comment"], $resArr["date"], $resArr["dir"], $resArr["fileType"], $resArr["mimeType"], $resArr["orgFileName"], $resArr["name"],$resArr["version"],$resArr["public"]); $user = $this->_dms->getLoggedInUser(); if($file->getAccessMode($user) >= M_READ) return $file; @@ -2755,8 +2756,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ $this->_documentFiles = array($hash=>array()); $user = $this->_dms->getLoggedInUser(); + $classname = $this->_dms->getClassname('documentfile'); foreach ($resArr as $row) { - $file = new SeedDMS_Core_DocumentFile($row["id"], $this, $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"], $row["version"], $row["public"]); + $file = new $classname($row["id"], $this, $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"], $row["version"], $row["public"]); if($file->getAccessMode($user) >= M_READ) array_push($this->_documentFiles[$hash], $file); } @@ -2820,7 +2822,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ return false; } - if (file_exists( $this->_dms->contentDir . $file->getPath() )){ + if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir . $file->getPath() )){ if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir . $file->getPath() )) { $db->rollbackTransaction(); return false; @@ -2887,7 +2889,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ // TODO: versioning file? - if (file_exists( $this->_dms->contentDir . $this->getDir() )) + if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir . $this->getDir() )) if (!SeedDMS_Core_File::removeDir( $this->_dms->contentDir . $this->getDir() )) { $db->rollbackTransaction(); return false; @@ -3293,7 +3295,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ * Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ @@ -3729,6 +3731,9 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ function setMimeType($newMimetype) { /* {{{ */ $db = $this->_document->getDMS()->getDB(); + if(!$newMimetype) + return false; + $newMimetype = trim($newMimetype); if(!$newMimetype) @@ -4177,7 +4182,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ } foreach($res as &$t) { $filename = $this->_dms->contentDir . $this->_document->getDir().'r'.$t['reviewLogID']; - if(file_exists($filename)) + if(SeedDMS_Core_File::file_exists($filename)) $t['file'] = $filename; else $t['file'] = ''; @@ -4357,7 +4362,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ } foreach($res as &$t) { $filename = $this->_dms->contentDir . $this->_document->getDir().'a'.$t['approveLogID']; - if(file_exists($filename)) + if(SeedDMS_Core_File::file_exists($filename)) $t['file'] = $filename; else $t['file'] = ''; @@ -7043,7 +7048,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ $dms = $this->_document->getDMS(); $db = $this->_dms->getDB(); - if(file_exists($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType)) { + if(SeedDMS_Core_File::file_exists($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType)) { if(strlen($this->_fileType) < 2) { switch($this->_mimeType) { case "application/pdf": @@ -7068,7 +7073,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ break; } } - } elseif(file_exists($this->_document->getDir() . $this->_version . '.')) { + } elseif(SeedDMS_Core_File::file_exists($this->_document->getDir() . $this->_version . '.')) { echo "no file"; } else { echo $this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType; @@ -7094,7 +7099,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ * Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_DocumentLink { /* {{{ */ @@ -7226,7 +7231,7 @@ class SeedDMS_Core_DocumentLink { /* {{{ */ * Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_DocumentFile { /* {{{ */ @@ -7542,7 +7547,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */ * Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_AddContentResultSet { /* {{{ */ diff --git a/SeedDMS_Core/Core/inc.ClassFolder.php b/SeedDMS_Core/Core/inc.ClassFolder.php index 692f8dfb1..0e980668d 100644 --- a/SeedDMS_Core/Core/inc.ClassFolder.php +++ b/SeedDMS_Core/Core/inc.ClassFolder.php @@ -778,21 +778,25 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { /** * Returns a file system path * - * This path contains spaces around the slashes for better readability. - * Run str_replace(' / ', '/', $path) on it to get a valid unix + * This path contains by default spaces around the slashes for better readability. + * Run str_replace(' / ', '/', $path) on it or pass '/' as $sep to get a valid unix * file system path. * + * @param bool $skiproot skip the name of the root folder and start with $sep + * @param string $sep separator between path elements * @return string path separated with ' / ' */ - function getFolderPathPlain() { /* {{{ */ - $path=""; + function getFolderPathPlain($skiproot = false, $sep = ' / ') { /* {{{ */ + $path="".$sep; $folderPath = $this->getPath(); - for ($i = 0; $i < count($folderPath); $i++) { - $path .= $folderPath[$i]->getName(); - if ($i +1 < count($folderPath)) - $path .= " / "; + for ($i = 0; $i < count($folderPath); $i++) { + if($i > 0 || !$skiproot) { + $path .= $folderPath[$i]->getName(); + if ($i+1 < count($folderPath)) + $path .= $sep; + } } - return $path; + return trim($path); } /* }}} */ /** @@ -1062,7 +1066,11 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { } if($categories) { - $document->setCategories($categories); + if(!$document->setCategories($categories)) { + $document->remove(); + $db->rollbackTransaction(); + return false; + } } if($attributes) { @@ -2195,6 +2203,40 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { return $resArr[0]; } /* }}} */ + /** + * Reorder documents of folder + * + * Fix the sequence numbers of all documents in the folder, by assigning new + * numbers starting from 1 incrementing by 1. This can be necessary if sequence + * numbers are not unique which makes manual reordering for documents with + * identical sequence numbers impossible. + * + * @return bool false in case of an error, otherwise true + */ + function reorderDocuments() { /* {{{ */ + $db = $this->_dms->getDB(); + + $queryStr = "SELECT `id` FROM `tblDocuments` WHERE `folder` = " . (int) $this->_id . " ORDER BY `sequence`"; + $resArr = $db->getResultArray($queryStr); + if (is_bool($resArr) && $resArr == false) + return false; + + $db->startTransaction(); + $no = 1.0; + foreach($resArr as $doc) { + $queryStr = "UPDATE `tblDocuments` SET `sequence` = " . $no . " WHERE `id` = ". $doc['id']; + if (!$db->getResult($queryStr)) { + $db->rollbackTransaction(); + return false; + } + $no += 1.0; + } + $db->commitTransaction(); + + return true; + } /* }}} */ + + } ?> diff --git a/SeedDMS_Core/Core/inc.ClassIterator.php b/SeedDMS_Core/Core/inc.ClassIterator.php index ca6bdccbe..ffb8133dc 100644 --- a/SeedDMS_Core/Core/inc.ClassIterator.php +++ b/SeedDMS_Core/Core/inc.ClassIterator.php @@ -1,5 +1,5 @@ * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, - * 2010 Uwe Steinmann + * 2010-2023 Uwe Steinmann * @version Release: @package_version@ */ @@ -19,7 +19,7 @@ * @package SeedDMS_Core * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, - * 2010 Uwe Steinmann + * 2010-2023 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_KeywordCategory { @@ -47,53 +47,53 @@ class SeedDMS_Core_KeywordCategory { */ protected $_dms; - /** - * SeedDMS_Core_KeywordCategory constructor. - * @param $id - * @param $ownerID - * @param $name - */ - function __construct($id, $ownerID, $name) { + /** + * SeedDMS_Core_KeywordCategory constructor. + * @param $id + * @param $ownerID + * @param $name + */ + function __construct($id, $ownerID, $name) { /* {{{ */ $this->_id = $id; $this->_name = $name; $this->_ownerID = $ownerID; $this->_dms = null; - } + } /* }}} */ - /** - * @param SeedDMS_Core_DMS $dms - */ - function setDMS($dms) { + /** + * @param SeedDMS_Core_DMS $dms + */ + function setDMS($dms) { /* {{{ */ $this->_dms = $dms; - } + } /* }}} */ - /** - * @return int - */ + /** + * @return int + */ function getID() { return $this->_id; } - /** - * @return string - */ + /** + * @return string + */ function getName() { return $this->_name; } - /** - * @return bool|SeedDMS_Core_User - */ - function getOwner() { + /** + * @return bool|SeedDMS_Core_User + */ + function getOwner() { /* {{{ */ if (!isset($this->_owner)) $this->_owner = $this->_dms->getUser($this->_ownerID); return $this->_owner; - } + } /* }}} */ - /** - * @param $newName - * @return bool - */ - function setName($newName) { - $newName = trim($newName); - if(!$newName) - return false; + /** + * @param $newName + * @return bool + */ + function setName($newName) { /* {{{ */ + $newName = trim($newName); + if(!$newName) + return false; $db = $this->_dms->getDB(); @@ -103,75 +103,89 @@ class SeedDMS_Core_KeywordCategory { $this->_name = $newName; return true; - } + } /* }}} */ - /** - * @param SeedDMS_Core_User $user - * @return bool - */ - function setOwner($user) { - if(!$user || !$user->isType('user')) - return false; + /** + * @param SeedDMS_Core_User $user + * @return bool + */ + function setOwner($user) { /* {{{ */ + if(!$user || !$user->isType('user')) + return false; $db = $this->_dms->getDB(); - $queryStr = "UPDATE `tblKeywordCategories` SET `owner` = " . $user->getID() . " WHERE `id` = " . $this->_id; + $queryStr = "UPDATE `tblKeywordCategories` SET `owner` = " . $user->getID() . " WHERE `id` = " . $this->_id; if (!$db->getResult($queryStr)) return false; $this->_ownerID = $user->getID(); $this->_owner = $user; return true; - } + } /* }}} */ - /** - * @return array - */ - function getKeywordLists() { + /** + * @return array keywords in this list + */ + function getKeywordLists() { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "SELECT * FROM `tblKeywords` WHERE `category` = " . $this->_id . " order by `keywords`"; return $db->getResultArray($queryStr); } - /** - * @param $listID - * @param $keywords - * @return bool - */ - function editKeywordList($listID, $keywords) { + /** + * @return integer number of keywords in this list + */ + function countKeywordLists() { /* {{{ */ + $db = $this->_dms->getDB(); + + $queryStr = "SELECT COUNT(*) as `c` FROM `tblKeywords` where `category`=".$this->_id; + $resArr = $db->getResultArray($queryStr); + if (is_bool($resArr) && !$resArr) + return false; + + return $resArr[0]['c']; + } /* }}} */ + + /** + * @param $listID + * @param $keywords + * @return bool + */ + function editKeywordList($listID, $keywords) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "UPDATE `tblKeywords` SET `keywords` = ".$db->qstr($keywords)." WHERE `id` = $listID"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @param $keywords - * @return bool - */ - function addKeywordList($keywords) { + /** + * @param $keywords + * @return bool + */ + function addKeywordList($keywords) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "INSERT INTO `tblKeywords` (`category`, `keywords`) VALUES (" . $this->_id . ", ".$db->qstr($keywords).")"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @param $listID - * @return bool - */ - function removeKeywordList($listID) { + /** + * @param $listID + * @return bool + */ + function removeKeywordList($listID) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "DELETE FROM `tblKeywords` WHERE `id` = $listID"; return $db->getResult($queryStr); - } + } /* }}} */ - /** - * @return bool - */ - function remove() { + /** + * @return bool + */ + function remove() { /* {{{ */ $db = $this->_dms->getDB(); $db->startTransaction(); @@ -189,5 +203,5 @@ class SeedDMS_Core_KeywordCategory { $db->commitTransaction(); return true; - } + } /* }}} */ } diff --git a/SeedDMS_Core/Core/inc.ClassObject.php b/SeedDMS_Core/Core/inc.ClassObject.php index 48737f6b7..a9e432b5a 100644 --- a/SeedDMS_Core/Core/inc.ClassObject.php +++ b/SeedDMS_Core/Core/inc.ClassObject.php @@ -38,10 +38,10 @@ class SeedDMS_Core_Object { /* {{{ */ */ public $_dms; - /** - * SeedDMS_Core_Object constructor. - * @param $id - */ + /** + * SeedDMS_Core_Object constructor. + * @param $id + */ function __construct($id) { /* {{{ */ $this->_id = $id; $this->_dms = null; @@ -155,7 +155,7 @@ class SeedDMS_Core_Object { /* {{{ */ } if (isset($this->_attributes[$attrdef->getId()])) { - $value = $this->_attributes[$attrdef->getId()]->getValue(); + $value = $this->_attributes[$attrdef->getId()]->getValue(); if($attrdef->getMultipleValues()) { $sep = substr($value, 0, 1); $vsep = $attrdef->getValueSetSeparator(); @@ -169,7 +169,7 @@ class SeedDMS_Core_Object { /* {{{ */ else return(array($value)); } else { - return $value; + return $this->_attributes[$attrdef->getId()]->getParsedValue(); } } else return false; diff --git a/SeedDMS_Core/Core/inc.DBAccessPDO.php b/SeedDMS_Core/Core/inc.DBAccessPDO.php index c3ff34c4d..105c859fc 100644 --- a/SeedDMS_Core/Core/inc.DBAccessPDO.php +++ b/SeedDMS_Core/Core/inc.DBAccessPDO.php @@ -313,6 +313,7 @@ class SeedDMS_Core_DatabaseAccess { switch($this->_driver) { case 'mysql': $this->_conn->exec('SET NAMES utf8'); +// $this->_conn->setAttribute(PDO::ATTR_AUTOCOMMIT, FALSE); /* Turn this on if you want strict checking of default values, etc. */ /* $this->_conn->exec("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'"); */ /* The following is the default on Ubuntu 16.04 */ @@ -459,9 +460,15 @@ class SeedDMS_Core_DatabaseAccess { $this->_conn->beginTransaction(); } $this->_intransaction++; + if($this->_logfp) { + fwrite($this->_logfp, microtime()." START ".$htis->_intransaction."\n"); + } } /* }}} */ function rollbackTransaction() { /* {{{ */ + if($this->_logfp) { + fwrite($this->_logfp, microtime()." ROLLBACK ".$htis->_intransaction."\n"); + } if($this->_intransaction == 1) { $this->_conn->rollBack(); } @@ -469,6 +476,9 @@ class SeedDMS_Core_DatabaseAccess { } /* }}} */ function commitTransaction() { /* {{{ */ + if($this->_logfp) { + fwrite($this->_logfp, microtime()." COMMIT ".$htis->_intransaction."\n"); + } if($this->_intransaction == 1) { $this->_conn->commit(); } diff --git a/SeedDMS_Core/Core/inc.FileUtils.php b/SeedDMS_Core/Core/inc.FileUtils.php index 04dc79ae2..43289fce8 100644 --- a/SeedDMS_Core/Core/inc.FileUtils.php +++ b/SeedDMS_Core/Core/inc.FileUtils.php @@ -9,19 +9,21 @@ * @author Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ /** - * Class to represent a user in the document management system + * Class to file operation in the document management system + * Use the methods of this class only for files below the content + * directory but not for temporäry files, cache files or log files. * * @category DMS * @package SeedDMS_Core * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010 Uwe Steinmann + * 2010-2022 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_Core_File { @@ -78,8 +80,37 @@ class SeedDMS_Core_File { } /* }}} */ /** - * @param $size - * @param array $sizes + * Return the mimetype of a given file + * + * This method uses finfo to determine the mimetype + * but will correct some mimetypes which are + * not propperly determined or could be more specific, e.g. text/plain + * when it is actually text/markdown. In thoses cases + * the file extension will be taken into account. + * + * @param string $filename name of file on disc + * @return string mimetype + */ + static function mimetype($filename) { /* {{{ */ + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mimetype = finfo_file($finfo, $filename); + + switch($mimetype) { + case 'application/octet-stream': + case 'text/plain': + $lastDotIndex = strrpos($filename, "."); + if($lastDotIndex === false) $fileType = "."; + else $fileType = substr($filename, $lastDotIndex); + if($fileType == '.md') + $mimetype = 'text/markdown'; + break; + } + return $mimetype; + } /* }}} */ + + /** + * @param integer $size + * @param array $sizes list of units for 10^0, 10^3, 10^6, ..., 10^(n*3) bytes * @return string */ static function format_filesize($size, $sizes = array('Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB')) { /* {{{ */ @@ -90,18 +121,22 @@ class SeedDMS_Core_File { } /* }}} */ /** + * Parses a string like '[0-9]+ *[BKMGT]*' into an integer + * B,K,M,G,T stand for byte, kilo byte, mega byte, giga byte, tera byte + * If the last character is omitted, bytes are assumed. + * * @param $str * @return bool|int */ static function parse_filesize($str) { /* {{{ */ - preg_replace('/\s\s+/', '', $str); - if(in_array(strtoupper(substr($str, -1)), array('B','K','M','G'))) { - $value = (int) substr($str, 0, -1); - $unit = substr($str, -1, 1); - } else { - return (int) $str; - } - switch(strtoupper($unit)) { + if(!preg_match('/^([0-9]+) *([BKMGT]*)$/', trim($str), $matches)) + return false; + $value = $matches[1]; + $unit = $matches[2] ? $matches[2] : 'B'; + switch($unit) { + case 'T': + return $value * 1024 * 1024 * 1024 *1024; + break; case 'G': return $value * 1024 * 1024 * 1024; break; @@ -112,13 +147,21 @@ class SeedDMS_Core_File { return $value * 1024; break; default; - return $value; + return (int) $value; break; } /** @noinspection PhpUnreachableStatementInspection */ return false; } /* }}} */ + /** + * @param $file + * @return string + */ + static function file_exists($file) { /* {{{ */ + return file_exists($file); + } /* }}} */ + /** * @param $file * @return string @@ -129,7 +172,7 @@ class SeedDMS_Core_File { /** * @param $string mimetype - * @return string + * @return string file extension with the dot or an empty string */ static function fileExtension($mimetype) { /* {{{ */ switch($mimetype) { @@ -224,6 +267,7 @@ class SeedDMS_Core_File { 'text/x-log' => 'log', 'audio/x-m4a' => 'm4a', 'application/vnd.mpegurl' => 'm4u', + 'text/markdown' => 'md', 'audio/midi' => 'mid', 'application/vnd.mif' => 'mif', 'video/quicktime' => 'mov', @@ -405,7 +449,7 @@ class SeedDMS_Core_File { continue; else if (is_dir($path . DIRECTORY_SEPARATOR . $entry)) { - if (!self::removeDir($path . DIRECTORY_SEPARATOR . $entry . "/")) + if (!self::removeDir($path . DIRECTORY_SEPARATOR . $entry )) return false; } else @@ -452,10 +496,10 @@ class SeedDMS_Core_File { */ static function moveDir($sourcePath, $targetPath) { /* {{{ */ /** @noinspection PhpUndefinedFunctionInspection */ - if (!copyDir($sourcePath, $targetPath)) + if (!self::copyDir($sourcePath, $targetPath)) return false; /** @noinspection PhpUndefinedFunctionInspection */ - return removeDir($sourcePath); + return self::removeDir($sourcePath); } /* }}} */ // code by Kioob (php.net manual) diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 3e72d7bce..3cb0e97d0 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -12,7 +12,7 @@ uwe@steinmann.cx yes - 2022-10-10 + 2022-12-10 6.1.0 @@ -2012,6 +2012,49 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp() - pass an array as an attribute to search() will OR each element + + 2022-11-07 + + + 5.1.28 + 5.1.28 + + + stable + stable + + GPL License + +- fix SeedDMS_Core_User::getDocumentContents() +- fix SeedDMS_Core_File::fileExtension() +- SeedDMS_Core_DMS::createPasswordRequest() creates a cryptographically secure hash +- fix sql error when deleting a folder attribute +- add SeedDMS_Core_Attribute::getParsedValue() and use it in SeedDMS_Core_Object::getAttributeValue() +- add SeedDMS_Core_DMS::getDuplicateSequenceNo() and SeedDMS_Core_Folder::reorderDocuments() +- add SeedDMS_Core_File::mimetype(), fix SeedDMS_Core_File::moveDir() +- all file operations use methods of SeedDMS_Core_File +- change namespace of iterators from SeedDMS to SeedDMS\Core + + + + 2022-11-21 + + + 5.1.29 + 5.1.29 + + + stable + stable + + GPL License + +- SeedDMS_Core_Folder::addDocument() does rollback transaction propperly when setting document categories fail +- add $skiproot and $sep parameter to SeedDMS_Core_Folder::getFolderPathPlain() +- add class name for 'documentfile' +- add method SeedDMS_Core_KeywordCategory::countKeywordLists() + + 2017-02-28 @@ -2429,7 +2472,7 @@ better error checking in SeedDMS_Core_Document::cancelCheckOut() - 2022-09-18 + 2022-11-18 6.0.21 @@ -2446,5 +2489,21 @@ better error checking in SeedDMS_Core_Document::cancelCheckOut() - SeedDMS_Core_DMS::createPasswordRequest() creates a cryptographically secure hash + + 2023-l1-16 + + + 6.0.22 + 6.0.22 + + + stable + stable + + GPL License + +- all changes from 5.1.29 merged + + diff --git a/SeedDMS_Lucene/Lucene/IndexedDocument.php b/SeedDMS_Lucene/Lucene/IndexedDocument.php index 0ac27a583..c8e76b26c 100644 --- a/SeedDMS_Lucene/Lucene/IndexedDocument.php +++ b/SeedDMS_Lucene/Lucene/IndexedDocument.php @@ -145,12 +145,14 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { if($document->isType('document')) { $this->addField(Zend_Search_Lucene_Field::Keyword('document_id', 'D'.$document->getID())); + $this->addField(Zend_Search_Lucene_Field::Keyword('record_type', 'document')); $version = $document->getLatestContent(); if($version) { $this->addField(Zend_Search_Lucene_Field::Keyword('mimetype', $version->getMimeType())); $this->addField(Zend_Search_Lucene_Field::Keyword('origfilename', $version->getOriginalFileName(), 'utf-8')); + $this->addField(Zend_Search_Lucene_Field::UnIndexed('created', $version->getDate())); if(!$nocontent) - $this->addField(Zend_Search_Lucene_Field::UnIndexed('created', $version->getDate())); + $this->addField(Zend_Search_Lucene_Field::UnIndexed('indexed', time())); if($attributes = $version->getAttributes()) { foreach($attributes as $attribute) { $attrdef = $attribute->getAttributeDefinition(); @@ -181,7 +183,15 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { if(file_exists($path)) { $mimetype = $version->getMimeType(); $this->mimetype = $mimetype; - if(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) { + if(is_callable($convcmd)) { + $result = $convcmd($document); + if($result['content']) { + self::setContent($result['content']); + } elseif($result['content'] === false) { + $this->errormsg = $result['errormsg']; + } + $this->cmd = $result['cmd']; + } elseif(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) { if($service = $convcmd->getService($mimetype, 'text/plain')) { $content = $convcmd->convert($path, $mimetype, 'text/plain'); if($content) { @@ -223,7 +233,9 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document { } } elseif($document->isType('folder')) { $this->addField(Zend_Search_Lucene_Field::Keyword('document_id', 'F'.$document->getID())); + $this->addField(Zend_Search_Lucene_Field::Keyword('record_type', 'folder')); $this->addField(Zend_Search_Lucene_Field::UnIndexed('created', $document->getDate())); + $this->addField(Zend_Search_Lucene_Field::UnIndexed('indexed', time())); } } /* }}} */ diff --git a/SeedDMS_Lucene/Lucene/Indexer.php b/SeedDMS_Lucene/Lucene/Indexer.php index 7c3b3f68a..f0dee91ce 100644 --- a/SeedDMS_Lucene/Lucene/Indexer.php +++ b/SeedDMS_Lucene/Lucene/Indexer.php @@ -29,10 +29,23 @@ class SeedDMS_Lucene_Indexer { */ protected $indexname; + /** + * @var string $index lucene index + * @access protected + */ + protected $index; + + public function __construct($index) { + $this->index = $index; + } + static function open($conf) { /* {{{ */ try { $index = Zend_Search_Lucene::open($conf['indexdir']); - return($index); + if($index) + return new self($index); + else + return null; } catch (Exception $e) { return null; } @@ -41,7 +54,10 @@ class SeedDMS_Lucene_Indexer { static function create($conf) { /* {{{ */ try { $index = Zend_Search_Lucene::create($conf['indexdir']); - return($index); + if($index) + return new self($index); + else + return null; } catch (Exception $e) { return null; } @@ -51,7 +67,7 @@ class SeedDMS_Lucene_Indexer { * Do some initialization * */ - static function init($stopWordsFile='') { /* {{{ */ + public function init($stopWordsFile='') { /* {{{ */ $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive(); if($stopWordsFile && file_exists($stopWordsFile)) { $stopWordsFilter = new Zend_Search_Lucene_Analysis_TokenFilter_StopWords(); @@ -62,6 +78,131 @@ class SeedDMS_Lucene_Indexer { Zend_Search_Lucene_Analysis_Analyzer::setDefault($analyzer); } /* }}} */ + /** + * Add document to index + * + * @param object $doc indexed document of class + * SeedDMS_Lucene_IndexedDocument + * @return boolean false in case of an error, otherwise true + */ + function addDocument($doc) { /* {{{ */ + if(!$this->index) + return false; + return $this->index->addDocument($doc); + } /* }}} */ + + /** + * Remove document from index + * + * @param object $id internal id of document + * @return boolean false in case of an error, otherwise true + */ + public function delete($id) { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->delete($id); + } /* }}} */ + + /** + * Check if document was deleted + * + * @param object $id internal id of document + * @return boolean true if document was deleted + */ + public function isDeleted($id) { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->isDeleted($id); + } /* }}} */ + + /** + * Search in index + * + * @param string $query + * @return array result + */ + public function find($query) { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->find($query); + } /* }}} */ + + /** + * Get a single document from index + * + * @param string $id id of document + * @return boolean false in case of an error, otherwise true + */ + public function findById($id) { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->findById($id); + } /* }}} */ + + /** + * Get a single document from index + * + * @param integer $id id of index record + * @return boolean false in case of an error, otherwise true + */ + public function getDocument($id, $content=true) { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->getDocument($id); + } /* }}} */ + + /** + * Return list of terms in index + * + * @return array list of Zend_Lucene_Term + */ + public function terms($prefix='', $col='') { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->terms(); + } /* }}} */ + + /** + * Return number of documents in index + * + * @return interger number of documents + */ + public function count() { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->count(); + } /* }}} */ + + /** + * Commit changes + * + * This function does nothing! + */ + function commit() { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->commit(); + } /* }}} */ + + /** + * Optimize index + * + * This function does nothing! + */ + function optimize() { /* {{{ */ + if(!$this->index) + return false; + + return $this->index->optimize(); + } /* }}} */ } ?> diff --git a/SeedDMS_Lucene/Lucene/Search.php b/SeedDMS_Lucene/Lucene/Search.php index 5ca533d93..38827a02b 100644 --- a/SeedDMS_Lucene/Lucene/Search.php +++ b/SeedDMS_Lucene/Lucene/Search.php @@ -77,10 +77,10 @@ class SeedDMS_Lucene_Search { $querystr = substr($term, -1) != '*' ? $term.'*' : $term; } if(!empty($fields['owner'])) { - if(is_string($owner)) { + if(is_string($fields['owner'])) { if($querystr) $querystr .= ' && '; - $querystr .= 'owner:'.$owner; + $querystr .= 'owner:'.$fields['owner']; } elseif(is_array($fields['owner'])) { if($querystr) $querystr .= ' && '; @@ -89,6 +89,13 @@ class SeedDMS_Lucene_Search { $querystr .= '")'; } } + if(!empty($fields['record_type'])) { + if($querystr) + $querystr .= ' && '; + $querystr .= '(record_type:'; + $querystr .= implode(' || record_type:', $fields['record_type']); + $querystr .= ')'; + } if(!empty($fields['category'])) { if($querystr) $querystr .= ' && '; @@ -137,7 +144,7 @@ class SeedDMS_Lucene_Search { $recs = array(); $c = 0; foreach($hits as $hit) { - if($c >= $limit['offset'] && ($c-$limit['offset'] < $limit)) + if($c >= $limit['offset'] && ($c-$limit['offset'] < $limit['limit'])) $recs[] = array('id'=>$hit->id, 'document_id'=>$hit->document_id); $c++; } diff --git a/SeedDMS_Lucene/package.xml b/SeedDMS_Lucene/package.xml index 01192ead0..3ccc53ec9 100644 --- a/SeedDMS_Lucene/package.xml +++ b/SeedDMS_Lucene/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2021-05-10 + 2023-01-09 - 1.1.17 - 1.1.17 + 1.1.18 + 1.1.18 stable @@ -23,7 +23,8 @@ GPL License -- close pipes in execWithTimeout(), also return exit code of command +- IndexedDocument() accepts a callable for conversion to text +- SeedDMS_Lucene_Search::open and create return itself but Zend_Search_Lucene @@ -368,5 +369,21 @@ Index users with at least read access on the document - add indexing of folders + + 2021-05-10 + + + 1.1.17 + 1.1.17 + + + stable + stable + + GPL License + +- close pipes in execWithTimeout(), also return exit code of command + + diff --git a/SeedDMS_Preview/Preview.php b/SeedDMS_Preview/Preview.php index d19d82943..ce5853001 100644 --- a/SeedDMS_Preview/Preview.php +++ b/SeedDMS_Preview/Preview.php @@ -31,4 +31,9 @@ require_once('Preview/Previewer.php'); */ require_once('Preview/PdfPreviewer.php'); +/** + * @uses Preview/PdfPreviewer.php + */ +require_once('Preview/TxtPreviewer.php'); + ?> diff --git a/SeedDMS_Preview/Preview/Base.php b/SeedDMS_Preview/Preview/Base.php index ff1cfb2bd..9fb401ada 100644 --- a/SeedDMS_Preview/Preview/Base.php +++ b/SeedDMS_Preview/Preview/Base.php @@ -136,6 +136,15 @@ class SeedDMS_Preview_Base { } } /* }}} */ + /** + * Get preview dir + * + * @return string name of preview directory on disc + */ + public function getPreviewDir() { /* {{{ */ + return $this->previewDir; + } /* }}} */ + /** * Set a list of converters * diff --git a/SeedDMS_Preview/Preview/PdfPreviewer.php b/SeedDMS_Preview/Preview/PdfPreviewer.php index 53086867c..2a219b476 100644 --- a/SeedDMS_Preview/Preview/PdfPreviewer.php +++ b/SeedDMS_Preview/Preview/PdfPreviewer.php @@ -25,41 +25,30 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { function __construct($previewDir, $timeout=5, $xsendfile=true) { /* {{{ */ - parent::__construct($previewDir, $timeout, $xsendfile); + parent::__construct($previewDir.DIRECTORY_SEPARATOR.'pdf', $timeout, $xsendfile); $this->converters = array( - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'text/rtf' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/msword' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.ms-excel' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", - 'application/postscript' => "ps2pdf '%f' - > '%o'", - 'image/jpeg' => "convert '%f' pdf:- > '%o'", - 'image/png' => "convert '%f' pdf:- > '%o'", - 'image/gif' => "convert '%f' pdf:- > '%o'", - 'video/mp4' => "convert '%f[1-20]' pdf:- > '%o'", ); } /* }}} */ /** - * Return the physical filename of the preview image on disk + * Return the physical filename of the preview image on disc + * including the path * * @param object $object document content or document file * @return string file name of preview image */ - protected function getFileName($object) { /* {{{ */ + public function getFileName($object) { /* {{{ */ if(!$object) return false; $document = $object->getDocument(); $dms = $document->_dms; - $dir = $this->previewDir.'/'.$document->getDir(); + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); switch(get_class($object)) { case $dms->getClassname('documentcontent'): $target = $dir.'p'.$object->getVersion(); break; - case "SeedDMS_Core_DocumentFile": + case $dms->getClassname('documentfile'): $target = $dir.'f'.$object->getID(); break; default: @@ -101,8 +90,8 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { if(!$this->previewDir) return false; - if(!is_dir($this->previewDir.'/'.$dir)) { - if (!SeedDMS_Core_File::makeDir($this->previewDir.'/'.$dir)) { + if(!is_dir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { + if (!SeedDMS_Core_File::makeDir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { return false; } } @@ -128,9 +117,11 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { } elseif(isset($this->converters['*'])) { $cmd = str_replace(array('%f', '%o', '%m'), array($infile, $target.'.pdf', $mimetype), $this->converters['*']); } + if($cmd) { try { self::execWithTimeout($cmd, $this->timeout); + $new = true; } catch(Exception $e) { $this->lastpreviewfile = ''; return false; @@ -139,6 +130,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { } return true; } + $new = false; return true; } /* }}} */ @@ -305,7 +297,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { if(!$this->previewDir) return false; - $dir = $this->previewDir.'/'.$document->getDir(); + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); if(file_exists($dir) && is_dir($dir)) { return SeedDMS_Preview_Previewer::recurseRmdir($dir); } else { diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index 327f5e099..f53780e7a 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -29,41 +29,48 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { */ protected $width; + /** + * Create instance of image previewer + * + * @param string $previewDir path of base directory where all images are + * stored. This directory will have a subdirectory derived from the object id. + * @param integer $width default width of an image + * @param integer $timeout timeout for shell commands to create a preview image + * @param boolean $xsendfile if set to true the apache module xsendfile will + * be used. + */ function __construct($previewDir, $width=40, $timeout=5, $xsendfile=true) { /* {{{ */ - parent::__construct($previewDir, $timeout, $xsendfile); + parent::__construct($previewDir.DIRECTORY_SEPARATOR.'png', $timeout, $xsendfile); $this->converters = array( - 'image/png' => "convert -resize %wx '%f' '%o'", - 'image/gif' => "convert -resize %wx '%f' '%o'", - 'image/jpg' => "convert -resize %wx '%f' '%o'", - 'image/jpeg' => "convert -resize %wx '%f' '%o'", - 'image/svg+xml' => "convert -resize %wx '%f' '%o'", - 'text/plain' => "convert -resize %wx '%f' '%o'", - 'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'", - 'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'", - 'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o'", ); $this->width = intval($width); } /* }}} */ /** - * Return the physical filename of the preview image on disk + * Return the physical filename of the preview image on disc + * including the path * * @param object $object document content or document file * @param integer $width width of preview image * @return string file name of preview image */ - public function getFileName($object, $width) { /* {{{ */ + public function getFileName($object, $width=0) { /* {{{ */ if(!$object) return false; + if($width == 0) + $width = $this->width; + else + $width = intval($width); + $document = $object->getDocument(); $dms = $document->_dms; - $dir = $this->previewDir.'/'.$document->getDir(); + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); switch(get_class($object)) { case $dms->getClassname('documentcontent'): $target = $dir.'p'.$object->getVersion().'-'.$width; break; - case "SeedDMS_Core_DocumentFile": + case $dms->getClassname('documentfile'): $target = $dir.'f'.$object->getID().'-'.$width; break; default: @@ -98,6 +105,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { * @param string $mimetype MimeType of input file * @param integer $width width of generated preview image * @param string $target optional name of preview image (without extension) + * @param boolean $new will be set to true if the preview images was created * @return boolean true on success, false on failure */ public function createRawPreview($infile, $dir, $mimetype, $width=0, $target='', &$new=false) { /* {{{ */ @@ -110,8 +118,8 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { $width = intval($width); if(!$this->previewDir) return false; - if(!is_dir($this->previewDir.'/'.$dir)) { - if (!SeedDMS_Core_File::makeDir($this->previewDir.'/'.$dir)) { + if(!is_dir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { + if (!SeedDMS_Core_File::makeDir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { return false; } } @@ -166,6 +174,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { * @param object $object instance of SeedDMS_Core_DocumentContent * or SeedDMS_Core_DocumentFile * @param integer $width desired width of preview image + * @param boolean $new will be set to true if the preview images was created * @return boolean true on success, false on failure */ public function createPreview($object, $width=0, &$new=false) { /* {{{ */ @@ -350,7 +359,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { if(!$this->previewDir) return false; - $dir = $this->previewDir.'/'.$document->getDir(); + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); if(file_exists($dir) && is_dir($dir)) { return SeedDMS_Preview_Previewer::recurseRmdir($dir); } else { diff --git a/SeedDMS_Preview/Preview/TxtPreviewer.php b/SeedDMS_Preview/Preview/TxtPreviewer.php new file mode 100644 index 000000000..7826ff793 --- /dev/null +++ b/SeedDMS_Preview/Preview/TxtPreviewer.php @@ -0,0 +1,306 @@ + + * @copyright Copyright (C) 2010, Uwe Steinmann + * @version Release: @package_version@ + */ + + +/** + * Class for managing creation of text preview for documents. + * + * @category DMS + * @package SeedDMS_Preview + * @version @version@ + * @author Uwe Steinmann + * @copyright Copyright (C) 2011, Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_Preview_TxtPreviewer extends SeedDMS_Preview_Base { + + function __construct($previewDir, $timeout=5, $xsendfile=true) { /* {{{ */ + parent::__construct($previewDir.DIRECTORY_SEPARATOR.'txt', $timeout, $xsendfile); + $this->converters = array( + ); + } /* }}} */ + + /** + * Return the physical filename of the preview image on disc + * including the path + * + * @param object $object document content or document file + * @return string file name of preview image + */ + public function getFileName($object) { /* {{{ */ + if(!$object) + return false; + + $document = $object->getDocument(); + $dms = $document->_dms; + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); + switch(get_class($object)) { + case $dms->getClassname('documentcontent'): + $target = $dir.'t'.$object->getVersion(); + break; + default: + return false; + } + return $target; + } /* }}} */ + + /** + * Check if converter for a given mimetype is set + * + * @param string $mimetype from mimetype + * + * @return boolean true if converter exists, otherwise false + */ + function hasConverter($from, $to='') { /* {{{ */ + return parent::hasConverter($from, 'text/plain'); + } /* }}} */ + + /** + * Create a text preview for a given file + * + * This method creates a preview in text format for a regular file + * in the file system and stores the result in the directory $dir relative + * to the configured preview directory. The filename of the resulting preview + * image is either $target.text (if set) or md5($infile).text. + * The $mimetype is used to select the propper conversion programm. + * An already existing text preview is replaced. + * + * @param string $infile name of input file including full path + * @param string $dir directory relative to $this->previewDir + * @param string $mimetype MimeType of input file + * @param string $target optional name of preview image (without extension) + * @return boolean true on success, false on failure + */ + public function createRawPreview($infile, $dir, $mimetype, $target='') { /* {{{ */ + if(!self::hasConverter($mimetype)) + return true; + + if(!$this->previewDir) + return false; + if(!is_dir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { + if (!SeedDMS_Core_File::makeDir($this->previewDir.DIRECTORY_SEPARATOR.$dir)) { + return false; + } + } + if(!file_exists($infile)) + return false; + if(!$target) + $target = $this->previewDir.$dir.md5($infile); + $this->lastpreviewfile = $target.'.txt'; + if($target != '' && (!file_exists($target.'.txt') || filectime($target.'.txt') < filectime($infile))) { + if($this->conversionmgr) { + if(!$this->conversionmgr->convert($infile, $mimetype, 'text/plain', $target.'.txt')) { + $this->lastpreviewfile = ''; + return false; + } + $new = true; + } else { + $cmd = ''; + $mimeparts = explode('/', $mimetype, 2); + if(isset($this->converters[$mimetype])) { + $cmd = str_replace(array('%f', '%o', '%m'), array($infile, $target.'.txt', $mimetype), $this->converters[$mimetype]); + } elseif(isset($this->converters[$mimeparts[0].'/*'])) { + $cmd = str_replace(array('%f', '%o', '%m'), array($infile, $target.'.txt', $mimetype), $this->converters[$mimeparts[0].'/*']); + } elseif(isset($this->converters['*'])) { + $cmd = str_replace(array('%f', '%o', '%m'), array($infile, $target.'.txt', $mimetype), $this->converters['*']); + } + + if($cmd) { + try { + self::execWithTimeout($cmd, $this->timeout); + $new = true; + } catch(Exception $e) { + $this->lastpreviewfile = ''; + return false; + } + } + } + return true; + } + $new = false; + return true; + + } /* }}} */ + + /** + * Create preview image + * + * This function creates a preview image for the given document + * content or document file. It internally uses + * {@link SeedDMS_Preview::createRawPreview()}. The filename of the + * preview image is created by {@link SeedDMS_Preview_Previewer::getFileName()} + * + * @param object $object instance of SeedDMS_Core_DocumentContent + * or SeedDMS_Core_DocumentFile + * @return boolean true on success, false on failure + */ + public function createPreview($object) { /* {{{ */ + if(!$object) + return false; + + $document = $object->getDocument(); + $file = $document->_dms->contentDir.$object->getPath(); + $target = $this->getFileName($object); + return $this->createRawPreview($file, $document->getDir(), $object->getMimeType(), $target); + } /* }}} */ + + /** + * Check if a preview image already exists. + * + * This function is a companion to {@link SeedDMS_Preview_Previewer::createRawPreview()}. + * + * @param string $infile name of input file including full path + * @param string $dir directory relative to $this->previewDir + * @return boolean true if preview exists, otherwise false + */ + public function hasRawPreview($infile, $dir, $target='') { /* {{{ */ + if(!$this->previewDir) + return false; + if(!$target) + $target = $this->previewDir.$dir.md5($infile); + if($target !== false && file_exists($target.'.txt') && filectime($target.'.txt') >= filectime($infile)) { + return true; + } + return false; + } /* }}} */ + + /** + * Check if a preview txt already exists. + * + * This function is a companion to {@link SeedDMS_Preview_Previewer::createPreview()}. + * + * @param object $object instance of SeedDMS_Core_DocumentContent + * or SeedDMS_Core_DocumentFile + * @return boolean true if preview exists, otherwise false + */ + public function hasPreview($object) { /* {{{ */ + if(!$object) + return false; + + if(!$this->previewDir) + return false; + $target = $this->getFileName($object); + if($target !== false && file_exists($target.'.txt') && filectime($target.'.txt') >= $object->getDate()) { + return true; + } + return false; + } /* }}} */ + + /** + * Return a preview image. + * + * This function returns the content of a preview image if it exists.. + * + * @param string $infile name of input file including full path + * @param string $dir directory relative to $this->previewDir + * @return boolean/string image content if preview exists, otherwise false + */ + public function getRawPreview($infile, $dir, $target='') { /* {{{ */ + if(!$this->previewDir) + return false; + + if(!$target) + $target = $this->previewDir.$dir.md5($infile); + if($target && file_exists($target.'.txt')) { + $this->sendFile($target.'.txt'); + } + } /* }}} */ + + /** + * Return a preview image. + * + * This function returns the content of a preview image if it exists.. + * + * @param object $object instance of SeedDMS_Core_DocumentContent + * or SeedDMS_Core_DocumentFile + * @return boolean/string image content if preview exists, otherwise false + */ + public function getPreview($object) { /* {{{ */ + if(!$this->previewDir) + return false; + + $target = $this->getFileName($object); + if($target && file_exists($target.'.txt')) { + $this->sendFile($target.'.txt'); + } + } /* }}} */ + + /** + * Return file size preview image. + * + * @param object $object instance of SeedDMS_Core_DocumentContent + * or SeedDMS_Core_DocumentFile + * @return boolean/integer size of preview image or false if image + * does not exist + */ + public function getFilesize($object) { /* {{{ */ + $target = $this->getFileName($object); + if($target && file_exists($target.'.txt')) { + return(filesize($target.'.txt')); + } else { + return false; + } + + } /* }}} */ + + /** + * Delete preview image. + * + * @param object $object instance of SeedDMS_Core_DocumentContent + * or SeedDMS_Core_DocumentFile + * @return boolean true if deletion succeded or false if file does not exist + */ + public function deletePreview($object) { /* {{{ */ + if(!$this->previewDir) + return false; + + $target = $this->getFileName($object); + if($target && file_exists($target.'.txt')) { + return(unlink($target.'.txt')); + } else { + return false; + } + } /* }}} */ + + static function recurseRmdir($dir) { + $files = array_diff(scandir($dir), array('.','..')); + foreach ($files as $file) { + (is_dir("$dir/$file")) ? SeedDMS_Preview_Previewer::recurseRmdir("$dir/$file") : unlink("$dir/$file"); + } + return rmdir($dir); + } + + /** + * Delete all preview text belonging to a document + * + * This function removes the preview text of all versions and + * files of a document including the directory. It actually just + * removes the directory for the document in the cache. + * + * @param object $document instance of SeedDMS_Core_Document + * @return boolean true if deletion succeded or false if file does not exist + */ + public function deleteDocumentPreviews($document) { /* {{{ */ + if(!$this->previewDir) + return false; + + $dir = $this->previewDir.DIRECTORY_SEPARATOR.$document->getDir(); + if(file_exists($dir) && is_dir($dir)) { + return SeedDMS_Preview_Previewer::recurseRmdir($dir); + } else { + return false; + } + + } /* }}} */ +} +?> diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index 5dd1e4b41..cddd83d25 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2021-10-16 + 2023-01-09 - 1.4.0 - 1.4.0 + 1.5.0 + 1.5.0 stable @@ -23,8 +23,7 @@ GPL License -- use new conversion service if available -- createRawPreview() checks early if a converter exists +- add previewer which creates txt @@ -38,6 +37,9 @@ + + + @@ -49,7 +51,7 @@ - 4.3.0 + 7.4.0 1.5.4 @@ -488,5 +490,22 @@ update package description preview image was actually created + + 2021-10-16 + + + 1.4.0 + 1.4.0 + + + stable + stable + + GPL License + +- use new conversion service if available +- createRawPreview() checks early if a converter exists + + diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Document.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Document.php index ea63d733e..7b299a9a0 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Document.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Document.php @@ -111,7 +111,7 @@ class SeedDMS_SQLiteFTS_Document { * @return string */ public function getFieldValue($fieldName) { - return $this->getField($fieldName)->value; + return $this->getField($fieldName)->value; } } ?> diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php index ab553bd96..1bb3a32f0 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/IndexedDocument.php @@ -151,8 +151,9 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { if($version) { $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('mimetype', $version->getMimeType())); $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('origfilename', $version->getOriginalFileName())); + $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('created', $version->getDate(), 'unindexed')); if(!$nocontent) - $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('created', $version->getDate(), 'unindexed')); + $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('indexed', time(), 'unindexed')); if($attributes = $version->getAttributes()) { foreach($attributes as $attribute) { $attrdef = $attribute->getAttributeDefinition(); @@ -168,7 +169,7 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { foreach($categories as $cat) { $names[] = $cat->getName(); } - $this->addField(SeedDMS_SQLiteFTS_Field::Text('category', implode(' ', $names))); + $this->addField(SeedDMS_SQLiteFTS_Field::Text('category', implode('#', $names))); } if($keywords = $document->getKeywords()) { $this->addField(SeedDMS_SQLiteFTS_Field::Text('keywords', $keywords)); @@ -182,7 +183,15 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { if(file_exists($path)) { $mimetype = $version->getMimeType(); $this->mimetype = $mimetype; - if(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) { + if(is_callable($convcmd)) { + $result = $convcmd($document); + if($result['content']) { + self::setContent($result['content']); + } elseif($result['content'] === false) { + $this->errormsg = $result['errormsg']; + } + $this->cmd = $result['cmd']; + } elseif(is_object($convcmd) && (get_class($convcmd) == 'SeedDMS_ConversionMgr')) { if($service = $convcmd->getService($mimetype, 'text/plain')) { $content = $convcmd->convert($path, $mimetype, 'text/plain'); if($content) { @@ -226,6 +235,7 @@ class SeedDMS_SQLiteFTS_IndexedDocument extends SeedDMS_SQLiteFTS_Document { $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('document_id', 'F'.$document->getID())); $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('record_type', 'folder')); $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('created', $document->getDate(), 'unindexed')); + $this->addField(SeedDMS_SQLiteFTS_Field::Keyword('indexed', time(), 'unindexed')); } } /* }}} */ diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php index fd2ec197c..559b93bc4 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Indexer.php @@ -25,18 +25,48 @@ class SeedDMS_SQLiteFTS_Indexer { /** - * @var string $ftstype + * @var string $_ftstype * @access protected */ protected $_ftstype; /** - * @var object $index sqlite index + * @var object $_conn sqlite index * @access protected */ protected $_conn; + /** + * @var array $_stop_words array of stop words + * @access protected + */ + protected $_stop_words; + const ftstype = 'fts5'; + + /** + * Remove stopwords from string + */ + protected function strip_stopwords($str = "") { /* {{{ */ + // 1.) break string into words + // [^-\w\'] matches characters, that are not [0-9a-zA-Z_-'] + // if input is unicode/utf-8, the u flag is needed: /pattern/u + $words = preg_split('/[^-\w\']+/u', $str, -1, PREG_SPLIT_NO_EMPTY); + + // 2.) if we have at least 2 words, remove stopwords + if(!empty($words)) { + $stopwords = $this->_stop_words; + $words = array_filter($words, function ($w) use (&$stopwords) { + return ((mb_strlen($w, 'utf-8') > 2) && !isset($stopwords[mb_strtolower($w, "utf-8")])); + }); + } + + // check if not too much was removed such as "the the" would return empty + if(!empty($words)) + return implode(" ", $words); + return $str; + } /* }}} */ + /** * Constructor * @@ -48,6 +78,7 @@ class SeedDMS_SQLiteFTS_Indexer { $this->_rawid = 'rowid'; else $this->_rawid = 'docid'; + $this->_stop_words = []; } /* }}} */ /** @@ -59,7 +90,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(file_exists($conf['indexdir'].'/index.db')) { return new SeedDMS_SQLiteFTS_Indexer($conf['indexdir']); } else - return self::create($conf); + return static::create($conf); } /* }}} */ /** @@ -77,9 +108,9 @@ class SeedDMS_SQLiteFTS_Indexer { $version = SQLite3::version(); if(self::ftstype == 'fts4') { if($version['versionNumber'] >= 3008000) - $sql = 'CREATE VIRTUAL TABLE docs USING fts4(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created, users, status, path, notindexed=created, matchinfo=fts3)'; + $sql = 'CREATE VIRTUAL TABLE docs USING fts4(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created, indexed, users, status, path, notindexed=created, notindexed=indexed, matchinfo=fts3)'; else - $sql = 'CREATE VIRTUAL TABLE docs USING fts4(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created, users, status, path, matchinfo=fts3)'; + $sql = 'CREATE VIRTUAL TABLE docs USING fts4(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created, indexed, users, status, path, matchinfo=fts3)'; $res = $index->_conn->exec($sql); if($res === false) { return null; @@ -90,7 +121,7 @@ class SeedDMS_SQLiteFTS_Indexer { return null; } } elseif(self::ftstype == 'fts5') { - $sql = 'CREATE VIRTUAL TABLE docs USING fts5(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created unindexed, users, status, path)'; + $sql = 'CREATE VIRTUAL TABLE docs USING fts5(documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created unindexed, indexed unindexed, users, status, path)'; $res = $index->_conn->exec($sql); if($res === false) { return null; @@ -109,7 +140,9 @@ class SeedDMS_SQLiteFTS_Indexer { * Do some initialization * */ - static function init($stopWordsFile='') { /* {{{ */ + public function init($stopWordsFile='') { /* {{{ */ + if($stopWordsFile) + $this->_stop_words = array_flip(preg_split("/[\s,]+/", file_get_contents($stopWordsFile))); } /* }}} */ /** @@ -123,7 +156,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - foreach(array('comment', 'keywords', 'category', 'content', 'mimetype', 'origfilename', 'status', 'created') as $kk) { + foreach(array('comment', 'keywords', 'category', 'content', 'mimetype', 'origfilename', 'status', 'created', 'indexed') as $kk) { try { ${$kk} = $doc->getFieldValue($kk); } catch (Exception $e) { @@ -135,7 +168,10 @@ class SeedDMS_SQLiteFTS_Indexer { if($res === false) { return false; } - $sql = "INSERT INTO docs (documentid, record_type, title, comment, keywords, category, owner, content, mimetype, origfilename, created, users, status, path) VALUES (".$this->_conn->quote($doc->getFieldValue('document_id')).", ".$this->_conn->quote($doc->getFieldValue('record_type')).", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($comment).", ".$this->_conn->quote($keywords).", ".$this->_conn->quote($category).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($content).", ".$this->_conn->quote($mimetype).", ".$this->_conn->quote($origfilename).", ".(int)$created.", ".$this->_conn->quote($doc->getFieldValue('users')).", ".$this->_conn->quote($status).", ".$this->_conn->quote($doc->getFieldValue('path'))/*time()*/.")"; + if($this->_stop_words) + $content = $this->strip_stopwords($content); + + $sql = "INSERT INTO docs (documentid, record_type, title, comment, keywords, category, owner, content, mimetype, origfilename, created, indexed, users, status, path) VALUES (".$this->_conn->quote($doc->getFieldValue('document_id')).", ".$this->_conn->quote($doc->getFieldValue('record_type')).", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($comment).", ".$this->_conn->quote($keywords).", ".$this->_conn->quote($category).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($content).", ".$this->_conn->quote($mimetype).", ".$this->_conn->quote($origfilename).", ".(int)$created.", ".(int)$indexed.", ".$this->_conn->quote($doc->getFieldValue('users')).", ".$this->_conn->quote($status).", ".$this->_conn->quote($doc->getFieldValue('path'))/*time()*/.")"; $res = $this->_conn->exec($sql); if($res === false) { return false; @@ -147,8 +183,7 @@ class SeedDMS_SQLiteFTS_Indexer { /** * Remove document from index * - * @param object $doc indexed document of class - * SeedDMS_SQLiteFTS_IndexedDocument + * @param object $id internal id of document * @return boolean false in case of an error, otherwise true */ public function delete($id) { /* {{{ */ @@ -179,15 +214,22 @@ class SeedDMS_SQLiteFTS_Indexer { * @return boolean false in case of an error, otherwise array with elements * 'count', 'hits', 'facets'. 'hits' is an array of SeedDMS_SQLiteFTS_QueryHit */ - public function find($query, $limit=array()) { /* {{{ */ + public function find($query, $filter='', $limit=array(), $order=array()) { /* {{{ */ if(!$this->_conn) return false; /* First count some records for facets */ - foreach(array('owner', 'mimetype', 'category') as $facetname) { + foreach(array('owner', 'mimetype', 'category', 'status') as $facetname) { $sql = "SELECT `".$facetname."`, count(*) AS `c` FROM `docs`"; - if($query) + if($query) { $sql .= " WHERE docs MATCH ".$this->_conn->quote($query); + } + if($filter) { + if($query) + $sql .= " AND ".$filter; + else + $sql .= " WHERE ".$filter; + } $res = $this->_conn->query($sql." GROUP BY `".$facetname."`"); if(!$res) throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"$facetname\" failed."); @@ -196,7 +238,7 @@ class SeedDMS_SQLiteFTS_Indexer { foreach($res as $row) { if($row[$facetname] && $row['c']) { if($facetname == 'category') { - $tmp = explode(' ', $row[$facetname]); + $tmp = explode('#', $row[$facetname]); if(count($tmp) > 1) { foreach($tmp as $t) { if(!isset($facets[$facetname][$t])) @@ -210,6 +252,8 @@ class SeedDMS_SQLiteFTS_Indexer { else $facets[$facetname][$row[$facetname]] += $row['c']; } + } elseif($facetname == 'status') { + $facets[$facetname][($row[$facetname]-10).''] = $row['c']; } else $facets[$facetname][$row[$facetname]] = $row['c']; } @@ -219,6 +263,12 @@ class SeedDMS_SQLiteFTS_Indexer { $sql = "SELECT `record_type`, count(*) AS `c` FROM `docs`"; if($query) $sql .= " WHERE docs MATCH ".$this->_conn->quote($query); + if($filter) { + if($query) + $sql .= " AND ".$filter; + else + $sql .= " WHERE ".$filter; + } $res = $this->_conn->query($sql." GROUP BY `record_type`"); if(!$res) throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"record_type\" failed."); @@ -232,10 +282,32 @@ class SeedDMS_SQLiteFTS_Indexer { $sql = "SELECT ".$this->_rawid.", documentid FROM docs"; if($query) $sql .= " WHERE docs MATCH ".$this->_conn->quote($query); - if($this->_ftstype == 'fts5') + if($filter) { + if($query) + $sql .= " AND ".$filter; + else + $sql .= " WHERE ".$filter; + } + if($this->_ftstype == 'fts5') { //$sql .= " ORDER BY rank"; - // boost documentid, title and comment - $sql .= " ORDER BY bm25(docs, 10.0, 10.0, 10.0)"; + // boost documentid, record_type, title, comment, keywords, category, mimetype, origfilename, owner, content, created unindexed, users, status, path + if(!empty($order['by'])) { + switch($order['by']) { + case "title": + $sql .= " ORDER BY title"; + break; + case "created": + $sql .= " ORDER BY created"; + break; + default: + $sql .= " ORDER BY bm25(docs, 10.0, 0.0, 10.0, 5.0, 5.0, 10.0)"; + } + if(!empty($order['dir'])) { + if($order['dir'] == 'desc') + $sql .= " DESC"; + } + } + } if(!empty($limit['limit'])) $sql .= " LIMIT ".(int) $limit['limit']; if(!empty($limit['offset'])) @@ -289,7 +361,7 @@ class SeedDMS_SQLiteFTS_Indexer { if(!$this->_conn) return false; - $sql = "SELECT ".$this->_rawid.", documentid, title, comment, owner, keywords, category, mimetype, origfilename, created, users, status, path".($content ? ", content" : "")." FROM docs WHERE ".$this->_rawid."='".$id."'"; + $sql = "SELECT ".$this->_rawid.", documentid, title, comment, owner, keywords, category, mimetype, origfilename, created, indexed, users, status, path".($content ? ", content" : "")." FROM docs WHERE ".$this->_rawid."='".$id."'"; $res = $this->_conn->query($sql); $doc = false; if($res) { @@ -306,9 +378,10 @@ class SeedDMS_SQLiteFTS_Indexer { $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('origfilename', $rec['origfilename'])); $doc->addField(SeedDMS_SQLiteFTS_Field::Text('owner', $rec['owner'])); $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('created', $rec['created'])); + $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('indexed', $rec['indexed'])); $doc->addField(SeedDMS_SQLiteFTS_Field::Text('users', $rec['users'])); $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('status', $rec['status'])); - $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('path', $rec['path'])); + $doc->addField(SeedDMS_SQLiteFTS_Field::Keyword('path', explode('x', substr($rec['path'], 1, -1)))); if($content) $doc->addField(SeedDMS_SQLiteFTS_Field::UnStored('content', $rec['content'])); } @@ -318,16 +391,33 @@ class SeedDMS_SQLiteFTS_Indexer { /** * Return list of terms in index * - * This function does nothing! + * @return array list of SeedDMS_SQLiteFTS_Term */ - public function terms() { /* {{{ */ + public function terms($prefix='', $col='') { /* {{{ */ if(!$this->_conn) return false; - if($this->_ftstype == 'fts5') - $sql = "SELECT term, col, doc as occurrences FROM docs_terms WHERE col!='*' ORDER BY col"; - else - $sql = "SELECT term, col, occurrences FROM docs_terms WHERE col!='*' ORDER BY col"; + if($this->_ftstype == 'fts5') { + $sql = "SELECT term, col, doc as occurrences FROM docs_terms"; + if($prefix || $col) { + $sql .= " WHERE"; + if($prefix) { + $sql .= " term like '".$prefix."%'"; + if($col) + $sql .= " AND"; + } + if($col) + $sql .= " col = '".$col."'"; + } + $sql .= " ORDER BY col, occurrences desc"; + } else { + $sql = "SELECT term, col, occurrences FROM docs_terms WHERE col!='*'"; + if($prefix) + $sql .= " AND term like '".$prefix."%'"; + if($col) + $sql .= " AND col = '".$col."'"; + $sql .= " ORDER BY col, occurrences desc"; + } $res = $this->_conn->query($sql); $terms = array(); if($res) { @@ -340,8 +430,9 @@ class SeedDMS_SQLiteFTS_Indexer { } /* }}} */ /** - * Return list of documents in index + * Return number of documents in index * + * @return interger number of documents */ public function count() { /* {{{ */ $sql = "SELECT count(*) c FROM docs"; diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/QueryHit.php b/SeedDMS_SQLiteFTS/SQLiteFTS/QueryHit.php index facbd9519..843be973d 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/QueryHit.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/QueryHit.php @@ -53,6 +53,7 @@ class SeedDMS_SQLiteFTS_QueryHit { */ public function __construct(SeedDMS_SQLiteFTS_Indexer $index) { /* {{{ */ $this->_index = $index; + $this->_document = null; } /* }}} */ /** diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php index d6ba6b6a7..22c43a1e5 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php @@ -70,7 +70,7 @@ class SeedDMS_SQliteFTS_Search { * @param object $index SQlite FTS index * @return object instance of SeedDMS_Lucene_Search */ - function search($term, $fields=array(), $limit=array()) { /* {{{ */ + function search($term, $fields=array(), $limit=array(), $order=array()) { /* {{{ */ $querystr = ''; $term = trim($term); if($term) { @@ -139,8 +139,20 @@ class SeedDMS_SQliteFTS_Search { $querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':'); $querystr .= '*)'; } + + $filterstr = ''; + if(!empty($fields['created_start'])) { + if($filterstr) + $filterstr .= ' AND '; + $filterstr .= '(created>='.$fields['created_start'].')'; + } + if(!empty($fields['created_end'])) { + if($filterstr) + $filterstr .= ' AND '; + $filterstr .= '(created<'.$fields['created_end'].')'; + } try { - $result = $this->index->find($querystr, $limit); + $result = $this->index->find($querystr, $filterstr, $limit, $order); $recs = array(); foreach($result["hits"] as $hit) { $recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid); diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php index 462d6123e..e31ff56bc 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Term.php @@ -60,7 +60,8 @@ class SeedDMS_SQLiteFTS_Term { 9 => 'created', 10 => 'user', 11 => 'status', - 12 => 'path' + 12 => 'path', + 13 => 'indexed', ); /* fts5 pass the column name in $col, fts4 uses an integer */ if(is_int($col)) diff --git a/SeedDMS_SQLiteFTS/package.xml b/SeedDMS_SQLiteFTS/package.xml index a862245cf..3813a6252 100644 --- a/SeedDMS_SQLiteFTS/package.xml +++ b/SeedDMS_SQLiteFTS/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2022-03-04 + 2023-01-09 - 1.0.17 - 1.0.17 + 1.0.18 + 1.0.18 stable @@ -23,8 +23,10 @@ GPL License -- throw exeption in find() instead of returning false -- fix query if rootFolder or startFolder is set +- add optional parameter $order to SeedDMS_SQLiteFTS_Indexer::find() +- add optional parameters $query and $col to SeedDMS_SQLiteFTS_Indexer::terms() +- IndexedDocument() accepts a callable for conversion to text +- remove stop words from content @@ -353,5 +355,22 @@ add user to list of terms - add class SeedDMS_SQLiteFTS_Field + + 2022-03-04 + + + 1.0.17 + 1.0.17 + + + stable + stable + + GPL License + +- throw exeption in find() instead of returning false +- fix query if rootFolder or startFolder is set + + diff --git a/controllers/class.ClearCache.php b/controllers/class.ClearCache.php index 770abcdea..aef34fc5e 100644 --- a/controllers/class.ClearCache.php +++ b/controllers/class.ClearCache.php @@ -29,8 +29,18 @@ class SeedDMS_Controller_ClearCache extends SeedDMS_Controller_Common { $post = $this->params['post']; $ret = ''; - if(!empty($post['preview'])) { - $cmd = 'rm -rf '.$settings->_cacheDir.'/[1-9]*'; + if(!empty($post['previewpng'])) { + $cmd = 'rm -rf '.$settings->_cacheDir.'/png/[1-9]*'; + system($cmd, $ret); + } + + if(!empty($post['previewpdf'])) { + $cmd = 'rm -rf '.$settings->_cacheDir.'/pdf/[1-9]*'; + system($cmd, $ret); + } + + if(!empty($post['previewtxt'])) { + $cmd = 'rm -rf '.$settings->_cacheDir.'/txt/[1-9]*'; system($cmd, $ret); } diff --git a/controllers/class.Cron.php b/controllers/class.Cron.php index 0ea71e76b..135a227dc 100644 --- a/controllers/class.Cron.php +++ b/controllers/class.Cron.php @@ -26,6 +26,7 @@ class SeedDMS_Controller_Cron extends SeedDMS_Controller_Common { $dms = $this->params['dms']; $user = $this->params['user']; $settings = $this->params['settings']; + $logger = $this->params['logger']; $mode = $this->params['mode']; $db = $dms->getDb(); diff --git a/controllers/class.Login.php b/controllers/class.Login.php index 93a0b840e..74943113a 100644 --- a/controllers/class.Login.php +++ b/controllers/class.Login.php @@ -35,9 +35,11 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common { $dms = $this->params['dms']; $settings = $this->params['settings']; $session = $this->params['session']; - $sesstheme = $this->params['sesstheme']; - $referuri = $this->params['referuri']; - $lang = $this->params['lang']; + $authenticator = $this->params['authenticator']; + $source = isset($this->params['source']) ? $this->params['source'] : ''; + $sesstheme = $this->getParam('sesstheme'); + $referuri = $this->getParam('referuri'); + $lang = $this->getParam('lang'); $login = $this->params['login']; if($user = $dms->getUserByLogin($login)) { @@ -133,73 +135,78 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common { /* Clear login failures if login was successful */ $user->clearLoginFailures(); - // Capture the user's language and theme settings. - if ($lang) { - $user->setLanguage($lang); - } else { - $lang = $user->getLanguage(); - if (strlen($lang)==0) { - $lang = $settings->_language; + /* Setting the theme and language and all the cookie handling is + * only done when authentication was requested from a weg page. + */ + if($source == 'web') { + // Capture the user's language and theme settings. + if ($lang) { $user->setLanguage($lang); - } - } - if ($sesstheme) { - $user->setTheme($sesstheme); - } - else { - $sesstheme = $user->getTheme(); - /* Override the theme if the user doesn't have one or the default theme - * shall override it. - */ - if (strlen($sesstheme)==0 || !empty($settings->_overrideTheme)) { - $sesstheme = $settings->_theme; - // $user->setTheme($sesstheme); - } - } - - // Delete all sessions that are more than 1 week or the configured - // cookie lifetime old. Probably not the most - // reliable place to put this check -- move to inc.Authentication.php? - if($settings->_cookieLifetime) - $lifetime = intval($settings->_cookieLifetime); - else - $lifetime = 7*86400; - if(!$session->deleteByTime($lifetime)) { - $this->setErrorMsg("error_occured"); - return false; - } - - if (isset($_COOKIE["mydms_session"])) { - /* This part will never be reached unless the session cookie is kept, - * but op.Logout.php deletes it. Keeping a session could be a good idea - * for retaining the clipboard data, but the user id in the session should - * be set to 0 which is not possible due to foreign key constraints. - * So for now op.Logout.php will delete the cookie as always - */ - /* Load session */ - $dms_session = $_COOKIE["mydms_session"]; - if(!$resArr = $session->load($dms_session)) { - /* Turn off http only cookies if jumploader is enabled */ - setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot, null, false, true); //delete cookie - header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$referuri); - exit; } else { - $session->updateAccess($dms_session); - $session->setUser($userid); + $lang = $user->getLanguage(); + if (strlen($lang)==0) { + $lang = $settings->_language; + $user->setLanguage($lang); + } } - } else { - // Create new session in database - if(!$id = $session->create(array('userid'=>$userid, 'theme'=>$sesstheme, 'lang'=>$lang))) { + if ($sesstheme) { + $user->setTheme($sesstheme); + } + else { + $sesstheme = $user->getTheme(); + /* Override the theme if the user doesn't have one or the default theme + * shall override it. + */ + if (strlen($sesstheme)==0 || !empty($settings->_overrideTheme)) { + $sesstheme = $settings->_theme; + // $user->setTheme($sesstheme); + } + } + + // Delete all sessions that are more than 1 week or the configured + // cookie lifetime old. Probably not the most + // reliable place to put this check -- move to inc.Authentication.php? + if($settings->_cookieLifetime) + $lifetime = intval($settings->_cookieLifetime); + else + $lifetime = 7*86400; + if(!$session->deleteByTime($lifetime)) { $this->setErrorMsg("error_occured"); return false; } - // Set the session cookie. - if($settings->_cookieLifetime) - $lifetime = time() + intval($settings->_cookieLifetime); - else - $lifetime = 0; - setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, false, true); + if (isset($_COOKIE["mydms_session"])) { + /* This part will never be reached unless the session cookie is kept, + * but op.Logout.php deletes it. Keeping a session could be a good idea + * for retaining the clipboard data, but the user id in the session should + * be set to 0 which is not possible due to foreign key constraints. + * So for now op.Logout.php will delete the cookie as always + */ + /* Load session */ + $dms_session = $_COOKIE["mydms_session"]; + if(!$resArr = $session->load($dms_session)) { + /* Turn off http only cookies if jumploader is enabled */ + setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot, null, false, true); //delete cookie + header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$referuri); + exit; + } else { + $session->updateAccess($dms_session); + $session->setUser($userid); + } + } else { + // Create new session in database + if(!$id = $session->create(array('userid'=>$userid, 'theme'=>$sesstheme, 'lang'=>$lang))) { + $this->setErrorMsg("error_occured"); + return false; + } + + // Set the session cookie. + if($settings->_cookieLifetime) + $lifetime = time() + intval($settings->_cookieLifetime); + else + $lifetime = 0; + setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, false, true); + } } if($this->callHook('postLogin', $user)) { @@ -275,6 +282,7 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common { } } + if(0) { /* Authenticate against LDAP server {{{ */ if (!is_object($user) && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { require_once("../inc/inc.ClassLdapAuthentication.php"); @@ -288,6 +296,7 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common { $authobj = new SeedDMS_DbAuthentication($dms, $settings); $user = $authobj->authenticate($login, $pwd); } /* }}} */ + } /* If the user is still not authenticated, then exit with an error */ if(!is_object($user)) { diff --git a/doc/README.Converters b/doc/README.Converters index e916159dc..730466e72 100644 --- a/doc/README.Converters +++ b/doc/README.Converters @@ -90,6 +90,9 @@ image/jpeg image/png convert -resize %wx '%f' 'png:%o' +text/plain + convert -density 100 -resize %wx 'text:%f[0]' 'png:%o' + application/pdf gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dPDFFitPage -r72x72 -sOutputFile=- -dFirstPage=1 -dLastPage=1 -q '%f' | convert -resize %wx png:- '%o' @@ -97,9 +100,15 @@ application/pdf mutool draw -F png -w %w -q -N -o %o %f 1 +application/postscript + convert -density 100 -resize %wx '%f[0]' 'png:%o' + text/plain a2ps -1 -a1 -R -B -o - '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dFirstPage=1 -dLastPage=1 -dPDFFitPage -r72x72 -sOutputFile=- -q - | convert -resize %wx png:- 'png:%o' + On Linux systems you will have to set the desired value in /etc/papersize for a2ps + e.g. a4, or letter + application/msword application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text diff --git a/doc/README.Scheduler.md b/doc/README.Scheduler.md new file mode 100644 index 000000000..9bd20772c --- /dev/null +++ b/doc/README.Scheduler.md @@ -0,0 +1,26 @@ +Scheduler +========== + +The scheduler in SeedDMS manages frequently run tasks. It is very similar +to regular unix cron jobs. A task in SeedDMS is an instanciation of a task +class which itself is defined by an extension or SeedDMS itself. +SeedDMS has some predefined classes e.g. core::expireddocs. + +In order for tasks to be runnalbe, a user `cli_scheduler` must exists in +SeedDMS. + +All tasks are executed by a single cronjob in the directory `utils` + +> */5 * * * * /home/www-data/seeddms60x/seeddms/utils/seeddms-schedulercli --mode=run + +Please keep in mind, that the php interpreter used for the cronjob may be +different from the php interpreter used für the web application. Hence, two +different php.ini files might be used. php and the php extensions may differ as +well. This can cause some extensions to be disabled and consequently some task +classes are not defined. + +`utils/seeddms-schedulercli` can also be run on the command line. If you +do that, run it with the same system user used for the web server. On Debian +this is www-data. Hence run it like + +sudo -u www-data utils/seeddms-schedulercli --mode=list diff --git a/doc/README.Swagger b/doc/README.Swagger new file mode 100644 index 000000000..576339a5e --- /dev/null +++ b/doc/README.Swagger @@ -0,0 +1,13 @@ +Swagger +======== + +Swagger is used to describe a rest api. SeedDMS ships a swagger.yaml file +in the restapi directory. You can load this file into a swagger editor, e.g. +http://petstore.swagger.io/ or http://editor.swagger.io/ +You may as well set up your own swagger-ui installation as described at +https://medium.com/@tatianaensslin/how-to-add-swagger-ui-to-php-server-code-f1610c01dc03 + +Your apache needs to have the module 'header' enabled, because some HTTP headers +are set when the file swagger.yaml is accessed by the editor. + +Currently, the swagger.yaml shipped with SeedDMS uses still swagger 2.0 diff --git a/doc/README.WebDAV b/doc/README.WebDAV index 0f66f8318..81ce83a1d 100644 --- a/doc/README.WebDAV +++ b/doc/README.WebDAV @@ -1,5 +1,5 @@ WebDAV ------------------------------------------------ +======== SeedDMS has support for WebDAV which allows to easily add, delete, move, copy and modify documents. All operating systems have support @@ -29,7 +29,7 @@ the content of document or creating a new version if a document is saved. Configuring davfs2 -=================== +------------------- On Linux it is quite simple to mount the SeedDMS WebDAV server with davfs2. Just place a line like the following in your /etc/fstab @@ -51,15 +51,14 @@ and possibly add your login data to /etc/davfs2/secrets /media/webdav admin secret Making applications work with WebDAV -===================================== +------------------------------------- Various programms have differnt strategies to save files to disc and prevent data lost under all circumstances. Those strategies often don't work very well an a WebDAV-Server. The following will list some of those strategies. -VIM -========================= +### VIM vim does a lot more than just reading and writing the file you want to edit. It creates swap and backup files for data recovery if vim crashes @@ -69,7 +68,7 @@ swap file at all or create it outside the WebDAV server. A second problem arises from how vim modifіes the file you are editing. Before a file is saved a backup is created by renaming the file to the same name with a '~' at the end and writing the file content into a new -file with the name of the original file. Afterwards vim deleteѕ the backup +file with the name of the original file. Afterwards vim deletes the backup file. On a regular file system you won't see a difference between the file before and after saving, though it is actually a new one. In SeedDMS you won't notice a difference either @@ -88,12 +87,17 @@ set nobackup set nowritebackup set noswapfile +If you want to restrict the settings to the directory where the dms +is mounted by webdav, e.g. /media/webdav, you can set an auto command +in .vimrc + +autocmd BufNewFile,BufRead /media/webdav/* set nobackup nowritebackup noswapfile + Creating the backup file in a directory outside of WebDAV doesn't help in -this case, because it still does the file renaming which is turned of by +this case, because it still does the file renaming which is turned off by 'nowritebackup'. -cdaver -======== +### cdaver cadaver is a webdav client similar to classical command line based ftp clients. It can be used to browse through the folders, downloads and uploads files, and diff --git a/inc/inc.Authentication.php b/inc/inc.Authentication.php index 70bf6d20a..642579922 100644 --- a/inc/inc.Authentication.php +++ b/inc/inc.Authentication.php @@ -12,9 +12,6 @@ * @version Release: @package_version@ */ -require_once("inc.Utils.php"); -require_once("inc.ClassNotificationService.php"); -require_once("inc.ClassEmailNotify.php"); require_once("inc.ClassSession.php"); require_once("inc.ClassAccessOperation.php"); @@ -110,8 +107,6 @@ if($settings->_useHomeAsRootFolder && !$user->isAdmin() && $user->getHomeFolder( $role = $user->getRole(); $dms->noReadForStatus = $role->getNoAccess(); -require_once('inc/inc.Notification.php'); - /* Include additional language file for view * This file must set $LANG[xx][] */ diff --git a/inc/inc.AuthenticationInit.php b/inc/inc.AuthenticationInit.php new file mode 100644 index 000000000..f7beb05b6 --- /dev/null +++ b/inc/inc.AuthenticationInit.php @@ -0,0 +1,42 @@ + + * @copyright Copyright (C) 2002-2005 Markus Westphal, + * 2006-2008 Malcolm Cowe, 2010-2022 Uwe Steinmann + * @version Release: @package_version@ + */ + +require_once('inc.ClassAuthenticationService.php'); +require_once('inc.ClassDbAuthentication.php'); +require_once('inc.ClassLdapAuthentication.php'); + +global $logger; +$authenticator = new SeedDMS_AuthenticationService($logger, $settings); + +if(isset($GLOBALS['SEEDDMS_HOOKS']['authentication'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['authentication'] as $authenticationObj) { + if(method_exists($authenticationObj, 'preAddService')) { + $authenticationObj->preAddService($dms, $authenticator); + } + } +} + +$authenticator->addService(new SeedDMS_DbAuthentication($dms, $settings), 'db'); +if(isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { + $authenticator->addService(new SeedDMS_LdapAuthentication($dms, $settings), 'ldap'); +} + +if(isset($GLOBALS['SEEDDMS_HOOKS']['authentication'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['authentication'] as $authenticationObj) { + if(method_exists($authenticationObj, 'postAddService')) { + $authenticationObj->postAddService($dms, $authenticator); + } + } +} + diff --git a/inc/inc.BasicAuthentication.php b/inc/inc.BasicAuthentication.php index 37f4cf8c4..8d9a69bdb 100644 --- a/inc/inc.BasicAuthentication.php +++ b/inc/inc.BasicAuthentication.php @@ -18,53 +18,13 @@ require_once("inc.ClassEmailNotify.php"); require_once("inc.ClassSession.php"); require_once("inc.ClassAccessOperation.php"); -function __authenticate($username, $password) { /* {{{ */ - global $dms, $settings; - - $user = false; - - /* Authenticate against LDAP server {{{ */ - if (!$user && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { - require_once("../inc/inc.ClassLdapAuthentication.php"); - $authobj = new SeedDMS_LdapAuthentication($dms, $settings); - $user = $authobj->authenticate($username, $password); - } /* }}} */ - - /* Authenticate against SeedDMS database {{{ */ - else { - require_once("../inc/inc.ClassDbAuthentication.php"); - $authobj = new SeedDMS_DbAuthentication($dms, $settings); - $user = $authobj->authenticate($username, $password); - } /* }}} */ - - if (!$user) { - return false; - } - - if (($user->getID() == $settings->_guestID) && (!$settings->_enableGuestLogin)) { - return false; - } - - // Check if account is disabled - if($user->isDisabled()) { - return false; - } - - // control admin IP address if required - if ($user->isAdmin() && ($_SERVER['REMOTE_ADDR'] != $settings->_adminIP ) && ( $settings->_adminIP != "") ){ - return false; - } - - return $user; -} /* }}} */ - if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="'.$settings->_siteName.'"'); header('HTTP/1.0 401 Unauthorized'); echo getMLText('cancel_basic_authentication'); exit; } else { - if(!($user = __authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']))) { + if(!($user = $authenticator->authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']))) { header('WWW-Authenticate: Basic realm="'.$settings->_siteName.'"'); header('HTTP/1.0 401 Unauthorized'); echo getMLText('cancel_basic_authentication'); diff --git a/inc/inc.ClassAuthentication.php b/inc/inc.ClassAuthentication.php index 29e57ed20..d9a66315b 100644 --- a/inc/inc.ClassAuthentication.php +++ b/inc/inc.ClassAuthentication.php @@ -24,34 +24,6 @@ */ abstract class SeedDMS_Authentication { - /** - * DMS object - * - * @var SeedDMS_Core_DMS - * @access protected - */ - protected $dms; - - /** - * DMS settings - * - * @var Settings - * @access protected - */ - protected $settings; - - /** - * Constructor - * - * @param SeedDMS_Core_DMS $dms DMS object - * @param Settings $settings DMS settings - */ - function __construct($dms, $settings) /* {{{ */ - { - $this->dms = $dms; - $this->settings = $settings; - } /* }}} */ - /** * Do Authentication * diff --git a/inc/inc.ClassAuthenticationMiddleware.php b/inc/inc.ClassAuthenticationMiddleware.php new file mode 100644 index 000000000..5ddb846d7 --- /dev/null +++ b/inc/inc.ClassAuthenticationMiddleware.php @@ -0,0 +1,73 @@ +container = $container; + } + + /** + * Example middleware invokable class + * + * @param \Psr\Http\Message\ServerRequestInterface $request PSR7 request + * @param \Psr\Http\Message\ResponseInterface $response PSR7 response + * @param callable $next Next middleware + * + * @return \Psr\Http\Message\ResponseInterface + */ + public function __invoke($request, $response, $next) { + // $this->container has the DI + $dms = $this->container->dms; + $settings = $this->container->config; + $logger = $this->container->logger; + $userobj = null; + if($this->container->has('userobj')) + $userobj = $this->container->userobj; + + if($userobj) { + $response = $next($request, $response); + return $response; + } + + $logger->log("Invoke middleware for method ".$request->getMethod()." on '".$request->getUri()->getPath()."'", PEAR_LOG_INFO); + require_once("inc/inc.ClassSession.php"); + $session = new SeedDMS_Session($dms->getDb()); + if (isset($_COOKIE["mydms_session"])) { + $dms_session = $_COOKIE["mydms_session"]; + $logger->log("Session key: ".$dms_session, PEAR_LOG_DEBUG); + if(!$resArr = $session->load($dms_session)) { + /* Delete Cookie */ + setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); + $logger->log("Session for id '".$dms_session."' has gone", PEAR_LOG_ERR); + return $response->withStatus(403); + } + + /* Load user data */ + $userobj = $dms->getUser($resArr["userID"]); + if (!is_object($userobj)) { + /* Delete Cookie */ + setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); + if($settings->_enableGuestLogin) { + if(!($userobj = $dms->getUser($settings->_guestID))) + return $response->withStatus(403); + } else + return $response->withStatus(403); + } + if($userobj->isAdmin()) { + if($resArr["su"]) { + if(!($userobj = $dms->getUser($resArr["su"]))) + return $response->withStatus(403); + } + } + $dms->setUser($userobj); + } else { + return $response->withStatus(403); + } + $this->container['userobj'] = $userobj; + + $response = $next($request, $response); + return $response; + } +} /* }}} */ diff --git a/inc/inc.ClassAuthenticationService.php b/inc/inc.ClassAuthenticationService.php new file mode 100644 index 000000000..41119877a --- /dev/null +++ b/inc/inc.ClassAuthenticationService.php @@ -0,0 +1,88 @@ + + * @copyright Copyright (C) 2016 Uwe Steinmann + * @version Release: @package_version@ + */ + +/** + * Implementation of authentication service + * + * @category DMS + * @package SeedDMS + * @author Uwe Steinmann + * @copyright Copyright (C) 2016 Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_AuthenticationService { + /** + * List of services for authenticating user + */ + protected $services; + + /* + * List of servives with errors + */ + protected $errors; + + /* + * Service for logging + */ + protected $logger; + + /* + * Configuration + */ + protected $settings; + + public function __construct($logger = null, $settings = null) { /* {{{ */ + $this->services = array(); + $this->errors = array(); + $this->logger = $logger; + $this->settings = $settings; + } /* }}} */ + + public function addService($service, $name='') { /* {{{ */ + if(!$name) + $name = md5(uniqid()); + $this->services[$name] = $service; + $this->errors[$name] = true; + } /* }}} */ + + public function getServices() { /* {{{ */ + return $this->services; + } /* }}} */ + + public function getErrors() { /* {{{ */ + return $this->errors; + } /* }}} */ + + public function authenticate($username, $password) { /* {{{ */ + $user = null; + foreach($this->services as $name => $service) { + $this->logger->log('Authentication service \''.$name.'\'', PEAR_LOG_INFO); + $user = $service->authenticate($username, $password); + if($user === false) { + $this->errors[$name] = false; + if($this->logger) + $this->logger->log('Authentication service \''.$name.'\': Authentication of user \''.$username.'\' failed.', PEAR_LOG_ERR); + return false; + } elseif($user === null) { + if($this->logger) + $this->logger->log('Authentication service \''.$name.'\': Authentication of user \''.$username.'\' disregarded.', PEAR_LOG_ERR); + } else { + if($this->logger) + $this->logger->log('Authentication service \''.$name.'\': Authentication of user \''.$username.'\' successful.', PEAR_LOG_INFO); + $this->errors[$name] = true; + return $user; + } + } + return $user; + } /* }}} */ +} diff --git a/inc/inc.ClassConversionMgr.php b/inc/inc.ClassConversionMgr.php index 278d2e510..a4606327e 100644 --- a/inc/inc.ClassConversionMgr.php +++ b/inc/inc.ClassConversionMgr.php @@ -16,6 +16,7 @@ require_once("inc/inc.ClassConversionServiceImageToImage.php"); require_once("inc/inc.ClassConversionServiceImageToText.php"); require_once("inc/inc.ClassConversionServicePdfToImage.php"); require_once("inc/inc.ClassConversionServiceTextToText.php"); +require_once("inc/inc.ClassConversionServiceTextToImage.php"); /** * Implementation of conversion manager @@ -72,18 +73,25 @@ class SeedDMS_ConversionMgr { * @param string $file name of file to convert * @param string $from mimetype of input file * @param string $to mimetype of output file + * @param string $target name of target file. If none is given the + * content of the converted document will be returned. + * @param array $params additional parameter needed for the conversion, + * e.g. the width of an image * * @return boolean true on success, other false */ - public function convert($file, $from, $to, $target=null, $params=array()) { + public function convert($file, $from, $to, $target=null, $params=array()) { /* {{{ */ if(isset($this->services[$from][$to])) { $services = $this->services[$from][$to]; for(end($services); key($services)!==null; prev($services)) { $service = current($services); $text = $service->convert($file, $target, $params); - if($text !== false) + if(!$service->wasSuccessful()) + return false; + if($text) return $text; } } - } + return true; + } /* }}} */ } diff --git a/inc/inc.ClassConversionServiceBase.php b/inc/inc.ClassConversionServiceBase.php index e4b75a474..9ea95812e 100644 --- a/inc/inc.ClassConversionServiceBase.php +++ b/inc/inc.ClassConversionServiceBase.php @@ -36,9 +36,15 @@ abstract class SeedDMS_ConversionServiceBase { */ protected $logger; + /** + * @var $success set to false if conversion failed + */ + protected $success; + public function __construct() { $this->from = null; $this->to = null; + $this->success = true; } public function setLogger($logger) { @@ -53,6 +59,10 @@ abstract class SeedDMS_ConversionServiceBase { return []; } /* }}} */ + public function wasSuccessful() { /* {{{ */ + return $this->success; + } /* }}} */ + /** * This method does the conversion * diff --git a/inc/inc.ClassConversionServiceExec.php b/inc/inc.ClassConversionServiceExec.php index 3931c0fb7..71e530732 100644 --- a/inc/inc.ClassConversionServiceExec.php +++ b/inc/inc.ClassConversionServiceExec.php @@ -91,11 +91,12 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase { } } /* }}} */ - public function __construct($from, $to, $cmd) { + public function __construct($from, $to, $cmd, $timeout=5) { + parent::__construct(); $this->from = $from; $this->to = $to; $this->cmd = $cmd; - $this->timeout = 5; + $this->timeout = ((int) $timeout) ? (int) $timeout : 5; } public function getInfo() { @@ -167,6 +168,7 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase { } catch(Exception $e) { if($hastempfile) unlink($tmpfile); + $this->success = false; return false; } $end = microtime(true); diff --git a/inc/inc.ClassConversionServiceImageToImage.php b/inc/inc.ClassConversionServiceImageToImage.php index b5c9e7951..27905ad10 100644 --- a/inc/inc.ClassConversionServiceImageToImage.php +++ b/inc/inc.ClassConversionServiceImageToImage.php @@ -29,6 +29,7 @@ class SeedDMS_ConversionServiceImageToImage extends SeedDMS_ConversionServiceBas public $timeout; public function __construct($from, $to) { /* {{{ */ + parent::__construct(); $this->from = $from; $this->to = $to; $this->timeout = 5; diff --git a/inc/inc.ClassConversionServiceImageToText.php b/inc/inc.ClassConversionServiceImageToText.php index 326dba28c..76816ea12 100644 --- a/inc/inc.ClassConversionServiceImageToText.php +++ b/inc/inc.ClassConversionServiceImageToText.php @@ -29,6 +29,7 @@ class SeedDMS_ConversionServiceImageToText extends SeedDMS_ConversionServiceBase public $timeout; public function __construct($from, $to) { /* {{{ */ + parent::__construct(); $this->from = $from; $this->to = $to; } /* }}} */ @@ -50,25 +51,24 @@ class SeedDMS_ConversionServiceImageToText extends SeedDMS_ConversionServiceBase public function convert($infile, $target = null, $params = array()) { /* {{{ */ $start = microtime(true); $imsize = getimagesize($infile, $moreinfo); + $txt = ''; if(!empty($moreinfo['APP13'])) { - $txt = ''; $iptcdata = iptcparse($moreinfo['APP13']); foreach(['2#005', '2#015', '2#025', '2#105', '2#080', '2#115', '2#120'] as $key) { if(isset($iptcdata[$key])) $txt .= implode(' ', $iptcdata[$key])."\n"; } - $end = microtime(true); - if($this->logger) { - $this->logger->log('Conversion from '.$this->from.' to '.$this->to.' by extracting iptc took '.($end-$start).' sec.', PEAR_LOG_INFO); - } - if($target) { - file_put_contents($target, $txt); - return true; - } else { - return $txt; - } } - return false; + $end = microtime(true); + if($this->logger) { + $this->logger->log('Conversion from '.$this->from.' to '.$this->to.' by extracting iptc took '.($end-$start).' sec.', PEAR_LOG_INFO); + } + if($target) { + file_put_contents($target, $txt); + return true; + } else { + return $txt; + } } /* }}} */ } diff --git a/inc/inc.ClassConversionServicePdfToImage.php b/inc/inc.ClassConversionServicePdfToImage.php index 7dd3cb5b9..349565232 100644 --- a/inc/inc.ClassConversionServicePdfToImage.php +++ b/inc/inc.ClassConversionServicePdfToImage.php @@ -29,6 +29,7 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase public $timeout; public function __construct($from, $to) { + parent::__construct(); $this->from = $from; $this->to = $to; $this->timeout = 5; @@ -50,8 +51,12 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase $imagick = new Imagick(); /* Setting a smaller resolution will speed up the conversion * A resolution of 72,72 will create a 596x842 image + * Setting it to 36,36 will create a 298x421 image which should + * be sufficient in most cases, but keep in mind that images are + * not scaled up. Hence, a width of 400px still results in a 298px + * wide image */ - $imagick->setResolution(36,36); + $imagick->setResolution(72,72); $page = 0; if(!empty($params['page']) && intval($params['page']) > 0) $page = intval($params['page'])-1; @@ -71,6 +76,7 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase } } } catch (ImagickException $e) { + $this->success = false; return false; } return false; diff --git a/inc/inc.ClassConversionServiceTextToImage.php b/inc/inc.ClassConversionServiceTextToImage.php new file mode 100644 index 000000000..6c526c695 --- /dev/null +++ b/inc/inc.ClassConversionServiceTextToImage.php @@ -0,0 +1,144 @@ + + * @copyright Copyright (C) 2023 Uwe Steinmann + * @version Release: @package_version@ + */ + +require_once("inc/inc.ClassConversionServiceBase.php"); + +/** + * Implementation of conversion service from text to image + * + * @category DMS + * @package SeedDMS + * @author Uwe Steinmann + * @copyright Copyright (C) 2023 Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_ConversionServiceTextToImage extends SeedDMS_ConversionServiceBase { + public function __construct($from, $to) { + parent::__construct(); + $this->from = $from; + $this->to = $to; + } + + public function getInfo() { + return "Convert with imagick php functions"; + } + + public function getAdditionalParams() { /* {{{ */ + return [ + ['name'=>'width', 'type'=>'number', 'description'=>'Width of converted image'], + ['name'=>'page', 'type'=>'number', 'description'=>'Page of text document'], + ]; + } /* }}} */ + + private function wordWrapAnnotation($image, $draw, $text, $maxWidth) { /* {{{ */ + $words = preg_split('%\s%', trim($text), -1, PREG_SPLIT_NO_EMPTY); + $lines = array(); + $i = 0; + $lineHeight = 0; + + while (count($words) > 0) { + $metrics = $image->queryFontMetrics($draw, implode(' ', array_slice($words, 0, ++$i))); + $lineHeight = max($metrics['textHeight'], $lineHeight); + + // check if we have found the word that exceeds the line width + if ($metrics['textWidth'] > $maxWidth or count($words) < $i) { + // handle case where a single word is longer than the allowed line width (just add this as a word on its own line?) + if ($i == 1) + $i++; + + $lines[] = implode(' ', array_slice($words, 0, --$i)); + $words = array_slice($words, $i); + $i = 0; + } + } + + return array($lines, $lineHeight); + } /* }}} */ + + public function convert($infile, $target = null, $params = array()) { /* {{{ */ + $boxWidth = 596; + $boxHeight = 842; + $boxTop = 30; + $boxBottom = 30; + $boxLeft = 30; + $boxRight = 30; + $parSep = 10; + $fontSize = 10; + + $start = microtime(true); + $imagick = new Imagick(); + /* Setting a smaller resolution will speed up the conversion + * A resolution of 72,72 will create a 596x842 image + * Setting it to 36,36 will create a 298x421 image which should + * be sufficient in most cases, but keep in mind that images are + * not scaled up. Hence, a width of 400px still results in a 298px + * wide image + */ + $imagick->setResolution(72,72); + $page = 0; + if(!empty($params['page']) && intval($params['page']) > 0) + $page = intval($params['page'])-1; + try { + if($imagick->newImage($boxWidth, $boxHeight, "white")) { + $draw = new ImagickDraw(); + $draw->setStrokeColor("none"); + $draw->setFont("Courier"); + $draw->setFontSize($fontSize); + $draw->setTextAlignment(Imagick::ALIGN_LEFT); + + $content = file_get_contents($infile); + $lines = preg_split('~\R~',$content); + $boxY = $boxTop; + $pagecount = 0; + foreach($lines as $line) { + if($line) { + $rlines = $this->wordWrapAnnotation($imagick, $draw, $line, $boxWidth-$boxLeft-$boxRight); + foreach($rlines[0] as $rline) { + if($pagecount == $page && $boxY < ($boxHeight-$boxBottom)) { + $imagick->annotateImage($draw, $boxLeft, $boxY, 0, $rline); + } + $boxY = $boxY + $rlines[1]; + } + } else { + $boxY += $parSep; + } + if($boxY >= ($boxHeight-$boxBottom)) { + $pagecount++; + $boxY = $boxTop; + if($pagecount > $page) + break; + } + } + + if(!empty($params['width'])) + $imagick->scaleImage(min((int) $params['width'], $imagick->getImageWidth()), 0); + $imagick->setImageFormat('png'); + $end = microtime(true); + if($this->logger) { + $this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with text service took '.($end-$start).' sec.', PEAR_LOG_INFO); + } + if($target) { + return $imagick->writeImage($target); + } else { + return $imagick->getImageBlob(); + } + } + } catch (ImagickException $e) { + return false; + } + return false; + } /* }}} */ +} + + + diff --git a/inc/inc.ClassConversionServiceTextToText.php b/inc/inc.ClassConversionServiceTextToText.php index 5342c9f4d..ae68c6080 100644 --- a/inc/inc.ClassConversionServiceTextToText.php +++ b/inc/inc.ClassConversionServiceTextToText.php @@ -24,6 +24,7 @@ require_once("inc/inc.ClassConversionServiceBase.php"); */ class SeedDMS_ConversionServiceTextToText extends SeedDMS_ConversionServiceBase { public function __construct($from, $to) { + parent::__construct(); $this->from = $from; $this->to = $to; } diff --git a/inc/inc.ClassDbAuthentication.php b/inc/inc.ClassDbAuthentication.php index 52fd6f96a..2d65e8516 100644 --- a/inc/inc.ClassDbAuthentication.php +++ b/inc/inc.ClassDbAuthentication.php @@ -24,6 +24,15 @@ require_once "inc.ClassAuthentication.php"; */ class SeedDMS_DbAuthentication extends SeedDMS_Authentication { + var $dms; + + var $settings; + + public function __construct($dms, $settings) { /* {{{ */ + $this->dms = $dms; + $this->settings = $settings; + } /* }}} */ + /** * Do Authentication * @@ -32,29 +41,15 @@ class SeedDMS_DbAuthentication extends SeedDMS_Authentication { * @return object|boolean user object if authentication was successful otherwise false */ public function authenticate($username, $password) { /* {{{ */ - $settings = $this->settings; $dms = $this->dms; // Try to find user with given login. if($user = $dms->getUserByLogin($username)) { $userid = $user->getID(); - // Check if password matches (if not a guest user) - // Assume that the password has been sent via HTTP POST. It would be careless - // (and dangerous) for passwords to be sent via GET. + // Check if password matches if (!seed_pass_verify($password, $user->getPwd())) { - /* if counting of login failures is turned on, then increment its value */ - $failures = $user->addLoginFailure(); - if($settings->_loginFailure) { - if($failures >= $settings->_loginFailure) - $user->setDisabled(true); - } - if($settings->_loginDelay) { - if($failures > 1) { - $user->setDisabledUntil(($failures-1)*($failures-1)*3); - } - } - $user = false; + $user = null; } } diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php index 6114ff210..3e42bcbe0 100644 --- a/inc/inc.ClassExtensionMgr.php +++ b/inc/inc.ClassExtensionMgr.php @@ -665,6 +665,7 @@ class SeedDMS_Extension_Mgr { } file_put_contents($this->cachedir."/".self::repos_list_file, $file); } else { + $this->errmsgs[] = 'Could not fetch extension list'; return false; } } diff --git a/inc/inc.ClassFulltextService.php b/inc/inc.ClassFulltextService.php index 33cc46ae7..23309cf6c 100644 --- a/inc/inc.ClassFulltextService.php +++ b/inc/inc.ClassFulltextService.php @@ -7,17 +7,27 @@ * @license GPL 2 * @version @version@ * @author Uwe Steinmann - * @copyright Copyright (C) 2016 Uwe Steinmann + * @copyright Copyright (C) 2021-2023 Uwe Steinmann * @version Release: @package_version@ */ /** * Implementation of fulltext service * + * The fulltext service is wrapper around single services for a full text + * search. Such a service can be based on Solr, SQlite, etc. It implements + * three major methods: + * IndexedDocument() for creating an instance of an indexed document + * Indexer() for creating an instance of the index + * Search() fro creating an instance of a search frontend + * + * Though this class can manage more than one service, it will only + * use the first one. + * * @category DMS * @package SeedDMS * @author Uwe Steinmann - * @copyright Copyright (C) 2016 Uwe Steinmann + * @copyright Copyright (C) 2021-2023 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_FulltextService { @@ -54,6 +64,7 @@ class SeedDMS_FulltextService { $this->services = array(); $this->converters = array(); $this->conversionmgr = null; + $this->previewer = null; $this->logger = null; $this->maxsize = 0; $this->index = null; @@ -93,8 +104,75 @@ class SeedDMS_FulltextService { $this->cmdtimeout = $timeout; } + public function setPreviewer($previewer) { + $this->previewer = $previewer; + } + /** - * Return an indexable document from the given document or folder + * Returns callback function to convert a document into plain text + * + * This variant just uses the conversion manager and does not + * cache the converted document + */ + public function getConversionCallback() { /* {{{ */ + $conversionmgr = $this->conversionmgr; + return function($object) use ($conversionmgr) { + $result = ['content'=>false, 'cmd'=>'', 'errormsg'=>'']; + if(!$conversionmgr) + return $result; + if($object->isType('document')) { + $dms = $object->getDMS(); + $version = $object->getLatestContent(); + $mimetype = $version->getMimeType(); + $path = $dms->contentDir . $version->getPath(); + if(file_exists($path)) { + if($service = $conversionmgr->getService($mimetype, 'text/plain')) { + $content = $conversionmgr->convert($path, $mimetype, 'text/plain'); + if($content) { + $result['content'] = $content; + } elseif($content === false) { + $result['errormsg'] = 'Conversion failed'; + } + $result['cmd'] = get_class($service); + } else { + $result['cmd'] = 'No service to convert '.$mimetype.' to text/plain'; + } + } + } + return $result; + }; + } /* }}} */ + + /** + * Returns callback function to convert a document into plain text + * + * This variant uses the text previewer which + * caches the converted document + */ + public function getConversionWithPreviewCallback() { /* {{{ */ + $previewer = $this->previewer; + return function($object) use ($previewer) { + $result = ['content'=>false, 'cmd'=>'', 'errormsg'=>'']; + if($object->isType('document')) { + $dms = $object->getDMS(); + $version = $object->getLatestContent(); + if($previewer->createPreview($version)) { + if($previewer->hasPreview($version)) { + $filename = $previewer->getFileName($version).'.txt'; + $result['content'] = file_get_contents($filename); + $result['cmd'] = 'previewer '.$previewer->getFileSize($version); + } + } else { + $result['cmd'] = 'previewer'; + $result['errormsg'] = 'Creating preview failed'; + } + } + return $result; + }; + } /* }}} */ + + /** + * Return an indexable document based on the given document or folder * * @param SeedDMS_Core_Document|SeedDMS_Core_Folder $object document or folder * to be indexed @@ -108,13 +186,14 @@ class SeedDMS_FulltextService { $nocontent = $object->getLatestContent()->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate; else $nocontent = true; - return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $this->conversionmgr ? $this->conversionmgr : $this->converters, $nocontent, $this->cmdtimeout); + $convcallback = $this->getConversionWithPreviewCallback(); + return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $convcallback /*$this->conversionmgr ? $this->conversionmgr : $this->converters*/, $nocontent, $this->cmdtimeout); } /** * Returns an instance of the indexer * - * The indexer provides access to fulltext index. It allows to add and + * The indexer provides access to the fulltext index. It allows to add and * get documents. * * @return object instance of class specified in 'Indexer' diff --git a/inc/inc.ClassLdapAuthentication.php b/inc/inc.ClassLdapAuthentication.php index c09115fbe..9c8f4f552 100644 --- a/inc/inc.ClassLdapAuthentication.php +++ b/inc/inc.ClassLdapAuthentication.php @@ -24,6 +24,15 @@ require_once "inc.ClassAuthentication.php"; */ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication { + var $dms; + + var $settings; + + public function __construct($dms, $settings) { /* {{{ */ + $this->dms = $dms; + $this->settings = $settings; + } /* }}} */ + /** * Do ldap authentication * @@ -84,7 +93,7 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication { $bind = @ldap_bind($ds); } $dn = false; - /* If bind succeed, then get the dn of for the user */ + /* If bind succeed, then get the dn of the user */ if ($bind) { if (isset($settings->_ldapFilter) && strlen($settings->_ldapFilter) > 0) { $search = ldap_search($ds, $settings->_ldapBaseDN, "(&(".$ldapSearchAttribut.$username.")".$settings->_ldapFilter.")"); @@ -106,7 +115,7 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication { $dn = $tmpDN; } - /* No do the actual authentication of the user */ + /* Now do the actual authentication of the user */ $bind = @ldap_bind($ds, $dn, $password); $user = $dms->getUserByLogin($username); if($user === false) { @@ -134,17 +143,6 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication { } } } elseif($user) { - $userid = $user->getID(); - $failures = $user->addLoginFailure(); - if($settings->_loginFailure) { - if($failures >= $settings->_loginFailure) - $user->setDisabled(true); - } - if($settings->_loginDelay) { - if($failures > 1) { - $user->setDisabledUntil(($failures-1)*($failures-1)*3); - } - } $user = false; } ldap_close($ds); diff --git a/inc/inc.ConversionInit.php b/inc/inc.ConversionInit.php index a1ccb56e6..4c2c9e64e 100644 --- a/inc/inc.ConversionInit.php +++ b/inc/inc.ConversionInit.php @@ -5,19 +5,19 @@ $conversionmgr = new SeedDMS_ConversionMgr(); if(!empty($settings->_converters['preview'])) { foreach($settings->_converters['preview'] as $mimetype=>$cmd) { - $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'image/png', $cmd))->setLogger($logger); + $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'image/png', $cmd), $settings->_cmdTimeout)->setLogger($logger); } } if(!empty($settings->_converters['pdf'])) { foreach($settings->_converters['pdf'] as $mimetype=>$cmd) { - $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'application/pdf', $cmd))->setLogger($logger); + $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'application/pdf', $cmd, $settings->_cmdTimeout))->setLogger($logger); } } if(!empty($settings->_converters['fulltext'])) { foreach($settings->_converters['fulltext'] as $mimetype=>$cmd) { - $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'text/plain', $cmd))->setLogger($logger); + $conversionmgr->addService(new SeedDMS_ConversionServiceExec($mimetype, 'text/plain', $cmd, $settings->_cmdTimeout))->setLogger($logger); } } @@ -34,6 +34,10 @@ if(extension_loaded('gd') || extension_loaded('imagick')) { $conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/gif', 'image/png'))->setLogger($logger); } +if(extension_loaded('imagick')) { + $conversionmgr->addService(new SeedDMS_ConversionServiceTextToImage('text/plain', 'image/png'))->setLogger($logger); +} + $conversionmgr->addService(new SeedDMS_ConversionServiceImageToText('image/jpeg', 'text/plain'))->setLogger($logger); $conversionmgr->addService(new SeedDMS_ConversionServiceImageToText('image/jpg', 'text/plain'))->setLogger($logger); diff --git a/inc/inc.DBInit.php b/inc/inc.DBInit.php index 8976a6938..a20597db8 100644 --- a/inc/inc.DBInit.php +++ b/inc/inc.DBInit.php @@ -21,7 +21,7 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['initDB'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDB'] as $hookObj) { if (method_exists($hookObj, 'pretInitDB')) { - $hookObj->preInitDB(array('settings'=>$settings)); + $hookObj->preInitDB(array('settings'=>$settings, 'logger'=>$logger)); } } } @@ -32,7 +32,7 @@ $db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostn if(isset($GLOBALS['SEEDDMS_HOOKS']['initDB'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDB'] as $hookObj) { if (method_exists($hookObj, 'postInitDB')) { - $hookObj->postInitDB(array('db'=>$db, 'settings'=>$settings)); + $hookObj->postInitDB(array('db'=>$db, 'settings'=>$settings, 'logger'=>$logger)); } } } @@ -40,7 +40,7 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['initDB'])) { if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { if (method_exists($hookObj, 'pretInitDMS')) { - $hookObj->preInitDMS(array('db'=>$db, 'settings'=>$settings)); + $hookObj->preInitDMS(array('db'=>$db, 'settings'=>$settings, 'logger'=>$logger)); } } } @@ -61,7 +61,7 @@ $dms->setMaxDirID($settings->_maxDirID); if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { if (method_exists($hookObj, 'postInitDMS')) { - $hookObj->postInitDMS(array('dms'=>$dms, 'settings'=>$settings)); + $hookObj->postInitDMS(array('dms'=>$dms, 'settings'=>$settings, 'logger'=>$logger)); } } } @@ -69,3 +69,8 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { require_once('inc/inc.Tasks.php'); require_once("inc.ConversionInit.php"); require_once('inc.FulltextInit.php'); +require_once('inc.AuthenticationInit.php'); +require_once("inc.ClassNotificationService.php"); +require_once("inc.ClassEmailNotify.php"); +require_once('inc.Notification.php'); + diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php index c33c71701..b88500706 100644 --- a/inc/inc.Extension.php +++ b/inc/inc.Extension.php @@ -16,8 +16,6 @@ global $logger; require "inc.ClassExtensionMgr.php"; require_once "inc.ClassSchedulerTaskBase.php"; require_once "inc.ClassExtBase.php"; -require_once "inc.Version.php"; -require_once "inc.Utils.php"; $extMgr = new SeedDMS_Extension_Mgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); diff --git a/inc/inc.FulltextInit.php b/inc/inc.FulltextInit.php index 777d2ca2c..9b0e310fd 100644 --- a/inc/inc.FulltextInit.php +++ b/inc/inc.FulltextInit.php @@ -33,8 +33,10 @@ if($settings->_enableFullSearch) { $indexconf = null; if(isset($GLOBALS['SEEDDMS_HOOKS']['initFulltext'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initFulltext'] as $hookObj) { - if (method_exists($hookObj, 'initFulltextService')) { - $indexconf = $hookObj->initFulltextService(array('engine'=>$settings->_fullSearchEngine, 'dms'=>$dms, 'settings'=>$settings)); + if (method_exists($hookObj, 'isFulltextService') && $hookObj->isFulltextService($settings->_fullSearchEngine)) { + if (method_exists($hookObj, 'initFulltextService')) { + $indexconf = $hookObj->initFulltextService(array('engine'=>$settings->_fullSearchEngine, 'dms'=>$dms, 'settings'=>$settings)); + } } } } @@ -42,9 +44,15 @@ if($settings->_enableFullSearch) { $fulltextservice->addService($settings->_fullSearchEngine, $indexconf); } } + /* setConverters() is deprecated */ $fulltextservice->setConverters(isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null); $fulltextservice->setConversionMgr($conversionmgr); $fulltextservice->setMaxSize($settings->_maxSizeForFullText); $fulltextservice->setCmdTimeout($settings->_cmdTimeout); + require_once("SeedDMS/Preview.php"); + $txtpreviewer = new SeedDMS_Preview_TxtPreviewer($settings->_cacheDir, $settings->_cmdTimeout, $settings->_enableXsendfile); + if($conversionmgr) + $txtpreviewer->setConversionMgr($conversionmgr); + $fulltextservice->setPreviewer($txtpreviewer); } diff --git a/inc/inc.LogInit.php b/inc/inc.LogInit.php index d75101f9e..2cc586873 100644 --- a/inc/inc.LogInit.php +++ b/inc/inc.LogInit.php @@ -19,18 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("Log.php"); +require_once("inc/inc.Utils.php"); -if ($settings->_logFileEnable) { - if ($settings->_logFileRotation=="h") $logname=date("YmdH", time()); - else if ($settings->_logFileRotation=="d") $logname=date("Ymd", time()); - else $logname=date("Ym", time()); +$logger = getLogger(); - if(!file_exists($settings->_contentDir.'log')) - @mkdir($settings->_contentDir.'log'); - if(file_exists($settings->_contentDir.'log') && is_dir($settings->_contentDir.'log')) - $logger = Log::factory('file', $settings->_contentDir.'log/'.$logname.'.log'); - else - $logger = null; -} else { - $logger = null; -} diff --git a/inc/inc.Settings.php b/inc/inc.Settings.php index 83688f255..b19345afb 100644 --- a/inc/inc.Settings.php +++ b/inc/inc.Settings.php @@ -83,3 +83,5 @@ ini_set('include_path', $settings->_rootDir.'../pear'. PATH_SEPARATOR .ini_get(' /* composer is installed in pear directory, but install tool does not need it */ if(!defined("SEEDDMS_INSTALL")) require_once 'vendor/autoload.php'; + +require_once "inc.Version.php"; diff --git a/inc/inc.Tasks.php b/inc/inc.Tasks.php index 9d8868465..50418cbc6 100644 --- a/inc/inc.Tasks.php +++ b/inc/inc.Tasks.php @@ -125,17 +125,33 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ protected $fulltextservice; - public function __construct($scheduler, $fulltextservice, $forceupdate) { /* {{{ */ + protected $logger; + + protected $dacount; + + protected $facount; + + protected $ducount; + + protected $fucount; + + public function __construct($scheduler, $fulltextservice, $forceupdate, $logger) { /* {{{ */ $this->scheduler = $scheduler; $this->fulltextservice = $fulltextservice; + $this->logger = $logger; $this->forceupdate = $forceupdate; $this->numdocs = $this->fulltextservice->Indexer()->count(); + $this->dacount = 0; + $this->facount = 0; + $this->ducount = 0; + $this->fucount = 0; } /* }}} */ public function process($folder, $depth=0) { /* {{{ */ $lucenesearch = $this->fulltextservice->Search(); $documents = $folder->getDocuments(); - echo str_repeat(' ', $depth+1).$folder->getId().":".$folder->getFolderPathPlain()." "; + $logger = $this->logger; +// echo str_repeat(' ', $depth+1).$folder->getId().":".$folder->getFolderPathPlain()." "; if(($this->numdocs == 0) || !($hit = $lucenesearch->getFolder($folder->getId()))) { try { $idoc = $this->fulltextservice->IndexedDocument($folder, true); @@ -149,26 +165,30 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ } } $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_folder_added').")".PHP_EOL; +// echo "(".getMLText('index_folder_added').")".PHP_EOL; + $logger->log('Task \'indexingdocs\': folder '.$folder->getId().' added', PEAR_LOG_INFO); + $this->facount++; } else { - echo "(".$error.")".PHP_EOL; +// echo "(".$error.")".PHP_EOL; + $logger->log('Task \'indexingdocs\': adding folder '.$folder->getId().' failed', PEAR_LOG_ERR); } } catch(Exception $e) { - echo "(Timeout)".PHP_EOL; +// echo "(Timeout)".PHP_EOL; + $logger->log('Task \'indexingdocs\': adding folder '.$folder->getId().' failed', PEAR_LOG_ERR); } } else { - /* Check if the attribute created is set or has a value older + /* Check if the attribute indexed is set or has a value older * than the lastet content. Folders without such an attribute * where added when a new folder was added to the dms. In such * a case the folder content wasn't indexed. */ try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (/* Zend_Search_Lucene_ */Exception $e) { - $created = 0; + $indexed = 0; } - if($created >= $folder->getDate() && !$this->forceupdate) { - echo "(".getMLText('index_folder_unchanged').")".PHP_EOL; + if($indexed >= $folder->getDate() && !$this->forceupdate) { +// echo "(".getMLText('index_folder_unchanged').")".PHP_EOL; } else { $this->fulltextservice->Indexer()->delete($hit->id); try { @@ -183,18 +203,22 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ } } $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_folder_updated').")".PHP_EOL; +// echo "(".getMLText('index_folder_updated').")".PHP_EOL; + $logger->log('Task \'indexingdocs\': folder '.$folder->getId().' updated', PEAR_LOG_INFO); + $this->fucount++; } else { - echo "(".$error.")".PHP_EOL; +// echo "(".$error.")".PHP_EOL; + $logger->log('Task \'indexingdocs\': updating folder '.$folder->getId().' failed', PEAR_LOG_ERR); } } catch(Exception $e) { - echo "(Timeout)".PHP_EOL; +// echo "(Timeout)".PHP_EOL; + $logger->log('Task \'indexingdocs\': updating folder '.$folder->getId().' failed. '.$e->getMessage(), PEAR_LOG_ERR); } } } if($documents) { foreach($documents as $document) { - echo str_repeat(' ', $depth+2).$document->getId().":".$document->getName()." "; +// echo str_repeat(' ', $depth+2).$document->getId().":".$document->getName()." "; /* If the document wasn't indexed before then just add it */ if(($this->numdocs == 0) || !($hit = $lucenesearch->getDocument($document->getId()))) { try { @@ -206,46 +230,67 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ } } } - $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_document_added').")".PHP_EOL; + if($this->fulltextservice->Indexer()->addDocument($idoc)) { +// echo "(".getMLText('index_document_added').")".PHP_EOL; + $logger->log('Task \'indexingdocs\': document '.$document->getId().' added', PEAR_LOG_INFO); + } else { + $logger->log('Task \'indexingdocs\': adding document '.$document->getId().' failed', PEAR_LOG_ERR); + } + $this->dacount++; } catch(Exception $e) { - echo "(Timeout)".PHP_EOL; +// echo "(Timeout)".PHP_EOL; + $logger->log('Task \'indexingdocs\': adding document '.$document->getId().' failed. '.$e->getMessage(), PEAR_LOG_ERR); } } else { - /* Check if the attribute created is set or has a value older + /* Check if the attribute indexed is set or has a value older * than the lastet content. Documents without such an attribute * where added when a new document was added to the dms. In such * a case the document content wasn't indexed. */ try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (/* Zend_Search_Lucene_ */Exception $e) { - $created = 0; + $indexed = 0; } $content = $document->getLatestContent(); - if($created >= $content->getDate() && !$this->forceupdate) { - echo "(".getMLText('index_document_unchanged').")".PHP_EOL; - } else { - $this->fulltextservice->Indexer()->delete($hit->id); - try { - $idoc = $this->fulltextservice->IndexedDocument($document, true); - if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) { - if (method_exists($hookObj, 'preIndexDocument')) { - $hookObj->preIndexDocument(null, $document, $idoc); + if($content) { + if($indexed >= $content->getDate() && !$this->forceupdate) { +// echo "(".getMLText('index_document_unchanged').")".PHP_EOL; + } else { + $this->fulltextservice->Indexer()->delete($hit->id); + try { + $idoc = $this->fulltextservice->IndexedDocument($document, true); + if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) { + if (method_exists($hookObj, 'preIndexDocument')) { + $hookObj->preIndexDocument(null, $document, $idoc); + } } } + if($this->fulltextservice->Indexer()->addDocument($idoc)) { +// echo "(".getMLText('index_document_updated').")".PHP_EOL; + $logger->log('Task \'indexingdocs\': document '.$document->getId().' updated', PEAR_LOG_INFO); + } else { + $logger->log('Task \'indexingdocs\': updating document '.$document->getId().' failed', PEAR_LOG_ERR); + } + $this->ducount++; + } catch(Exception $e) { +// echo "(Timeout)".PHP_EOL; + $logger->log('Task \'indexingdocs\': updating document '.$document->getId().' failed', PEAR_LOG_ERR); } - $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_document_updated').")".PHP_EOL; - } catch(Exception $e) { - echo "(Timeout)".PHP_EOL; } + } else { +// echo "(Missing content)".PHP_EOL; + $logger->log('Task \'indexingdocs\': document '.$document->getId().' misses content', PEAR_LOG_ERR); } } } } } /* }}} */ + + public function statistics() { + return array('folder'=>array('add'=>$this->facount, 'update'=>$this->fucount), 'document'=>array('add'=>$this->dacount, 'update'=>$this->ducount)); + } } /* }}} */ /** @@ -287,9 +332,11 @@ class SeedDMS_IndexingDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ * } } - $folderprocess = new SeedDMS_Task_Indexer_Process_Folder($this, $fulltextservice, $recreate); + $folderprocess = new SeedDMS_Task_Indexer_Process_Folder($this, $fulltextservice, $recreate, $logger); call_user_func(array($folderprocess, 'process'), $folder, -1); $tree = new SeedDMS_FolderTree($folder, array($folderprocess, 'process')); + $stat = $folderprocess->statistics(); + $logger->log('Task \'indexingdocs\': '.$stat['folder']['add'].' folders added, '.$stat['folder']['update'].' folders updated, '.$stat['document']['add'].' documents added, '.$stat['document']['update'].' documents updated', PEAR_LOG_INFO); } else { $logger->log('Task \'indexingdocs\': fulltext search is turned off', PEAR_LOG_WARNING); } diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 4affb3e31..8abbc8c29 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -395,7 +395,7 @@ function getFilenameByDocname($content) { /* {{{ */ return mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $filename); } /* }}} */ -function getLogger($prefix='') { /* {{{ */ +function getLogger($prefix='', $mask=PEAR_LOG_INFO) { /* {{{ */ global $settings; if($settings->_logFileEnable) { @@ -407,7 +407,7 @@ function getLogger($prefix='') { /* {{{ */ @mkdir($settings->_contentDir.'log'); if(file_exists($settings->_contentDir.'log') && is_dir($settings->_contentDir.'log')) { $logger = Log::factory('file', $logname); - $logger->setMask(Log::MAX(PEAR_LOG_DEBUG)); + $logger->setMask(Log::MAX($mask)); } else $logger = null; } else { @@ -1142,7 +1142,7 @@ class SeedDMS_JwtToken { /* {{{ */ class SeedDMS_FolderTree { /* {{{ */ public function __construct($folder, $callback) { /* {{{ */ - $iter = new \SeedDMS\RecursiveFolderIterator($folder); + $iter = new \SeedDMS\Core\RecursiveFolderIterator($folder); $iter2 = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::SELF_FIRST); foreach($iter2 as $ff) { call_user_func($callback, $ff, $iter2->getDepth()); diff --git a/index.php b/index.php index 049d7a48e..af3d42456 100644 --- a/index.php +++ b/index.php @@ -20,12 +20,12 @@ include("inc/inc.Settings.php"); if(true) { - include("inc/inc.LogInit.php"); - include("inc/inc.Utils.php"); - include("inc/inc.Language.php"); - include("inc/inc.Init.php"); - include("inc/inc.Extension.php"); - include("inc/inc.DBInit.php"); + require_once("inc/inc.Utils.php"); + require_once("inc/inc.LogInit.php"); + require_once("inc/inc.Language.php"); + require_once("inc/inc.Init.php"); + require_once("inc/inc.Extension.php"); + require_once("inc/inc.DBInit.php"); require "vendor/autoload.php"; @@ -53,11 +53,19 @@ if(true) { }; }; $app = new \Slim\App($c); + $container = $app->getContainer(); + $container['dms'] = $dms; + $container['config'] = $settings; + $container['conversionmgr'] = $conversionmgr; + $container['logger'] = $logger; + $container['fulltextservice'] = $fulltextservice; + $container['notifier'] = $notifier; + $container['authenticator'] = $authenticator; if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { if (method_exists($hookObj, 'addRoute')) { - $hookObj->addRoute(array('dms'=>$dms, 'app'=>$app, 'settings'=>$settings)); + $hookObj->addRoute(array('dms'=>$dms, 'app'=>$app, 'settings'=>$settings, 'conversionmgr'=>$conversionmgr, 'authenticator'=>$authenticator, 'fulltextservice'=>$fulltextservice, 'logger'=>$logger)); // } else { // include("inc/inc.Authentication.php"); // if (method_exists($hookObj, 'addRouteAfterAuthentication')) { diff --git a/languages/ar_EG/lang.inc b/languages/ar_EG/lang.inc index c5908d269..cd2d4efa8 100644 --- a/languages/ar_EG/lang.inc +++ b/languages/ar_EG/lang.inc @@ -514,6 +514,7 @@ URL: [url]', 'dump_remove' => 'ازالة الملف المستخرج', 'duplicates' => 'تكرارات', 'duplicate_content' => 'المحتوى متكرر', +'duplicate_sequences' => '', 'edit' => 'تعديل', 'edit_attributes' => 'تعديل السمات', 'edit_comment' => 'تعديل تعليق', @@ -620,6 +621,7 @@ URL: [url]', 'extension_mgr_repository' => 'مستودع إدارة الإضافات', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'لائحة الإضافات حسب الإصدار', 'february' => 'فبراير', @@ -753,6 +755,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'فهرسة بلا محتوى', 'index_pending' => 'الفهرسة قيد الإنتظار', +'index_processing' => '', 'index_waiting' => 'الفهرسة قيد الإنتظار', 'individuals' => 'افراد', 'individuals_in_groups' => 'أفراد في المجموعات', @@ -903,6 +906,7 @@ URL: [url]', 'move_clipboard' => 'تحريك القصاصة', 'move_document' => 'تحريك مستند', 'move_folder' => 'تحريك مجلد', +'move_into_rootfolder' => '', 'my_account' => 'حسابي', 'my_documents' => 'مستنداتي', 'my_transmittals' => 'الإحالات الخاصة بي', @@ -1045,6 +1049,7 @@ Parent folder: [folder_path] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - تم تغيير المالك', +'parent_folder' => '', 'password' => 'كلمة السر', 'password_already_used' => 'كلمة السر بالفعل تم ارسالها', 'password_expiration' => 'انتهاء صلاحية كلمة السر', @@ -1082,6 +1087,7 @@ URL: [url]', 'preview' => 'معاينة', 'preview_converters' => 'محول المعاينات', 'preview_images' => 'معاينة الصور', +'preview_images_text' => '', 'preview_markdown' => 'معاينة التخفيضات', 'preview_pdf' => 'معاينة ملف pdf', 'preview_plain' => 'معاينة سطحية', @@ -1094,6 +1100,7 @@ URL: [url]', 'quota_exceeded' => 'لقد قمت بتعدي المساحة المخصصة لك بمقدار [bytes].', 'quota_is_disabled' => 'الغيت الكوتا', 'quota_warning' => 'اقصى مساحة للقرص الصلب تم تعديها بمقدار [bytes]. من فضلك قم بمسح بعض المستندات او اصدارات سابقة منها', +'readme_loading' => '', 'receipts_accepted' => 'تم الموافقة على الوصول', 'receipts_accepted_latest' => '', 'receipts_not_touched' => 'الوصول غير ملموسة', @@ -1779,6 +1786,7 @@ URL: [url]', 'set_password' => 'تحديد كلمة السر', 'set_workflow' => 'تحديد مسار العمل', 'show_extension_changelog' => 'تغيير سجل', +'show_extension_readme' => '', 'show_extension_version_list' => 'لائحة الإصدارات', 'signed_in_as' => 'تسجيل الدخول بإسم', 'sign_in' => 'تسجيل الدخول', @@ -2042,6 +2050,7 @@ URL: [url]', 'update_approvers' => 'تحديثة قائمة الموافقون', 'update_document' => 'تحديث المستند', 'update_fulltext_index' => 'تحديث فهرس النص الكامل', +'update_fulltext_messages' => '', 'update_info' => 'تحديث المعلومات', 'update_locked_msg' => 'هذا المستند محمي من التعديل.', 'update_recipients' => 'تطوير المستلم', diff --git a/languages/bg_BG/lang.inc b/languages/bg_BG/lang.inc index 6d75b0eb8..638bee68a 100644 --- a/languages/bg_BG/lang.inc +++ b/languages/bg_BG/lang.inc @@ -467,6 +467,7 @@ $text = array( 'dump_remove' => 'Изтрий дъмп', 'duplicates' => '', 'duplicate_content' => '', +'duplicate_sequences' => '', 'edit' => 'Редактирай', 'edit_attributes' => 'Редактирай атрибути', 'edit_comment' => 'Редактирай коментар', @@ -569,6 +570,7 @@ $text = array( 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'Февруари', @@ -682,6 +684,7 @@ $text = array( 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '', 'individuals' => 'Личности', 'individuals_in_groups' => '', @@ -832,6 +835,7 @@ $text = array( 'move_clipboard' => '', 'move_document' => 'Премести документ', 'move_folder' => 'Премести папка', +'move_into_rootfolder' => '', 'my_account' => 'Моя акаунт', 'my_documents' => 'Моите документи', 'my_transmittals' => 'Моите предавания', @@ -944,6 +948,7 @@ $text = array( 'ownership_changed_email_body' => '', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '', +'parent_folder' => '', 'password' => 'Парола', 'password_already_used' => 'Вече използвана парола', 'password_expiration' => 'Паролата изтича', @@ -981,6 +986,7 @@ $text = array( 'preview' => 'Преглед', 'preview_converters' => '', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -993,6 +999,7 @@ $text = array( 'quota_exceeded' => 'Вашата дискова квота е превишена с [bytes].', 'quota_is_disabled' => '', 'quota_warning' => 'Вашето max. използуване на диска е превишена с [bytes]. Please remove documents or previous versions.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1642,6 +1649,7 @@ $text = array( 'set_password' => 'Установи парола', 'set_workflow' => 'Установи процес', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Вход като', 'sign_in' => 'вход', @@ -1896,6 +1904,7 @@ $text = array( 'update_approvers' => 'Обнови списъка с утвърждаващи', 'update_document' => 'Обнови документ', 'update_fulltext_index' => 'Обнови пълнотекстовия индекс', +'update_fulltext_messages' => '', 'update_info' => 'Обнови информацията', 'update_locked_msg' => 'Този документ е блокиран', 'update_recipients' => '', diff --git a/languages/ca_ES/lang.inc b/languages/ca_ES/lang.inc index ff1d3e5c6..6dc899353 100644 --- a/languages/ca_ES/lang.inc +++ b/languages/ca_ES/lang.inc @@ -472,6 +472,7 @@ URL: [url]', 'dump_remove' => 'Eliminar fitxer de bolcat', 'duplicates' => '', 'duplicate_content' => '', +'duplicate_sequences' => '', 'edit' => 'editar', 'edit_attributes' => 'Editar atributs', 'edit_comment' => 'Editar comentari', @@ -574,6 +575,7 @@ URL: [url]', 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'Febrer', @@ -687,6 +689,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '', 'individuals' => 'Individuals', 'individuals_in_groups' => '', @@ -837,6 +840,7 @@ URL: [url]', 'move_clipboard' => '', 'move_document' => 'Moure document', 'move_folder' => 'Moure directori', +'move_into_rootfolder' => '', 'my_account' => 'El meu compte', 'my_documents' => 'Els meus documents', 'my_transmittals' => 'Documents enviats per mi', @@ -949,6 +953,7 @@ URL: [url]', 'ownership_changed_email_body' => '', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '', +'parent_folder' => '', 'password' => 'Contrasenya', 'password_already_used' => '', 'password_expiration' => '', @@ -986,6 +991,7 @@ URL: [url]', 'preview' => 'Previsualitzar', 'preview_converters' => '', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -998,6 +1004,7 @@ URL: [url]', 'quota_exceeded' => '', 'quota_is_disabled' => '', 'quota_warning' => '', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1647,6 +1654,7 @@ URL: [url]', 'set_password' => '', 'set_workflow' => '', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Connectat com', 'sign_in' => 'sign in', @@ -1901,6 +1909,7 @@ URL: [url]', 'update_approvers' => 'Actualitzar llista d\'aprovadors', 'update_document' => 'Actualitzar', 'update_fulltext_index' => 'Update fulltext index', +'update_fulltext_messages' => '', 'update_info' => 'Actualitzar informació', 'update_locked_msg' => 'Aquest document està bloquejat.', 'update_recipients' => '', diff --git a/languages/cs_CZ/lang.inc b/languages/cs_CZ/lang.inc index 26cb89c69..5e1c17a38 100644 --- a/languages/cs_CZ/lang.inc +++ b/languages/cs_CZ/lang.inc @@ -538,6 +538,7 @@ URL: [url]', 'dump_remove' => 'Odstranit soubor zálohy', 'duplicates' => 'Duplikáty', 'duplicate_content' => 'Duplicitní obsah', +'duplicate_sequences' => '', 'edit' => 'upravit', 'edit_attributes' => 'Editovat atributy', 'edit_comment' => 'Upravit komentář', @@ -644,6 +645,7 @@ URL: [url]', 'extension_mgr_repository' => 'Dostupný', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Verze', 'february' => 'Únor', @@ -784,6 +786,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Nenaindexoval se obsah', 'index_pending' => 'Probíhá indexování', +'index_processing' => '', 'index_waiting' => 'Čekání', 'individuals' => 'Jednotlivci', 'individuals_in_groups' => 'Členové skupiny', @@ -934,6 +937,7 @@ URL: [url]', 'move_clipboard' => 'Přesun schránky', 'move_document' => 'Přesunout dokument', 'move_folder' => 'Přesun složky', +'move_into_rootfolder' => '', 'my_account' => 'Můj účet', 'my_documents' => 'Moje dokumenty', 'my_transmittals' => 'Moje přenosy', @@ -1076,6 +1080,7 @@ Uživatel: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Vlastník změněn', +'parent_folder' => '', 'password' => 'Heslo', 'password_already_used' => 'Heslo již použité', 'password_expiration' => 'Vypršení platnosti hesla', @@ -1117,6 +1122,7 @@ Pokud budete mít problém s přihlášením i po změně hesla, kontaktujte Adm 'preview' => 'Náhled', 'preview_converters' => 'Náhled převodu dokumentu', 'preview_images' => 'Náhled obrázků', +'preview_images_text' => '', 'preview_markdown' => 'Náhled úpravy textu Markdown', 'preview_pdf' => 'Náhled jako PDF', 'preview_plain' => 'Náhled jako text', @@ -1129,6 +1135,7 @@ Pokud budete mít problém s přihlášením i po změně hesla, kontaktujte Adm 'quota_exceeded' => 'Vaše kvóta disku je překročena o [bytes].', 'quota_is_disabled' => 'Podpora kvót je v současné době zakázána v nastavení. Nastavení uživatelských kvót nebude mít žádný vliv, dokud se znovu neaktivuje.', 'quota_warning' => 'Vaše maximální využití disku je překročeno o [bajtů]. Prosím, odstraňte dokumenty nebo předchozí verze.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] potvrzení přijetí již přijato', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '[no_receipts] potvrzení přijetí nebylo dotčeno', @@ -1851,6 +1858,7 @@ Jméno: [username] 'set_password' => 'Nastavení hesla', 'set_workflow' => 'Nastavit workflow', 'show_extension_changelog' => 'Zobrazit Changelog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Zobrazit seznam verzí', 'signed_in_as' => 'Přihlášen jako', 'sign_in' => 'Přihlásit', @@ -2114,6 +2122,7 @@ URL: [url]', 'update_approvers' => 'Aktualizovat seznam schvalovatelů', 'update_document' => 'Aktualizovat', 'update_fulltext_index' => 'Aktualizovat fulltext index', +'update_fulltext_messages' => '', 'update_info' => 'Aktualizovat informace', 'update_locked_msg' => 'Tento dokument je zamčený.', 'update_recipients' => 'Aktualizovat příjemce', diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 7ad280448..5a6724d31 100644 --- a/languages/de_DE/lang.inc +++ b/languages/de_DE/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 (3143), dgrutsch (22) +// Translators: Admin (3154), dgrutsch (22) $text = array( '2_factor_auth' => '2-Faktor Authentifizierung', @@ -632,13 +632,14 @@ URL: [url]

', 'dropfolder_metadata' => 'Metadaten der zu importierenen Dateien', 'dropupload' => 'Direkt Hochladen', 'drop_files_here' => 'Dateien hier hin ziehen!', -'drop_files_here_or_click' => 'Dateien hier hin ziehen oder Klicken!', +'drop_files_here_or_click' => 'Dateien hier hin ziehen oder Klicken zum Hochladen!', 'dump_creation' => 'DB dump erzeugen', 'dump_creation_warning' => 'Mit dieser Operation können Sie einen Dump der Datenbank erzeugen. Nach der Erstellung wird der Dump im Datenordner Ihres Servers gespeichert.', 'dump_list' => 'Vorhandene DB dumps', 'dump_remove' => 'DB dump löschen', 'duplicates' => 'Duplikate', 'duplicate_content' => 'Doppelte Dateien', +'duplicate_sequences' => 'Doppelte Sequenznummer in einem Ordner', 'edit' => 'Bearbeiten', 'edit_attributes' => 'Attribute bearbeiten', 'edit_comment' => 'Kommentar bearbeiten', @@ -751,6 +752,7 @@ URL: [url]

', 'extension_mgr_repository' => 'Verfügbar', 'extension_mgr_upload_disabled' => 'Der Upload neuer Erweiterungen ist nicht möglich, weil dies in den Einstellungen ausgeschaltet ist.', 'extension_missing_name' => 'Kein Erweiterungsname übergeben', +'extension_readme' => 'Readme', 'extension_toggle_error' => 'Konnte Erweiterung nicht aus/einschalten', 'extension_version_list' => 'Versionen', 'february' => 'Februar', @@ -852,7 +854,7 @@ Old name: [old_name]
Benutzer: [username]
URL: [url]

', 'folder_renamed_email_subject' => '[sitename]: [name] - Ordner umbenannt', -'folder_title' => 'SeedDMS - Ordner: [foldername]', +'folder_title' => 'Ordner: [foldername]', 'foot_note' => '', 'force_update' => 'Aktualisieren', 'friday' => 'Freitag', @@ -927,6 +929,7 @@ URL: [url]

', 'index_folder_updated' => 'Ordner aktualisiert', 'index_no_content' => 'Inhalt nicht indiziert', 'index_pending' => 'Vorgemerkt', +'index_processing' => 'Verarbeite ...', 'index_waiting' => 'Warte', 'individuals' => 'Einzelpersonen', 'individuals_in_groups' => 'Mitglieder einer Gruppe', @@ -1077,6 +1080,7 @@ URL: [url]

', 'move_clipboard' => 'Zwischenablage in Ordner verschieben', 'move_document' => 'Verschieben', 'move_folder' => 'Verschieben', +'move_into_rootfolder' => 'In den Wurzelordner verschieben', 'my_account' => 'Mein Profil', 'my_documents' => 'Meine Dokumente', 'my_transmittals' => 'Meine Dokumentenlisten', @@ -1256,6 +1260,7 @@ Neuer Besitzer: [new_owner]
Benutzer: [username]
URL: [url]

', 'ownership_changed_email_subject' => '[sitename]: [name] - Besitzer geändert', +'parent_folder' => 'Elternordner', 'password' => 'Passwort', 'password_already_used' => 'Passwort schon einmal verwendet', 'password_expiration' => 'Ablauf eines Passworts', @@ -1309,6 +1314,7 @@ Sollen Sie danach immer noch Probleme bei der Anmeldung haben, dann kontaktieren 'preview' => 'Vorschau', 'preview_converters' => 'Vorschau Dokumentenumwandlung', 'preview_images' => 'Vorschaubilder', +'preview_images_text' => 'Vorschaubilder und Textinhalt', 'preview_markdown' => 'Markdown', 'preview_pdf' => 'Vorschau als PDF', 'preview_plain' => 'Text', @@ -1321,6 +1327,7 @@ Sollen Sie danach immer noch Probleme bei der Anmeldung haben, dann kontaktieren 'quota_exceeded' => 'Ihr maximal verfügbarer Plattenplatz wurde um [bytes] überschritten.', 'quota_is_disabled' => 'Quota-Unterstützung ist zur Zeit ausgeschaltet. Benutzer-Quota werden ignoriert bis Quota-Unterstützung in den Einstellungen eingeschaltet wird.', 'quota_warning' => 'Ihr maximal verfügbarer Plattenplatz wurde um [bytes] überschritten. Bitte löschen Sie Dokumente oder ältere Versionen.', +'readme_loading' => 'Bitte warten, bis die Readme geladen ist ...', 'receipts_accepted' => '[no_receipts] Empfangsbestätigungen', 'receipts_accepted_latest' => '(davon [no_receipts] in letzter Version)', 'receipts_not_touched' => '[no_receipts] offene Empfangsbestätigungen', @@ -2183,6 +2190,7 @@ Sollten Sie kein Passwort bekommen haben, dann nutzen Sie bitte die Passwort-Ver 'set_password' => 'Passwort setzen', 'set_workflow' => 'Workflow zuweisen', 'show_extension_changelog' => 'Zeige Versionshistorie', +'show_extension_readme' => 'Readme anzeigen', 'show_extension_version_list' => 'Zeige Liste der Versionen', 'signed_in_as' => 'Angemeldet als', 'sign_in' => 'Anmelden', @@ -2457,6 +2465,7 @@ URL: [url]

', 'update_approvers' => 'Liste der Freigebenden aktualisieren', 'update_document' => 'Aktualisieren', 'update_fulltext_index' => 'Aktualisiere Volltext-Index', +'update_fulltext_messages' => 'Nachrichten', 'update_info' => 'Informationen zur Aktualisierung', 'update_locked_msg' => 'Dieses Dokument wurde gesperrt

Die Sperrung wurde von [username] eingerichtet.
', 'update_recipients' => 'Liste der Empfänger aktualisieren', diff --git a/languages/el_GR/lang.inc b/languages/el_GR/lang.inc index 445841412..6def8ae2b 100644 --- a/languages/el_GR/lang.inc +++ b/languages/el_GR/lang.inc @@ -467,6 +467,7 @@ $text = array( 'dump_remove' => '', 'duplicates' => '', 'duplicate_content' => '', +'duplicate_sequences' => '', 'edit' => 'Επεξεργασία', 'edit_attributes' => '', 'edit_comment' => 'Επεξερασία σχόλιου', @@ -569,6 +570,7 @@ $text = array( 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'Φεβρουάριος', @@ -682,6 +684,7 @@ $text = array( 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => 'Αναμονή', 'individuals' => 'Άτομα', 'individuals_in_groups' => '', @@ -832,6 +835,7 @@ $text = array( 'move_clipboard' => '', 'move_document' => 'Μετακίνηση εγγράφου', 'move_folder' => 'Μετακίνηση φακέλου', +'move_into_rootfolder' => '', 'my_account' => 'Ο Λογαριασμός μου', 'my_documents' => 'Τα έγγραφα μου', 'my_transmittals' => 'Οι Διαβιβάσεις μου', @@ -955,6 +959,7 @@ URL: [url]', 'ownership_changed_email_body' => '', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '', +'parent_folder' => '', 'password' => '', 'password_already_used' => '', 'password_expiration' => '', @@ -992,6 +997,7 @@ URL: [url]', 'preview' => 'προεπισκόπηση', 'preview_converters' => '', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -1004,6 +1010,7 @@ URL: [url]', 'quota_exceeded' => '', 'quota_is_disabled' => '', 'quota_warning' => '', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1653,6 +1660,7 @@ URL: [url]', 'set_password' => '', 'set_workflow' => '', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Σύνδεση σαν', 'sign_in' => 'Σύνδεση', @@ -1907,6 +1915,7 @@ URL: [url]', 'update_approvers' => '', 'update_document' => 'Ενημέρωση εγγράφου', 'update_fulltext_index' => 'Ενημέρωση της Αρίθμησης Κειμένων', +'update_fulltext_messages' => '', 'update_info' => '', 'update_locked_msg' => '', 'update_recipients' => '', diff --git a/languages/en_GB/lang.inc b/languages/en_GB/lang.inc index 7dfdbbb90..e9e6a6162 100644 --- a/languages/en_GB/lang.inc +++ b/languages/en_GB/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 (2238), archonwang (3), dgrutsch (9), netixw (14) +// Translators: Admin (2248), archonwang (3), dgrutsch (9), netixw (14) $text = array( '2_factor_auth' => '2-factor authentication', @@ -632,13 +632,14 @@ URL: [url]

', 'dropfolder_metadata' => 'Metadata of files to be imported', 'dropupload' => 'Fast upload', 'drop_files_here' => 'Drop files here!', -'drop_files_here_or_click' => 'Drop files here or click!', +'drop_files_here_or_click' => 'Drop files here or click to upload!', 'dump_creation' => 'DB dump creation', 'dump_creation_warning' => 'With this operation you can create a dump file of your database content. After the creation the dump file will be saved in the data folder of your server.', 'dump_list' => 'Existings dump files', 'dump_remove' => 'Remove dump file', 'duplicates' => 'Duplicates', 'duplicate_content' => 'Duplicate Content', +'duplicate_sequences' => 'Duplicate sequence numbers in a folder', 'edit' => 'Edit', 'edit_attributes' => 'Edit attributes', 'edit_comment' => 'Edit comment', @@ -751,6 +752,7 @@ URL: [url]

', 'extension_mgr_repository' => 'Available', 'extension_mgr_upload_disabled' => 'Uploading new extensions is not possible because it is disabled in the configuraton.', 'extension_missing_name' => 'No extension name given', +'extension_readme' => 'Readme', 'extension_toggle_error' => 'Could not toggle extension', 'extension_version_list' => 'Versions', 'february' => 'February', @@ -928,6 +930,7 @@ URL: [url]

', 'index_folder_updated' => 'Folder updated', 'index_no_content' => 'Did not index content', 'index_pending' => 'Pending', +'index_processing' => 'Processing ...', 'index_waiting' => 'Waiting', 'individuals' => 'Individuals', 'individuals_in_groups' => 'Members of a group', @@ -1078,6 +1081,7 @@ URL: [url]

', 'move_clipboard' => 'Move clipboard', 'move_document' => 'Move document', 'move_folder' => 'Move Folder', +'move_into_rootfolder' => 'Move into root folder', 'my_account' => 'My Account', 'my_documents' => 'My Documents', 'my_transmittals' => 'My Transmittals', @@ -1259,6 +1263,7 @@ New owner: [new_owner]
User: [username]
URL: [url]

', 'ownership_changed_email_subject' => '[sitename]: [name] - Owner changed', +'parent_folder' => 'Parent folder', 'password' => 'Password', 'password_already_used' => 'Password already used', 'password_expiration' => 'Password expiration', @@ -1312,6 +1317,7 @@ If you still have problems to login, then please contact your administrator.', 'preview' => 'Preview', 'preview_converters' => 'Preview document conversion', 'preview_images' => 'Preview images', +'preview_images_text' => 'Preview images and text content', 'preview_markdown' => 'Markdown', 'preview_pdf' => 'Preview as PDF', 'preview_plain' => 'Text', @@ -1324,6 +1330,7 @@ If you still have problems to login, then please contact your administrator.', 'quota_exceeded' => 'Your disk quota is exceeded by [bytes].', 'quota_is_disabled' => 'Quota support is currently disabled in the settings. Setting a user quota will have no effect until it is enabled again.', 'quota_warning' => 'Your maximum disc usage is exceeded by [bytes]. Please remove documents or previous versions.', +'readme_loading' => 'Pleae wait, until the Readme is loaded ...', 'receipts_accepted' => '[no_receipts] receipts already accepted', 'receipts_accepted_latest' => '(being [no_receipts] in latest version)', 'receipts_not_touched' => '[no_receipts] receipts not being touched', @@ -2186,6 +2193,7 @@ If you did not receive a password, please use the password forgotten function on 'set_password' => 'Set Password', 'set_workflow' => 'Set Workflow', 'show_extension_changelog' => 'Show Changelog', +'show_extension_readme' => 'Show Readme', 'show_extension_version_list' => 'Show list of versions', 'signed_in_as' => 'Signed in as', 'sign_in' => 'Sign in', @@ -2460,6 +2468,7 @@ URL: [url]

', 'update_approvers' => 'Update List of Approvers', 'update_document' => 'Update document', 'update_fulltext_index' => 'Update fulltext index', +'update_fulltext_messages' => 'Messages', 'update_info' => 'Update Information', 'update_locked_msg' => 'This document is locked.', 'update_recipients' => 'Update list of recipients', diff --git a/languages/es_ES/lang.inc b/languages/es_ES/lang.inc index a797e9995..a982be52c 100644 --- a/languages/es_ES/lang.inc +++ b/languages/es_ES/lang.inc @@ -527,6 +527,7 @@ URL: [url]', 'dump_remove' => 'Eliminar fichero de volcado', 'duplicates' => 'Duplicados', 'duplicate_content' => 'Contenido duplicado', +'duplicate_sequences' => '', 'edit' => 'editar', 'edit_attributes' => 'Editar atributos', 'edit_comment' => 'Editar comentario', @@ -633,6 +634,7 @@ URL: [url]', 'extension_mgr_repository' => 'Disponible', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versiones', 'february' => 'Febrero', @@ -772,6 +774,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => 'Esperando', 'individuals' => 'Individuales', 'individuals_in_groups' => 'Miembros del grupo', @@ -922,6 +925,7 @@ URL: [url]', 'move_clipboard' => 'Mover portapaprles', 'move_document' => 'Mover documento', 'move_folder' => 'Mover carpeta', +'move_into_rootfolder' => '', 'my_account' => 'Mi cuenta', 'my_documents' => 'Mis documentos', 'my_transmittals' => 'Mi transmision', @@ -1064,6 +1068,7 @@ Usuario: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Propietario modificado', +'parent_folder' => '', 'password' => 'Contraseña', 'password_already_used' => 'La contraseña ya está en uso', 'password_expiration' => 'Caducidad de la contraseña', @@ -1109,6 +1114,7 @@ Si continua teniendo problemas de acceso, por favor contacte con el administrado 'preview' => 'anterior', 'preview_converters' => 'Vista previa del documento convertido', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -1121,6 +1127,7 @@ Si continua teniendo problemas de acceso, por favor contacte con el administrado 'quota_exceeded' => 'Su cuota de disco se ha excedido en [bytes].', 'quota_is_disabled' => 'La cuota está actualmente deshabilitada en las opciones. Establecer una cuota de usuario no tendrá efecto hasta que sea habilitada de nuevo.', 'quota_warning' => 'El máximo de uso de disco se ha excedido en [bytes]. Por favor eliminar documentos o versiones anteriores.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1806,6 +1813,7 @@ URL: [url]', 'set_password' => 'Establecer contraseña', 'set_workflow' => 'Establecer Flujo de Trabajo', 'show_extension_changelog' => 'Mostrar log de cambios', +'show_extension_readme' => '', 'show_extension_version_list' => 'Lista corta de versiones', 'signed_in_as' => 'Conectado como', 'sign_in' => 'Conectar', @@ -2069,6 +2077,7 @@ URL: [url]', 'update_approvers' => 'Actualizar lista de aprobadores', 'update_document' => 'Actualizar documento', 'update_fulltext_index' => 'Actualizar índice de texto completo', +'update_fulltext_messages' => '', 'update_info' => 'Actualizar información', 'update_locked_msg' => 'Este documento está bloqueado.', 'update_recipients' => 'Actualizaar lista de receptores', diff --git a/languages/fr_FR/lang.inc b/languages/fr_FR/lang.inc index fdd49deb4..cac907550 100644 --- a/languages/fr_FR/lang.inc +++ b/languages/fr_FR/lang.inc @@ -625,6 +625,7 @@ URL : [url]

', 'dump_remove' => 'Supprimer fichier de sauvegarde', 'duplicates' => 'Doublons', 'duplicate_content' => 'Contenu en double', +'duplicate_sequences' => '', 'edit' => 'Modifier', 'edit_attributes' => 'Modifier les attributs', 'edit_comment' => 'Modifier le commentaire', @@ -737,6 +738,7 @@ URL : [url]

', 'extension_mgr_repository' => 'Disponibles', 'extension_mgr_upload_disabled' => 'Le chargement d\'extension n\'est pas activé', 'extension_missing_name' => 'Nom d’extension manquant', +'extension_readme' => '', 'extension_toggle_error' => 'Impossible d’activer/désactiver l’extension', 'extension_version_list' => 'Versions', 'february' => 'Février', @@ -914,6 +916,7 @@ URL : [url]

', 'index_folder_updated' => 'Dossier mis à jour', 'index_no_content' => 'Contenu non indexé', 'index_pending' => 'En attente', +'index_processing' => '', 'index_waiting' => 'Chargement…', 'individuals' => 'Individuels', 'individuals_in_groups' => 'Membres d’un groupe', @@ -1064,6 +1067,7 @@ URL : [url]

', 'move_clipboard' => 'Déplacer le contenu du presse-papier', 'move_document' => 'Déplacer le document', 'move_folder' => 'Déplacer le dossier', +'move_into_rootfolder' => '', 'my_account' => 'Mon compte', 'my_documents' => 'Mes documents', 'my_transmittals' => 'Mes transmissions', @@ -1246,6 +1250,7 @@ Nouveau propriétaire : [new_owner]
Utilisateur : [username]
URL : [url]

', 'ownership_changed_email_subject' => '[sitename] : [name] - Propriétaire modifié', +'parent_folder' => '', 'password' => 'Mot de passe', 'password_already_used' => 'Mot de passe déjà utilisé', 'password_expiration' => 'Expiration du mot de passe', @@ -1297,6 +1302,7 @@ En cas de problème persistant, veuillez contacter votre administrateur.', 'preview' => 'Aperçu', 'preview_converters' => 'Conversion des documents pour prévisualisation', 'preview_images' => 'Miniatures', +'preview_images_text' => '', 'preview_markdown' => 'Prévisualisation', 'preview_pdf' => 'Prévisualisation en PDF', 'preview_plain' => 'Texte', @@ -1309,6 +1315,7 @@ En cas de problème persistant, veuillez contacter votre administrateur.', 'quota_exceeded' => 'Votre quota de disque est dépassé de [bytes].', 'quota_is_disabled' => 'La prise en charge des quotas est actuellement désactivée dans les réglages. Affecter un quota utilisateur n’aura pas d’effet jusqu’à ce qu’il soit de nouveau activé.', 'quota_warning' => 'Votre quota d’espace disque est dépassé de [bytes]. Veuillez supprimer des documents ou d\'anciennes versions.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] réceptions déjà confirmées', 'receipts_accepted_latest' => '(dont [no_receipts] dans la dernière version)', 'receipts_not_touched' => '[no_receipts] réceptions non amorcées', @@ -2169,6 +2176,7 @@ Nom : [username] 'set_password' => 'Définir mot de passe', 'set_workflow' => 'Définir le Workflow', 'show_extension_changelog' => 'Afficher le journal des modifications', +'show_extension_readme' => '', 'show_extension_version_list' => 'Afficher la liste des versions', 'signed_in_as' => 'Connecté en tant que', 'sign_in' => 'Connexion', @@ -2443,6 +2451,7 @@ URL : [url]

', 'update_approvers' => 'Mettre à jour la liste des approbateurs', 'update_document' => 'Mettre à jour', 'update_fulltext_index' => 'Mettre à jour l\'index de recherche plein texte', +'update_fulltext_messages' => '', 'update_info' => 'Informations de mise à jour', 'update_locked_msg' => 'Ce document est verrouillé.', 'update_recipients' => 'Mettre à jour la liste des destinataires', diff --git a/languages/hr_HR/lang.inc b/languages/hr_HR/lang.inc index b780ad153..c9fafeb28 100644 --- a/languages/hr_HR/lang.inc +++ b/languages/hr_HR/lang.inc @@ -19,10 +19,10 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (1249), marbanas (16) +// Translators: Admin (1250), marbanas (16) $text = array( -'2_factor_auth' => '', +'2_factor_auth' => '2-faktorska autentikacija', '2_factor_auth_info' => '', '2_fact_auth_current_secret' => '', '2_fact_auth_new_secret' => '', @@ -526,6 +526,7 @@ Internet poveznica: [url]', 'dump_remove' => 'Ukloni datoteku za odlaganje', 'duplicates' => 'duplikati', 'duplicate_content' => 'Duplicirani sadržaj', +'duplicate_sequences' => '', 'edit' => 'Uredi', 'edit_attributes' => 'Uredi atribute', 'edit_comment' => 'Uredi komentar', @@ -632,6 +633,7 @@ Internet poveznica: [url]', 'extension_mgr_repository' => 'Dostupno', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Inačice', 'february' => 'Veljača', @@ -765,6 +767,7 @@ Internet poveznica: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '', 'individuals' => 'Pojedinci', 'individuals_in_groups' => '', @@ -915,6 +918,7 @@ Internet poveznica: [url]', 'move_clipboard' => 'Premjesti međuspremnik', 'move_document' => 'Premjesti dokument', 'move_folder' => 'Premjesti mapu', +'move_into_rootfolder' => '', 'my_account' => 'Moj korisnički račun', 'my_documents' => 'Moji dokumenti', 'my_transmittals' => 'Moja proslijeđivanja', @@ -1056,6 +1060,7 @@ Korisnik: [username] Internet poveznica: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Promijenjen vlasnik', +'parent_folder' => '', 'password' => 'Lozinka', 'password_already_used' => 'Lozinka se već koristi', 'password_expiration' => 'Istek lozinke', @@ -1101,6 +1106,7 @@ Ako i dalje imate problema s prijavom, molimo kontaktirajte Vašeg administrator 'preview' => 'Predpregled', 'preview_converters' => 'Pretpregled konverzije dokumenta', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => 'Smanjenje', 'preview_pdf' => '', 'preview_plain' => 'Obični tekst', @@ -1113,6 +1119,7 @@ Ako i dalje imate problema s prijavom, molimo kontaktirajte Vašeg administrator 'quota_exceeded' => 'Vaša kvota na disku je premašena za [bytes].', 'quota_is_disabled' => 'Podrška kvoti je trenutno onemogućena u postavkama. Postavka korisničke kvote neće imati utjecaja dok se ponovno ne omogući.', 'quota_warning' => 'Vaš maksimalni prostor na disku je premašen za [bytes]. Molimo uklonite dokumente ili prethodne verzije.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1815,6 +1822,7 @@ Internet poveznica: [url]', 'set_password' => 'Postavi lozinku', 'set_workflow' => 'Postavi tok rada', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Prijavljen kao', 'sign_in' => 'Prijava u sustav', @@ -2078,6 +2086,7 @@ Internet poveznica: [url]', 'update_approvers' => 'Ažuriraj popis validatora', 'update_document' => 'Ažuriraj dokument', 'update_fulltext_index' => 'Ažuriraj indeksiranje cijelog teksta', +'update_fulltext_messages' => '', 'update_info' => 'Info ažuriranje', 'update_locked_msg' => 'Ovaj dokument je zaključan.', 'update_recipients' => 'Izmjena liste primatelja', diff --git a/languages/hu_HU/lang.inc b/languages/hu_HU/lang.inc index 7923e22f7..d4f23f05b 100644 --- a/languages/hu_HU/lang.inc +++ b/languages/hu_HU/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 (648), Kalpy (113), ribaz (1036) +// Translators: Admin (649), Kalpy (113), ribaz (1036) $text = array( '2_factor_auth' => 'Kétfaktoros azonosítás', @@ -521,6 +521,7 @@ URL: [url]', 'dump_remove' => 'Adatbázis mentés eltávolítása', 'duplicates' => '', 'duplicate_content' => 'Duplikált tartalom', +'duplicate_sequences' => '', 'edit' => 'Szerkesztés', 'edit_attributes' => 'Jellemzők szerkesztése', 'edit_comment' => 'Megjegyzés szerkesztése', @@ -627,6 +628,7 @@ URL: [url]', 'extension_mgr_repository' => 'Telepíthető', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Verziók', 'february' => 'Február', @@ -735,7 +737,7 @@ URL: [url]', 'hu_HU' => 'Magyar', 'id' => 'ID', 'identical_version' => 'Az új verzió megegyezik az eredetivel.', -'id_ID' => '', +'id_ID' => 'Indonéz', 'import' => 'Import', 'importfs' => '', 'import_extension' => 'Kiterjesztés import', @@ -760,6 +762,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '', 'individuals' => 'Egyedek', 'individuals_in_groups' => '', @@ -910,6 +913,7 @@ URL: [url]', 'move_clipboard' => 'Vágólapra helyez', 'move_document' => 'Dokumentum áthelyezése', 'move_folder' => 'Könyvtár áthelyezése', +'move_into_rootfolder' => '', 'my_account' => 'Saját hozzáférés', 'my_documents' => 'Saját dokumentumok', 'my_transmittals' => 'Átviteleim', @@ -1052,6 +1056,7 @@ Felhasználó: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Tulajdonos megváltozott', +'parent_folder' => '', 'password' => 'Jelszó', 'password_already_used' => 'Jelszó korábban használva volt', 'password_expiration' => 'Jelszó lejárat', @@ -1097,6 +1102,7 @@ Amennyiben problémákba ütközik a bejelentkezés során, kérjük vegye fel a 'preview' => 'Előnézet', 'preview_converters' => 'A dokumentum átalakításának előnézete', 'preview_images' => 'előnézeti képek', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -1109,6 +1115,7 @@ Amennyiben problémákba ütközik a bejelentkezés során, kérjük vegye fel a 'quota_exceeded' => 'Túllépte a lemezterület korlátot [bytes].', 'quota_is_disabled' => 'Kvóta támogatás jelenleg le van tiltva a beállításoknál. Felhasználói korlát beállítások nem kerülnek érvényesítésre amíg nincs újra engedélyezve.', 'quota_warning' => 'Túllépte lemez korlátot [bytes] bájttal. Kérjük távolítson el dokumentumokat vagy korábbi változatokat.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1793,6 +1800,7 @@ URL: [url]', 'set_password' => 'Jelszó beállítása', 'set_workflow' => 'Munkafolyamat beállítása', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Bejelentkezve mint', 'sign_in' => 'Bejelentkezés', @@ -2056,6 +2064,7 @@ URL: [url]', 'update_approvers' => 'Jóváhagyók listájának frissítése', 'update_document' => 'Dokumentum frissítése', 'update_fulltext_index' => 'Teljes szöveg index frissítése', +'update_fulltext_messages' => '', 'update_info' => 'Információ frissítése', 'update_locked_msg' => 'Ez a dokumentum zárolt.', 'update_recipients' => '', diff --git a/languages/id_ID/lang.inc b/languages/id_ID/lang.inc index de7ad1880..0b1f69d52 100644 --- a/languages/id_ID/lang.inc +++ b/languages/id_ID/lang.inc @@ -565,6 +565,7 @@ URL: [url]

', 'dump_remove' => 'Hapus file sampah', 'duplicates' => 'Duplikasi', 'duplicate_content' => '', +'duplicate_sequences' => '', 'edit' => 'Ubah', 'edit_attributes' => 'Ubah label', 'edit_comment' => 'Ubah komentar', @@ -672,6 +673,7 @@ URL: [url]', 'extension_mgr_repository' => 'Tersedia', 'extension_mgr_upload_disabled' => 'Mengunggah ekstensi baru tidak dimungkinkan karena dinonaktifkan di konfigurasi.', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => 'Tidak dapat mengaktifkan ekstensi', 'extension_version_list' => 'Versi', 'february' => 'Februari', @@ -816,6 +818,7 @@ URL: [url]

', 'index_folder_updated' => 'Folder diperbarui', 'index_no_content' => '', 'index_pending' => 'Ditunda', +'index_processing' => '', 'index_waiting' => 'Mengunggu', 'individuals' => 'Perorangan', 'individuals_in_groups' => '', @@ -966,6 +969,7 @@ URL: [url]

', 'move_clipboard' => 'Pindah clipboard', 'move_document' => 'Pindah dokumen', 'move_folder' => 'Pindah Folder', +'move_into_rootfolder' => '', 'my_account' => 'Akun Saya', 'my_documents' => 'Dokumen Saya', 'my_transmittals' => 'Transmisi Saya', @@ -1129,6 +1133,7 @@ Pemilik baru: [new_owner]
Pengguna: [username]
URL: [url]

', 'ownership_changed_email_subject' => '[sitename]: [name] - Pemilik diterapkan', +'parent_folder' => '', 'password' => 'Kata sandi', 'password_already_used' => 'Kata sandi telah digunakan', 'password_expiration' => 'Kata sandi telah kadaluwarsa', @@ -1182,6 +1187,7 @@ Jika Anda masih mengalami masalah untuk login, silakan hubungi administrator And 'preview' => 'Pratinjau', 'preview_converters' => 'Pratinjau konversi dokumen', 'preview_images' => 'Pratinjau gambar', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => 'Lihat sebagai PDF', 'preview_plain' => 'Text', @@ -1194,6 +1200,7 @@ Jika Anda masih mengalami masalah untuk login, silakan hubungi administrator And 'quota_exceeded' => '', 'quota_is_disabled' => 'Dukungan kuota saat ini dinonaktifkan di pengaturan. Menetapkan kuota pengguna tidak akan berpengaruh hingga diaktifkan kembali.', 'quota_warning' => '', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] kuitansi sudah diterima', 'receipts_accepted_latest' => '(menjadi [no_receipts] dalam versi terbaru)', 'receipts_not_touched' => '', @@ -1867,6 +1874,7 @@ Jika Anda tidak menerima kata sandi, silakan gunakan fitur lupa kata sandi di ha 'set_password' => 'Setel Kata Sandi', 'set_workflow' => 'Setel Alur Kerja', 'show_extension_changelog' => 'Tampilkan Changelog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Tampilkan daftar versi', 'signed_in_as' => 'Masuk sebagai', 'sign_in' => 'Masuk', @@ -2121,6 +2129,7 @@ Jika Anda tidak menerima kata sandi, silakan gunakan fitur lupa kata sandi di ha 'update_approvers' => 'Perbarui Daftar Penyetuju', 'update_document' => 'Perbarui dokumen', 'update_fulltext_index' => 'Perbarui indek fulltext', +'update_fulltext_messages' => '', 'update_info' => 'Perbarui Informasi', 'update_locked_msg' => 'Dokumen ini terkunci.', 'update_recipients' => 'Perbarui daftar penerima', diff --git a/languages/it_IT/lang.inc b/languages/it_IT/lang.inc index 271c9fa0c..b329f50c7 100644 --- a/languages/it_IT/lang.inc +++ b/languages/it_IT/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 (2057), rickr (144), s.pnt (26) +// Translators: Admin (2058), rickr (144), s.pnt (26) $text = array( '2_factor_auth' => 'Autorizzazione a due fattori', @@ -531,6 +531,7 @@ URL: [url]', 'dump_remove' => 'Cancella il file di dump', 'duplicates' => 'Duplicati', 'duplicate_content' => 'Contenuto duplicato', +'duplicate_sequences' => '', 'edit' => 'Modifica', 'edit_attributes' => 'Modifica gli attributi', 'edit_comment' => 'Modifica il commento', @@ -637,6 +638,7 @@ URL: [url]', 'extension_mgr_repository' => 'Disponibile', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versioni', 'february' => 'Febbraio', @@ -770,6 +772,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Non indicizzare contenuti', 'index_pending' => 'Indicizzazione pendente', +'index_processing' => '', 'index_waiting' => 'Attendi', 'individuals' => 'Singoli', 'individuals_in_groups' => 'I membri de la gruppo', @@ -920,6 +923,7 @@ URL: [url]', 'move_clipboard' => 'Sposta appunti', 'move_document' => 'Sposta documento', 'move_folder' => 'Sposta cartella', +'move_into_rootfolder' => '', 'my_account' => 'Account personale', 'my_documents' => 'Documenti personali', 'my_transmittals' => 'Mie trasmissioni', @@ -1062,6 +1066,7 @@ Utente: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Cambio di proprietario', +'parent_folder' => '', 'password' => 'Password', 'password_already_used' => 'Password già usata', 'password_expiration' => 'Scadenza password', @@ -1107,6 +1112,7 @@ Dovessero esserci ancora problemi al login, prego contatta l\'amministratore di 'preview' => 'Anteprima', 'preview_converters' => 'Anteprima convesione documento', 'preview_images' => 'Immagini di anteprima', +'preview_images_text' => '', 'preview_markdown' => 'Riduzione ribasso', 'preview_pdf' => 'Anteprima come PDF', 'preview_plain' => 'Testo', @@ -1119,6 +1125,7 @@ Dovessero esserci ancora problemi al login, prego contatta l\'amministratore di 'quota_exceeded' => 'La quota-disco è stata superata di [bytes].', 'quota_is_disabled' => 'Il supporto per le quote è attualmente disattivato nelle impostazioni. L\'impostazione di una quota-utente non avrà alcun effetto finché tale funzionalità non verrà nuovamente attivata.', 'quota_warning' => 'Il vostro utilizzo massimo di spazio è stato superato di [bytes]. Si prega di rimuovere documenti o versioni obsolete.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] ricevute già accettate', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '[no_receipts] ricevute non gestite', @@ -1360,7 +1367,7 @@ URL: [url]', 'search' => 'Ricerca', 'search_fulltext' => 'Ricerca fulltext', 'search_in' => 'Cerca in', -'search_mode' => '', +'search_mode' => 'Modalità di ricerca', 'search_mode_and' => 'tutte le parole', 'search_mode_documents' => 'Solo documenti', 'search_mode_folders' => 'Solo cartelle', @@ -1842,6 +1849,7 @@ Name: [username] 'set_password' => 'Imposta password', 'set_workflow' => 'Imposta il flusso di lavoro', 'show_extension_changelog' => 'Registro delle modifiche dell\'estensione', +'show_extension_readme' => '', 'show_extension_version_list' => 'Mostra lista delle versioni', 'signed_in_as' => 'Utente', 'sign_in' => 'Accesso', @@ -2105,6 +2113,7 @@ URL: [url]', 'update_approvers' => 'Aggiornamento lista approvatori', 'update_document' => 'Aggiorna documento', 'update_fulltext_index' => 'Aggiorna indice fulltext', +'update_fulltext_messages' => '', 'update_info' => 'Aggiorna informazioni', 'update_locked_msg' => 'Questo documento è bloccato.', 'update_recipients' => 'Aggiorna lista cartelle', diff --git a/languages/ko_KR/lang.inc b/languages/ko_KR/lang.inc index de8f2db0b..125527d64 100644 --- a/languages/ko_KR/lang.inc +++ b/languages/ko_KR/lang.inc @@ -527,6 +527,7 @@ URL: [url]', 'dump_remove' => '덤프 파일 제거', 'duplicates' => '', 'duplicate_content' => '중복 내용', +'duplicate_sequences' => '', 'edit' => '편집', 'edit_attributes' => '속성 편집', 'edit_comment' => '주석 고치기', @@ -633,6 +634,7 @@ URL: [url]', 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => '2월', @@ -766,6 +768,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '기다리는 중', 'individuals' => '개인', 'individuals_in_groups' => '개별 그룹', @@ -916,6 +919,7 @@ URL: [url]', 'move_clipboard' => '이동 클립 보드', 'move_document' => '문서 옮기기', 'move_folder' => '폴더 이동', +'move_into_rootfolder' => '', 'my_account' => '내 계정', 'my_documents' => '내 문서', 'my_transmittals' => '내 송부', @@ -1058,6 +1062,7 @@ URL : [url]', URL : [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename] : [name] - 소유자 변경', +'parent_folder' => '', 'password' => '암호', 'password_already_used' => '예전에 쓰인 암호', 'password_expiration' => '암호 만료', @@ -1095,6 +1100,7 @@ URL : [url]', 'preview' => '미리보기', 'preview_converters' => '문서 변환 미리보기', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '마크다운', 'preview_pdf' => '', 'preview_plain' => '텍스트', @@ -1107,6 +1113,7 @@ URL : [url]', 'quota_exceeded' => '당신은 디스크 할당량 [bytes]을 초과한다.', 'quota_is_disabled' => '할당량 지원이 설정에서 비활성화되어 있습니다. 다시 활성화 될 때까지 사용자의 할당량 설정은 적용되지 않습니다.', 'quota_warning' => '당신의 최대 디스크 사용량 [bytes] 초과됩니다. 문서 또는 이전 버전을 제거하십시오.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1809,6 +1816,7 @@ URL : [url]', 'set_password' => '비밀번호 설정', 'set_workflow' => '워크플로우 설정', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => '로그인', 'sign_in' => '로그인', @@ -2072,6 +2080,7 @@ URL : [url]', 'update_approvers' => '승인자의 업데이트 목록', 'update_document' => '문서 갱신하기', 'update_fulltext_index' => '업데이트 전체 텍스트 색인', +'update_fulltext_messages' => '', 'update_info' => '업데이트 정보', 'update_locked_msg' => '이 문서는 잠겨 있습니다.', 'update_recipients' => '받는 사람 업데이트 목록', diff --git a/languages/lo_LA/lang.inc b/languages/lo_LA/lang.inc index f21751132..d8edb5a13 100644 --- a/languages/lo_LA/lang.inc +++ b/languages/lo_LA/lang.inc @@ -524,6 +524,7 @@ URL: [url]', 'dump_remove' => 'ລົບແຟ້ມການຖ່າຍໂອນຂໍ້ມູນ', 'duplicates' => 'ລາຍການທີຊໍ້າກັນ', 'duplicate_content' => 'ເນື້ອຫາທີ່ຊໍ້າກັນ', +'duplicate_sequences' => '', 'edit' => 'ແກ້ໄຂ', 'edit_attributes' => 'ແກ້ໄຂແອັດທີບິວ', 'edit_comment' => 'ແກ້ໄຂຄວາມຄິດເຫັນ', @@ -630,6 +631,7 @@ URL: [url]', 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'ເດືອນ ກຸມພາ', @@ -763,6 +765,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => 'ລໍຖ້າດຳເນີນການ', +'index_processing' => '', 'index_waiting' => 'ຖ້າ', 'individuals' => 'ບຸກຄົນ', 'individuals_in_groups' => 'ສະມາຊິກຂອງກຸ່ມ', @@ -913,6 +916,7 @@ URL: [url]', 'move_clipboard' => 'ຍ້າຍຄິບບອດ', 'move_document' => 'ຍ້າຍເອກະສານ', 'move_folder' => 'ຍ້າຍໂຟລເດີ', +'move_into_rootfolder' => '', 'my_account' => 'ບັນຊີຂອງຂ້ອຍ', 'my_documents' => 'ເອກະສານຂອງຂ້ອຍ', 'my_transmittals' => 'ການຂົນສົ່ງຂອງຂ້ອຍ', @@ -1055,6 +1059,7 @@ URL: [url]', URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]:[name] - ປ່ຽນເຈົ້າຂອງແລ້ວ', +'parent_folder' => '', 'password' => 'ລະຫັດຜ່ານ', 'password_already_used' => 'ລະຫັດຜ່ານທີນຳໄຊ້ແລ້ວ', 'password_expiration' => 'ລະຫັດຜ່ານໝົດອາຍຸ', @@ -1100,6 +1105,7 @@ URL: [url]', 'preview' => 'ເບີ່ງຕົວຢ່າງ', 'preview_converters' => 'ເບີ່ງຕົວຢ່າງການແປງເອກະສານ', 'preview_images' => 'ເບີ່ງຮູບຕົງຢ່າງ', +'preview_images_text' => '', 'preview_markdown' => 'ເຮັດເຄື່ອງຫມາຍລົງ', 'preview_pdf' => '', 'preview_plain' => 'ຂໍ້ຄວາມ', @@ -1112,6 +1118,7 @@ URL: [url]', 'quota_exceeded' => 'ໂຄຕ້າດິສຂອງເຈົ້າມີຂະໜາດເກີນ [ໄບ]', 'quota_is_disabled' => 'ຂະນະນີ້ການສະນັບສະໜູນໂຄຕ້າຖືກປິດໄຊ້ງານໃນການຕັ້ງຄ່າແລ້ວການກຳນົດໂຄຕ້າຜູ້ໄຊ້ຈະບໍ່ມີຜົນໄດໆ ຈົນກວ່າຈະເປີດໄຊ້ງານອີກຄັ້ງ', 'quota_warning' => 'ການໄຊ້ດິສສູງສຸດຂອງເຈົ້າເກີນ [ໄບຣ] ໂປດລົບເອກະສານຫຼືເວີຊັນກ່ອນໜ້າ', +'readme_loading' => '', 'receipts_accepted' => 'ໃບບິນຮັບເງີນໄດ້ຮັບການຍອມຮັບແລ້ວ [ບໍມີໃບບິນຮັບເງິນ]', 'receipts_accepted_latest' => '', 'receipts_not_touched' => 'ບໍ່ມີໃບບິນຮັບເງິນ', @@ -1835,6 +1842,7 @@ URL: [url]', 'set_password' => 'ຕັ້ງລະຫັດຜ່ານ', 'set_workflow' => 'ຕັ້ງຄ່າການທຳງານ', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'ລົງຊື່ເຂົາໄຊ້ໂດຍ', 'sign_in' => 'ລົງຊື່ເຂົາໄຊ້', @@ -2098,6 +2106,7 @@ URL: [url]', 'update_approvers' => 'ອັບເດດລາຍຊື່ຜູ້ອະນຸມັດ', 'update_document' => 'ອັບເດດເອກະສານ', 'update_fulltext_index' => 'ອັບເດດດັດຊະນີຂໍ້ຄວາມແບບເຕັມຮູບແບບ', +'update_fulltext_messages' => '', 'update_info' => 'ອັບເດດຂໍ້ມູນ', 'update_locked_msg' => 'ເອກະສານນີ້ຖືກລັອກ', 'update_recipients' => 'ອັບເດລາຍຊື່ຜູ້ຮັບ', diff --git a/languages/nb_NO/lang.inc b/languages/nb_NO/lang.inc index 484c2da5b..621c36a29 100644 --- a/languages/nb_NO/lang.inc +++ b/languages/nb_NO/lang.inc @@ -538,6 +538,7 @@ URL: [url]', 'dump_remove' => 'Ta bort dumpfil', 'duplicates' => 'Duplikater', 'duplicate_content' => 'Dubliser innehold', +'duplicate_sequences' => '', 'edit' => 'Rediger', 'edit_attributes' => 'Rediger egenskaper', 'edit_comment' => 'Rediger kommentar', @@ -644,6 +645,7 @@ URL: [url]', 'extension_mgr_repository' => 'Tilgjengelig', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versjon', 'february' => 'Februar', @@ -784,6 +786,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Indekserte ikke innhold', 'index_pending' => 'Avventer', +'index_processing' => '', 'index_waiting' => 'Venter', 'individuals' => 'Personer', 'individuals_in_groups' => 'Medlemmer i en gruppe', @@ -934,6 +937,7 @@ URL: [url]', 'move_clipboard' => 'Flytt utklippstavlen', 'move_document' => 'Flytte dokument', 'move_folder' => 'Flytte mappe', +'move_into_rootfolder' => '', 'my_account' => 'Min side', 'my_documents' => 'Mine dokumenter', 'my_transmittals' => 'Mine sendinger', @@ -1076,6 +1080,7 @@ Bruker: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Eier endret', +'parent_folder' => '', 'password' => 'Passord', 'password_already_used' => 'Passord allerede brukt', 'password_expiration' => 'Passord utgått', @@ -1115,6 +1120,7 @@ Om du fortsatt har problemer med innloggingen, kontakt admin.', 'preview' => 'Forhåndsvisning', 'preview_converters' => 'Forhåndsvis dokumentkonvertering', 'preview_images' => 'Forhåndsvis bilder', +'preview_images_text' => '', 'preview_markdown' => 'Forminsking', 'preview_pdf' => 'Forhåndsvis som PDF', 'preview_plain' => 'Tekst', @@ -1127,6 +1133,7 @@ Om du fortsatt har problemer med innloggingen, kontakt admin.', 'quota_exceeded' => 'Diskkvoten din er overskridet med [bytes].', 'quota_is_disabled' => 'Kvotestøtte er for øyeblikket deaktivert i innstillingene. Å sette en brukerkvote vil ikke ha noen effekt før den er aktivert igjen.', 'quota_warning' => 'Din maksimale lagringskvote er overskredet med [bytes]. Ta bort dokumenter eller tidigere versjoner.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] kvitteringer allerede akseptert', 'receipts_accepted_latest' => '(er [no_receipts] i siste versjon)', 'receipts_not_touched' => '[no_receipts] kvitteringer ikke blir berørt', @@ -1848,6 +1855,7 @@ Bruker: [username] 'set_password' => 'Angi passord', 'set_workflow' => 'Velg arbeidsflyt', 'show_extension_changelog' => 'Vis forandrings logg', +'show_extension_readme' => '', 'show_extension_version_list' => 'Vis liste over versjoner', 'signed_in_as' => 'Innlogget som', 'sign_in' => 'Logg inn', @@ -2111,6 +2119,7 @@ URL: [url]', 'update_approvers' => 'Oppdater liste over godkjennere', 'update_document' => 'Oppdater dokumentet', 'update_fulltext_index' => 'Oppdater fulltekstindeksen', +'update_fulltext_messages' => '', 'update_info' => 'Oppdater informasjon', 'update_locked_msg' => 'Dette dokumentet er låst.', 'update_recipients' => 'Oppdater liste over mottakere', diff --git a/languages/nl_NL/lang.inc b/languages/nl_NL/lang.inc index 7fdd9db6c..c5420ad25 100644 --- a/languages/nl_NL/lang.inc +++ b/languages/nl_NL/lang.inc @@ -531,6 +531,7 @@ URL: [url]', 'dump_remove' => 'Verwijder dump bestand', 'duplicates' => 'Doublures', 'duplicate_content' => 'Dubbele inhoud', +'duplicate_sequences' => '', 'edit' => 'Wijzigen', 'edit_attributes' => 'Bewerk attributen', 'edit_comment' => 'Wijzig commentaar', @@ -637,6 +638,7 @@ URL: [url]', 'extension_mgr_repository' => 'Beschikbaar', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => 'Naam extensie ontbreekt', +'extension_readme' => '', 'extension_toggle_error' => 'Omschakelen mislukt', 'extension_version_list' => 'Versies', 'february' => 'februari', @@ -777,6 +779,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Index heeft geen inhoud', 'index_pending' => 'Indexering moet nog gebeuren', +'index_processing' => '', 'index_waiting' => 'Indexering wacht', 'individuals' => 'Individuen', 'individuals_in_groups' => 'Individuen in groepen', @@ -927,6 +930,7 @@ URL: [url]', 'move_clipboard' => 'Verplaats klembord', 'move_document' => 'Verplaats document', 'move_folder' => 'Map verplaatsen', +'move_into_rootfolder' => '', 'my_account' => 'Mijn Account', 'my_documents' => 'Mijn Documenten', 'my_transmittals' => 'Mijn zendingen', @@ -1068,6 +1072,7 @@ Gebruiker: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Eigenaar gewijzigd', +'parent_folder' => '', 'password' => 'Wachtwoord', 'password_already_used' => 'Wachtwoord al gebruikt', 'password_expiration' => 'Wachtwoord vervaldatum', @@ -1114,6 +1119,7 @@ Mocht u de komende minuten geen email ontvangen, probeer het dan nogmaals en con 'preview' => 'Voorbeeld', 'preview_converters' => 'Converters', 'preview_images' => 'Voorbeelden', +'preview_images_text' => '', 'preview_markdown' => 'Voorbeeld in Markdown', 'preview_pdf' => 'Inhoud van het document', 'preview_plain' => 'Voorbeeld in platte tekst', @@ -1126,6 +1132,7 @@ Mocht u de komende minuten geen email ontvangen, probeer het dan nogmaals en con 'quota_exceeded' => 'Uw data quotum is overschreden met [bytes].', 'quota_is_disabled' => 'Quota support is momenteel niet actief in de eigenschappen. Een user-quotum instellen zal geen effect hebben tot quota actief zijn', 'quota_warning' => 'Uw maximale datagebruik is overschreden met [bytes]. Gelieve documenten of eerdere versies te verwijderen.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] ontvangen en geaccepteerd', 'receipts_accepted_latest' => '(er zijn [no_receipts] in de nieuwste versie)', 'receipts_not_touched' => '[no_receipts] ontvangen, nog niet behandeld', @@ -1847,6 +1854,7 @@ Name: [username] 'set_password' => 'Stel wachtwoord in', 'set_workflow' => 'Stel workflow in', 'show_extension_changelog' => 'Toon wijzigingslog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Toon lijst met versies', 'signed_in_as' => 'Ingelogd als:', 'sign_in' => 'Log in', @@ -2110,6 +2118,7 @@ URL: [url]', 'update_approvers' => 'Bijwerken lijst van [Goedkeurders]', 'update_document' => 'Bijwerken', 'update_fulltext_index' => 'Index voor fulltext search bijwerken', +'update_fulltext_messages' => '', 'update_info' => 'Update-informatie', 'update_locked_msg' => 'Dit document is geblokkeerd.', 'update_recipients' => 'Update de lijst vanontvangers', diff --git a/languages/pl_PL/lang.inc b/languages/pl_PL/lang.inc index a638d4d2a..53770f872 100644 --- a/languages/pl_PL/lang.inc +++ b/languages/pl_PL/lang.inc @@ -514,6 +514,7 @@ URL: [url]', 'dump_remove' => 'Usuń plik zrzutu', 'duplicates' => 'Duplikaty', 'duplicate_content' => 'Zduplikowana zawartość', +'duplicate_sequences' => '', 'edit' => 'Edytuj', 'edit_attributes' => 'Zmiana atrybutów', 'edit_comment' => 'Edytuj komentarz', @@ -620,6 +621,7 @@ URL: [url]', 'extension_mgr_repository' => 'Dostępne', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Wersje', 'february' => 'Luty', @@ -753,6 +755,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Nie indeksuje zawartości', 'index_pending' => 'Oczekujące', +'index_processing' => '', 'index_waiting' => 'Oczekiwanie', 'individuals' => 'Indywidualni', 'individuals_in_groups' => 'Członkowie grupy', @@ -903,6 +906,7 @@ URL: [url]', 'move_clipboard' => 'Przenieś schowek', 'move_document' => 'Przenieś dokument', 'move_folder' => 'Przenieś folder', +'move_into_rootfolder' => '', 'my_account' => 'Moje konto', 'my_documents' => 'Moje dokumenty', 'my_transmittals' => 'Moi recenzenci', @@ -1045,6 +1049,7 @@ Użytkownik: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Zmiana właściciela', +'parent_folder' => '', 'password' => 'Hasło', 'password_already_used' => 'Hasło jest aktualnie używane', 'password_expiration' => 'Wygaśnięcie hasła', @@ -1090,6 +1095,7 @@ Jeśli nadal będą problemy z zalogowaniem, prosimy o kontakt z administratorem 'preview' => 'Podgląd', 'preview_converters' => 'Podgląd konwersji dokumentu', 'preview_images' => 'Podgląd obrazu', +'preview_images_text' => '', 'preview_markdown' => 'Oznacz w dół', 'preview_pdf' => 'Podgląd PDF', 'preview_plain' => 'Zwykły podgląd', @@ -1102,6 +1108,7 @@ Jeśli nadal będą problemy z zalogowaniem, prosimy o kontakt z administratorem 'quota_exceeded' => 'Twój limit przydzielonej przestrzeni dyskowej został przekroczony o [bytes].', 'quota_is_disabled' => 'Wsparcie limitów dyskowych jest obecnie wyłączone w ustawieniach. Ustawiony limit dyskowy użytkownika nie będzie działał dopóki wparcie nie zostanie ponownie włączone.', 'quota_warning' => 'Przekroczono użycie dysku o [bytes]. Usuń dokumenty lub poprzednie wersje.', +'readme_loading' => '', 'receipts_accepted' => 'Potwierdzenia zaakceptowane', 'receipts_accepted_latest' => '(istnieje [no_receipts] w ostatniej wersji)', 'receipts_not_touched' => 'Potwierdzenia nieoglądane', @@ -1778,6 +1785,7 @@ Name: [username] 'set_password' => 'Zmień hasło', 'set_workflow' => 'Ustaw proces', 'show_extension_changelog' => 'Pokaż Changelog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Pokaż listę wersji', 'signed_in_as' => 'Zalogowany jako', 'sign_in' => 'Zaloguj się', @@ -2041,6 +2049,7 @@ URL: [url]', 'update_approvers' => 'Aktualizuj listę osób zatwierdzających', 'update_document' => 'Aktualizuj dokument', 'update_fulltext_index' => 'Aktualizuj indeks pełnotekstowy', +'update_fulltext_messages' => '', 'update_info' => 'Aktualizuj informacje', 'update_locked_msg' => 'Ten dokument jest zablokowany.', 'update_recipients' => 'Zaktualizuj listę odbiorców', diff --git a/languages/pt_BR/lang.inc b/languages/pt_BR/lang.inc index 57d7c0229..4d6f0ff28 100644 --- a/languages/pt_BR/lang.inc +++ b/languages/pt_BR/lang.inc @@ -538,6 +538,7 @@ URL: [url]', 'dump_remove' => 'Remover arquivo de despejo', 'duplicates' => 'Duplicados', 'duplicate_content' => 'Conteúdo duplicado', +'duplicate_sequences' => '', 'edit' => 'editar', 'edit_attributes' => 'Editar atributos', 'edit_comment' => 'Editar comentário', @@ -644,6 +645,7 @@ URL: [url]', 'extension_mgr_repository' => 'Disponível', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versões', 'february' => 'Fevereiro', @@ -784,6 +786,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Não indexou o conteúdo', 'index_pending' => 'Pendente', +'index_processing' => '', 'index_waiting' => 'Aguarde...', 'individuals' => 'Indivíduos', 'individuals_in_groups' => 'Members of a group', @@ -934,6 +937,7 @@ URL: [url]', 'move_clipboard' => 'Mover para memória auxiliar', 'move_document' => 'Mover documento', 'move_folder' => 'Mover Pasta', +'move_into_rootfolder' => '', 'my_account' => 'Minha Conta', 'my_documents' => 'Meus Documentos', 'my_transmittals' => 'Minhas Transmissões', @@ -1075,6 +1079,7 @@ Usuário: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Proprietário mudou', +'parent_folder' => '', 'password' => 'Senha', 'password_already_used' => 'Senha já usada', 'password_expiration' => 'Expiração de senha', @@ -1120,6 +1125,7 @@ Se você ainda tiver problemas para fazer o login, por favor, contate o administ 'preview' => 'visualizar', 'preview_converters' => 'Visualizar a conversão do documento', 'preview_images' => 'Imagens de pré-visualização', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => 'Visualizar como PDF', 'preview_plain' => 'Texto', @@ -1132,6 +1138,7 @@ Se você ainda tiver problemas para fazer o login, por favor, contate o administ 'quota_exceeded' => 'Sua cota de disco foi ultrapassada em [bytes].', 'quota_is_disabled' => 'Suporte a cota está desativado nas configurações. A definição de cota do usuário não terá efeito até que seja habilitada novamente.', 'quota_warning' => 'Seu uso máximo do disco foi ultrapassado em [bytes]. Por favor, remova documentos ou versões anteriores.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] recibos já aceitos', 'receipts_accepted_latest' => 'recibos aceites mais recentes', 'receipts_not_touched' => '[no_receipts] recibos não tocados', @@ -1854,6 +1861,7 @@ Nome: [username] 'set_password' => 'Definir Senha', 'set_workflow' => 'Definir fluxo de trabalho', 'show_extension_changelog' => 'Mostrar Changelog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Exibir Lista de Versões', 'signed_in_as' => 'Logado', 'sign_in' => 'Entre com seu usuário e senha', @@ -2117,6 +2125,7 @@ URL: [url]', 'update_approvers' => 'Atualizar lista de aprovadores', 'update_document' => 'Atualizar', 'update_fulltext_index' => 'Índice de atualização de texto completo', +'update_fulltext_messages' => '', 'update_info' => 'Atualizar informação', 'update_locked_msg' => 'Este documento está travado.', 'update_recipients' => 'Atualizar lista de destinatários', diff --git a/languages/ro_RO/lang.inc b/languages/ro_RO/lang.inc index 59c95cbe7..95c207800 100644 --- a/languages/ro_RO/lang.inc +++ b/languages/ro_RO/lang.inc @@ -526,6 +526,7 @@ URL: [url]', 'dump_remove' => 'Sterge fișier imagine', 'duplicates' => '', 'duplicate_content' => '', +'duplicate_sequences' => '', 'edit' => 'Editează', 'edit_attributes' => 'Editează atribute', 'edit_comment' => 'Editează comentariu', @@ -632,6 +633,7 @@ URL: [url]', 'extension_mgr_repository' => 'Disponibila', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versiuni', 'february' => 'Februarie', @@ -765,6 +767,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => 'Așteptare', 'individuals' => 'Individuals', 'individuals_in_groups' => '', @@ -915,6 +918,7 @@ URL: [url]', 'move_clipboard' => 'Mută clipboard', 'move_document' => 'Mută document', 'move_folder' => 'Mută Folder', +'move_into_rootfolder' => '', 'my_account' => 'Contul Meu', 'my_documents' => 'Documentele Mele', 'my_transmittals' => 'Trimiterile mele', @@ -1057,6 +1061,7 @@ Utilizator: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Proprietar schimbat', +'parent_folder' => '', 'password' => 'Parolă', 'password_already_used' => 'Parolă folosită deja', 'password_expiration' => 'Expirare parolă', @@ -1102,6 +1107,7 @@ Dacă aveți în continuare probleme la autentificare, vă rugăm să contactaț 'preview' => 'Previzualizare', 'preview_converters' => '', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -1114,6 +1120,7 @@ Dacă aveți în continuare probleme la autentificare, vă rugăm să contactaț 'quota_exceeded' => 'Spatiul tău alocat pe disc este depășit cu [bytes].', 'quota_is_disabled' => 'Spatiu alocat este dezactivată în setări. Stabilirea unui spatiu alocat pentru utilizator nu va avea nici un efect până când setarea este reactivată din nou.', 'quota_warning' => 'Dimensiunea dumneavoastră maximă este depasită cu [bytes]. Vă rugăm să eliminați documente sau versiuni anterioare.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1816,6 +1823,7 @@ URL: [url]', 'set_password' => 'Setare Parolă', 'set_workflow' => 'Setare Workflow', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => 'Arata o lista a versiunilor', 'signed_in_as' => 'Autentificat ca', 'sign_in' => 'Sign in', @@ -2079,6 +2087,7 @@ URL: [url]', 'update_approvers' => 'Actualizare Listă de aprobatori', 'update_document' => 'Actualizare document', 'update_fulltext_index' => 'Actualizare index pe tot textul (fulltext index)', +'update_fulltext_messages' => '', 'update_info' => 'Informații actualizare', 'update_locked_msg' => 'Acest document este blocat.', 'update_recipients' => '', diff --git a/languages/ru_RU/lang.inc b/languages/ru_RU/lang.inc index 89c0ecf3a..6f2929ddc 100644 --- a/languages/ru_RU/lang.inc +++ b/languages/ru_RU/lang.inc @@ -526,6 +526,7 @@ URL: [url]', 'dump_remove' => 'Удалить дамп', 'duplicates' => 'Дубликаты', 'duplicate_content' => 'Дублированное содержимое', +'duplicate_sequences' => '', 'edit' => 'Изменить', 'edit_attributes' => 'Изменить атрибуты', 'edit_comment' => 'Изменить комментарий', @@ -632,6 +633,7 @@ URL: [url]', 'extension_mgr_repository' => 'Установленные', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Версии', 'february' => 'Февраль', @@ -765,6 +767,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => 'Ожидание', 'individuals' => 'Пользователи', 'individuals_in_groups' => 'Пользователи группы', @@ -915,6 +918,7 @@ URL: [url]', 'move_clipboard' => 'Переместить буфер обмена', 'move_document' => 'Переместить документ', 'move_folder' => 'Переместить каталог', +'move_into_rootfolder' => '', 'my_account' => 'Моя учётка', 'my_documents' => 'Мои документы', 'my_transmittals' => 'Мои пересылки', @@ -1056,6 +1060,7 @@ URL: [url]', URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: изменён владелец «[name]»', +'parent_folder' => '', 'password' => 'Пароль', 'password_already_used' => 'Пароль уже используется', 'password_expiration' => 'Срок действия пароля', @@ -1099,6 +1104,7 @@ URL: [url]', 'preview' => 'Предварительный просмотр', 'preview_converters' => 'Предварительный просмотр конвертации документа', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => '', 'preview_plain' => 'Текст', @@ -1111,6 +1117,7 @@ URL: [url]', 'quota_exceeded' => 'Ваша дисковая квота превышена на [bytes].', 'quota_is_disabled' => 'Поддержка квот в настоящее время отключена в настройках.', 'quota_warning' => 'Ваша дисковая квота превышена на [bytes]. Удалите ненужные документы или их предыдущие версии.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1823,6 +1830,7 @@ URL: [url]', 'set_password' => 'Установить пароль', 'set_workflow' => 'Установить процесс', 'show_extension_changelog' => 'Показать журнал изменений', +'show_extension_readme' => '', 'show_extension_version_list' => 'Показать список версий', 'signed_in_as' => 'Пользователь', 'sign_in' => 'Войти', @@ -2086,6 +2094,7 @@ URL: [url]', 'update_approvers' => 'Обновить список утверждающих', 'update_document' => 'Обновить документ', 'update_fulltext_index' => 'Обновить полнотекстовый индекс', +'update_fulltext_messages' => '', 'update_info' => 'Обновить информацию', 'update_locked_msg' => 'Этот документ заблокирован', 'update_recipients' => 'Обновить список получателей', diff --git a/languages/sk_SK/lang.inc b/languages/sk_SK/lang.inc index 3d00e11e6..a5915ef6f 100644 --- a/languages/sk_SK/lang.inc +++ b/languages/sk_SK/lang.inc @@ -538,6 +538,7 @@ URL: [url]', 'dump_remove' => 'Odstrániť vystup', 'duplicates' => 'Duplikáty', 'duplicate_content' => 'Duplicitný obsah', +'duplicate_sequences' => '', 'edit' => 'upraviť', 'edit_attributes' => 'Uprav parametre', 'edit_comment' => 'Upraviť komentár', @@ -644,6 +645,7 @@ URL: [url]', 'extension_mgr_repository' => 'Available', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Versions', 'february' => 'Február', @@ -784,6 +786,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => 'Did not index content', 'index_pending' => 'Pending', +'index_processing' => '', 'index_waiting' => 'Čakajte', 'individuals' => 'Jednotlivci', 'individuals_in_groups' => 'Členovia skupiny', @@ -934,6 +937,7 @@ URL: [url]', 'move_clipboard' => 'Presunúť schránku', 'move_document' => 'Presunúť dokument', 'move_folder' => 'Presunúť zložku', +'move_into_rootfolder' => '', 'my_account' => 'Môj účet', 'my_documents' => 'Moje dokumenty', 'my_transmittals' => 'My Transmittals', @@ -1076,6 +1080,7 @@ Používateľ: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Vlastník zmenený', +'parent_folder' => '', 'password' => 'Heslo', 'password_already_used' => 'Heslo sa už používa', 'password_expiration' => 'Vypršanie hesla', @@ -1121,6 +1126,7 @@ If you have still problems to login, then please contact your administrator.', 'preview' => 'Náhľad', 'preview_converters' => 'Ukážka konverzie dokumentu', 'preview_images' => 'Náhľad obrázkov', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => 'Preview as PDF', 'preview_plain' => 'Text', @@ -1133,6 +1139,7 @@ If you have still problems to login, then please contact your administrator.', 'quota_exceeded' => 'Vaša disková kvóta bola prekročená o [bytes].', 'quota_is_disabled' => 'Podpora kvót je momentálne zakázaná v nastaveniach. Nastavenie kvóty používateľa nebude mať žiadny účinok, kým nebude znovu aktivovaná.', 'quota_warning' => 'Maximálne využitie disku je prekročené o [bytes]. Odstráňte dokumenty alebo predchádzajúce verzie.', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts] receipts already accepted', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '[no_receipts] receipts not being touched', @@ -1856,6 +1863,7 @@ Meno: [username] 'set_password' => 'Nastaviť heslo', 'set_workflow' => 'Set Workflow', 'show_extension_changelog' => 'Show Changelog', +'show_extension_readme' => '', 'show_extension_version_list' => 'Show list of versions', 'signed_in_as' => 'Prihlásený ako', 'sign_in' => 'Prihlásiť sa', @@ -2119,6 +2127,7 @@ URL: [url]', 'update_approvers' => 'Aktualizovať zoznam schvaľovateľov', 'update_document' => 'Aktualizovať', 'update_fulltext_index' => 'Aktualizovať fulltext index', +'update_fulltext_messages' => '', 'update_info' => 'Aktualizovať informácie', 'update_locked_msg' => 'Tento dokument je zamknutý.', 'update_recipients' => 'Aktualizovať zoznam recipientov', diff --git a/languages/sv_SE/lang.inc b/languages/sv_SE/lang.inc index ea4c3ed0a..aa1f8b68a 100644 --- a/languages/sv_SE/lang.inc +++ b/languages/sv_SE/lang.inc @@ -532,6 +532,7 @@ URL: [url]', 'dump_remove' => 'Ta bort dumpfil', 'duplicates' => 'Dubletter', 'duplicate_content' => 'Duplicera innehåll', +'duplicate_sequences' => '', 'edit' => 'Ändra', 'edit_attributes' => 'Ändra attribut', 'edit_comment' => 'Ändra kommentar', @@ -638,6 +639,7 @@ URL: [url]', 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'februari', @@ -771,6 +773,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => 'Förestående', +'index_processing' => '', 'index_waiting' => 'Väntar', 'individuals' => 'Personer', 'individuals_in_groups' => 'Medlemmar i en grupp', @@ -921,6 +924,7 @@ URL: [url]', 'move_clipboard' => 'Flytta urklipp', 'move_document' => 'Flytta dokument', 'move_folder' => 'Flytta katalog', +'move_into_rootfolder' => '', 'my_account' => 'Min Sida', 'my_documents' => 'Mina dokument', 'my_transmittals' => 'Mina överföringar', @@ -1063,6 +1067,7 @@ Användare: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Ägare har ändrats', +'parent_folder' => '', 'password' => 'Lösenord', 'password_already_used' => 'Lösenordet används redan', 'password_expiration' => 'Lösenord utgår', @@ -1105,6 +1110,7 @@ Om du fortfarande har problem med inloggningen, kontakta administratören.', 'preview' => 'Förhandsgranskning', 'preview_converters' => 'Konvertering för förhandsgranskning', 'preview_images' => 'Förhandsgranska bilder', +'preview_images_text' => '', 'preview_markdown' => 'Förminskning', 'preview_pdf' => 'Förhandsgranska som PDF', 'preview_plain' => 'Text', @@ -1117,6 +1123,7 @@ Om du fortfarande har problem med inloggningen, kontakta administratören.', 'quota_exceeded' => 'Din minneskvot har överskridits med [bytes].', 'quota_is_disabled' => 'Kvotstöd är för närvarande inaktiverad i inställningarna. Ett värde för användarkvot kommer inte att ha någon effekt förrän den är aktiverad igen.', 'quota_warning' => 'Din maximala lagringskvot har överskridits med [bytes]. Ta bort dokument eller tidigare versioner.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1829,6 +1836,7 @@ Kommentar: [comment]', 'set_password' => 'Ange lösenord', 'set_workflow' => 'Välj arbetsflöde', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Inloggad som', 'sign_in' => 'Logga in', @@ -2092,6 +2100,7 @@ URL: [url]', 'update_approvers' => 'Uppdatera lista med personer som godkänner', 'update_document' => 'Uppdatera dokument', 'update_fulltext_index' => 'Uppdatera fulltext-index', +'update_fulltext_messages' => '', 'update_info' => 'Uppdatera information', 'update_locked_msg' => 'Dokumentet är låst', 'update_recipients' => 'Uppdatera lista med mottagare', diff --git a/languages/tr_TR/lang.inc b/languages/tr_TR/lang.inc index 7dfe3251b..9bf9d1bb5 100644 --- a/languages/tr_TR/lang.inc +++ b/languages/tr_TR/lang.inc @@ -520,6 +520,7 @@ URL: [url]', 'dump_remove' => 'Dump dosyasını sil', 'duplicates' => '', 'duplicate_content' => 'içeriği_klonla', +'duplicate_sequences' => '', 'edit' => 'Düzenle', 'edit_attributes' => 'Nitelikleri düzenle', 'edit_comment' => 'Açıklamayı düzenle', @@ -626,6 +627,7 @@ URL: [url]', 'extension_mgr_repository' => 'Mevcut', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => 'Veysionlar', 'february' => 'Şubat', @@ -759,6 +761,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => 'Bekliyor', 'individuals' => 'Bireysel', 'individuals_in_groups' => 'Ekip Üyeleri', @@ -909,6 +912,7 @@ URL: [url]', 'move_clipboard' => 'Panoyu taşı', 'move_document' => 'Dokümanı taşı', 'move_folder' => 'Klasörü Taşı', +'move_into_rootfolder' => '', 'my_account' => 'Hesabım', 'my_documents' => 'Dokümanlarım', 'my_transmittals' => 'Çevirilerim', @@ -1051,6 +1055,7 @@ Kullanıcı: [username] URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - Sahip değişti', +'parent_folder' => '', 'password' => 'Parola', 'password_already_used' => 'Bu parola zaten kullanılmış', 'password_expiration' => 'Parola kullanım süresi', @@ -1098,6 +1103,7 @@ Giriş yaparken halen sorun yaşıyorsanız lütfen sistem yöneticinizle görü 'preview' => 'Önizle', 'preview_converters' => '', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => '', 'preview_pdf' => '', 'preview_plain' => '', @@ -1110,6 +1116,7 @@ Giriş yaparken halen sorun yaşıyorsanız lütfen sistem yöneticinizle görü 'quota_exceeded' => 'Size ayrılan disk kotası [bytes] aşıldı.', 'quota_is_disabled' => 'Kota desteği ayarlardan kapatılmış durumda. Açılana kadar kullanıcıya kota tanımlamanın bir etkisi olmaz.', 'quota_warning' => 'Size ayrılan disk kotası [bytes] aşıldı. Lütfen gereksiz olduğunu düşündüğünüz dokümanları veya eski versiyonları silin.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1795,6 +1802,7 @@ URL: [url]', 'set_password' => 'Parola Belirle', 'set_workflow' => 'İş Akışı Tanımla', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => 'Versiyonları görüntüle', 'signed_in_as' => 'Giriş yapan kullanıcı', 'sign_in' => 'Giriş', @@ -2058,6 +2066,7 @@ URL: [url]', 'update_approvers' => 'Onaylayanlar listesini güncelle', 'update_document' => 'Doküman güncelle', 'update_fulltext_index' => 'Tam metin indeksini güncelle', +'update_fulltext_messages' => '', 'update_info' => 'Bilgileri Güncelle', 'update_locked_msg' => 'Bu doküman kilitli.', 'update_recipients' => '', diff --git a/languages/uk_UA/lang.inc b/languages/uk_UA/lang.inc index c3150f174..92ae8c0ca 100644 --- a/languages/uk_UA/lang.inc +++ b/languages/uk_UA/lang.inc @@ -526,6 +526,7 @@ URL: [url]', 'dump_remove' => 'Видалити дамп', 'duplicates' => '', 'duplicate_content' => 'Дубльований вміст', +'duplicate_sequences' => '', 'edit' => 'Змінити', 'edit_attributes' => 'Змінити атрибути', 'edit_comment' => 'Змінити коментар', @@ -632,6 +633,7 @@ URL: [url]', 'extension_mgr_repository' => '', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '', 'february' => 'Лютий', @@ -765,6 +767,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '', 'index_pending' => '', +'index_processing' => '', 'index_waiting' => '', 'individuals' => 'Користувачі', 'individuals_in_groups' => 'Користувачі групи', @@ -915,6 +918,7 @@ URL: [url]', 'move_clipboard' => 'Перемістити буфер обміну', 'move_document' => 'Перемістити документ', 'move_folder' => 'Перемістити каталог', +'move_into_rootfolder' => '', 'my_account' => 'Мій обліковий запис', 'my_documents' => 'Мої документи', 'my_transmittals' => 'Мої перенесення', @@ -1056,6 +1060,7 @@ URL: [url]', URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: змінено власника «[name]»', +'parent_folder' => '', 'password' => 'Пароль', 'password_already_used' => 'Пароль вже використовується', 'password_expiration' => 'Термін використання паролю', @@ -1099,6 +1104,7 @@ URL: [url]', 'preview' => 'Попередній перегляд', 'preview_converters' => 'Попередній перегляд перетворення документу', 'preview_images' => '', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => '', 'preview_plain' => 'Текст', @@ -1111,6 +1117,7 @@ URL: [url]', 'quota_exceeded' => 'Ваша дискова квота перевищена на [bytes].', 'quota_is_disabled' => 'Квотування відключено', 'quota_warning' => 'Ваша дискова квота перевищена на [bytes]. Видаліть непотрібні документи або їх попередні версії.', +'readme_loading' => '', 'receipts_accepted' => '', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '', @@ -1816,6 +1823,7 @@ URL: [url]', 'set_password' => 'Встановити пароль', 'set_workflow' => 'Вказати процес', 'show_extension_changelog' => '', +'show_extension_readme' => '', 'show_extension_version_list' => '', 'signed_in_as' => 'Користувач', 'sign_in' => 'Увійти', @@ -2079,6 +2087,7 @@ URL: [url]', 'update_approvers' => 'Оновити список затверджувачів', 'update_document' => 'Оновити документ', 'update_fulltext_index' => 'Оновити повнотекстовий пошук', +'update_fulltext_messages' => '', 'update_info' => 'Оновити інформацію', 'update_locked_msg' => 'Цей документ заблоковано', 'update_recipients' => 'Оновити список отримувачів', diff --git a/languages/zh_CN/lang.inc b/languages/zh_CN/lang.inc index bf8a2dd0e..7913315c8 100644 --- a/languages/zh_CN/lang.inc +++ b/languages/zh_CN/lang.inc @@ -526,6 +526,7 @@ URL: [url]', 'dump_remove' => '删除转储文件', 'duplicates' => '复制', 'duplicate_content' => '重复的内容', +'duplicate_sequences' => '', 'edit' => '编辑', 'edit_attributes' => '编辑属性', 'edit_comment' => '编辑说明', @@ -634,6 +635,7 @@ URL: [url]', 'extension_mgr_repository' => '可得到', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '版本列表', 'february' => '二 月', @@ -767,6 +769,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '没有索引内容', 'index_pending' => '待处理', +'index_processing' => '', 'index_waiting' => '等待', 'individuals' => '个人', 'individuals_in_groups' => '组成员', @@ -917,6 +920,7 @@ URL: [url]', 'move_clipboard' => '移动剪切板', 'move_document' => '移动文档', 'move_folder' => '移动文件夹', +'move_into_rootfolder' => '', 'my_account' => '我的账户', 'my_documents' => '我的文档', 'my_transmittals' => '我的传送', @@ -1059,6 +1063,7 @@ URL: [url]', URL: [url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - 所有者已更新', +'parent_folder' => '', 'password' => '密码', 'password_already_used' => '密码已被使用', 'password_expiration' => '密码过期', @@ -1104,6 +1109,7 @@ URL: [url]', 'preview' => '预览', 'preview_converters' => '预览文档', 'preview_images' => '预览图片', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => '作为PDF预览', 'preview_plain' => 'TEXT', @@ -1116,6 +1122,7 @@ URL: [url]', 'quota_exceeded' => '您的磁盘配额已超过 [bytes]。', 'quota_is_disabled' => '配额的支持', 'quota_warning' => '您的磁盘最大使用量已超过 [bytes]。请删除文档或以前的版本。', +'readme_loading' => '', 'receipts_accepted' => '已收到收据', 'receipts_accepted_latest' => '', 'receipts_not_touched' => '未获取收据[no_receipts]', @@ -1803,6 +1810,7 @@ URL: [url]', 'set_password' => '设定密码', 'set_workflow' => '设置工作流', 'show_extension_changelog' => '显示更新记录', +'show_extension_readme' => '', 'show_extension_version_list' => '显示版本列表', 'signed_in_as' => '登录为', 'sign_in' => '登录', @@ -2057,6 +2065,7 @@ URL: [url]', 'update_approvers' => '更新审核人名单', 'update_document' => '更新', 'update_fulltext_index' => '更新全文索引', +'update_fulltext_messages' => '', 'update_info' => '更新信息', 'update_locked_msg' => '该文档被锁定', 'update_recipients' => '更新收件人列表', diff --git a/languages/zh_TW/lang.inc b/languages/zh_TW/lang.inc index a04043ebb..51d638b7d 100644 --- a/languages/zh_TW/lang.inc +++ b/languages/zh_TW/lang.inc @@ -538,6 +538,7 @@ URL: [url]', 'dump_remove' => '刪除轉儲檔', 'duplicates' => '重複項', 'duplicate_content' => '重複內容', +'duplicate_sequences' => '', 'edit' => '編輯', 'edit_attributes' => '編輯屬性', 'edit_comment' => '編輯說明', @@ -644,6 +645,7 @@ URL: [url]', 'extension_mgr_repository' => '可用', 'extension_mgr_upload_disabled' => '', 'extension_missing_name' => '', +'extension_readme' => '', 'extension_toggle_error' => '', 'extension_version_list' => '版本', 'february' => '二 月', @@ -784,6 +786,7 @@ URL: [url]', 'index_folder_updated' => '', 'index_no_content' => '沒有索引內容', 'index_pending' => '待定', +'index_processing' => '', 'index_waiting' => '請稍後', 'individuals' => '個人', 'individuals_in_groups' => '小組成員', @@ -934,6 +937,7 @@ URL: [url]', 'move_clipboard' => '移動剪貼簿', 'move_document' => '移動文件', 'move_folder' => '移動資料夾', +'move_into_rootfolder' => '', 'my_account' => '我的帳戶', 'my_documents' => '我的文件', 'my_transmittals' => '我的傳送', @@ -1076,6 +1080,7 @@ URL: [url]', 網址:[url]', 'ownership_changed_email_body_html' => '', 'ownership_changed_email_subject' => '[sitename]: [name] - 擁有者已改變', +'parent_folder' => '', 'password' => '密碼', 'password_already_used' => '密碼已使用', 'password_expiration' => '密碼過期', @@ -1119,6 +1124,7 @@ URL: [url]', 'preview' => '預覽', 'preview_converters' => '預覽文件轉換', 'preview_images' => '預覽圖像', +'preview_images_text' => '', 'preview_markdown' => 'Markdown', 'preview_pdf' => '預覽為PDF', 'preview_plain' => '文本', @@ -1131,6 +1137,7 @@ URL: [url]', 'quota_exceeded' => '您的磁盤配額超出了[bytes]。', 'quota_is_disabled' => '當前在設置中禁用了配額支持。除非再次啟用,否則設置使用者配額將無效。', 'quota_warning' => '您的最大光盤使用量超出了[bytes]。請刪除文檔或以前的版本。', +'readme_loading' => '', 'receipts_accepted' => '[no_receipts]張收據已被接受', 'receipts_accepted_latest' => '(最新版本為[no_receipts])', 'receipts_not_touched' => '[no_receipts]收據未觸及', @@ -1854,6 +1861,7 @@ URL: [url]', 'set_password' => '設定密碼', 'set_workflow' => '設定工作流程', 'show_extension_changelog' => '顯示變更日誌', +'show_extension_readme' => '', 'show_extension_version_list' => '版本列表', 'signed_in_as' => '登錄為', 'sign_in' => '登入', @@ -2117,6 +2125,7 @@ URL: [url]', 'update_approvers' => '更新審核人名單', 'update_document' => '更新', 'update_fulltext_index' => '更新全文索引', +'update_fulltext_messages' => '', 'update_info' => '更新資訊', 'update_locked_msg' => '該文件被鎖定', 'update_recipients' => '', diff --git a/op/.htaccess b/op/.htaccess index 85718b048..deb356312 100644 --- a/op/.htaccess +++ b/op/.htaccess @@ -1,3 +1,4 @@ -RewriteEngine on -RewriteCond %{REQUEST_URI} (.*)viewonline/([0-9]+)/([0-9]+)/(.+)$ -RewriteRule (.*)viewonline/([0-9]+)/([0-9]+)/(.+)$ $1op.ViewOnline.php?request=$2:$3 [PT] +RewriteEngine on +RewriteCond %{REQUEST_URI} (.*)viewonline/([0-9]+)/([0-9]+)/(.+)$ +RewriteRule (.*)viewonline/([0-9]+)/([0-9]+)/(.+)$ $1op.ViewOnline.php?request=$2:$3 [PT] +RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last] diff --git a/op/op.Acl.php b/op/op.Acl.php index 3289109e4..fc7f35baf 100644 --- a/op/op.Acl.php +++ b/op/op.Acl.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. require_once("../inc/inc.Settings.php"); -require_once("../inc/inc.LogInit.php"); require_once("../inc/inc.Utils.php"); +require_once("../inc/inc.LogInit.php"); require_once("../inc/inc.Language.php"); require_once("../inc/inc.Init.php"); require_once("../inc/inc.Extension.php"); diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index f28b32913..17533022f 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); @@ -508,7 +508,7 @@ foreach($file_ary as $file) { } } } - + add_log_line("?name=".$name."&folderid=".$folderid); } diff --git a/op/op.AddDocumentLink.php b/op/op.AddDocumentLink.php index 4c3f20e58..6b6efe7a7 100644 --- a/op/op.AddDocumentLink.php +++ b/op/op.AddDocumentLink.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.AddEvent.php b/op/op.AddEvent.php index 84a83da65..f319ba394 100644 --- a/op/op.AddEvent.php +++ b/op/op.AddEvent.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); diff --git a/op/op.AddFile.php b/op/op.AddFile.php index cbb203c35..2c595c594 100644 --- a/op/op.AddFile.php +++ b/op/op.AddFile.php @@ -18,8 +18,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.AddFile2.php b/op/op.AddFile2.php index ae05026db..237fb9e7e 100644 --- a/op/op.AddFile2.php +++ b/op/op.AddFile2.php @@ -18,8 +18,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.AddMultiDocument.php b/op/op.AddMultiDocument.php index 9bcbd0dcf..b493d5b3f 100644 --- a/op/op.AddMultiDocument.php +++ b/op/op.AddMultiDocument.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.AddSubFolder.php b/op/op.AddSubFolder.php index 716c6bff5..948b807fc 100644 --- a/op/op.AddSubFolder.php +++ b/op/op.AddSubFolder.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.AddToClipboard.php b/op/op.AddToClipboard.php index 3c6625545..27d33d62d 100644 --- a/op/op.AddToClipboard.php +++ b/op/op.AddToClipboard.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.DBInit.php"); include("../inc/inc.Language.php"); diff --git a/op/op.AddToTransmittal.php b/op/op.AddToTransmittal.php index de8d6c466..d81ca2133 100644 --- a/op/op.AddToTransmittal.php +++ b/op/op.AddToTransmittal.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.AddTransitionToWorkflow.php b/op/op.AddTransitionToWorkflow.php index f9789a533..6d7203506 100644 --- a/op/op.AddTransitionToWorkflow.php +++ b/op/op.AddTransitionToWorkflow.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.Ajax.php b/op/op.Ajax.php index c8f96d56b..c88e67c72 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. require_once("../inc/inc.Settings.php"); -require_once("../inc/inc.LogInit.php"); require_once("../inc/inc.Utils.php"); +require_once("../inc/inc.LogInit.php"); require_once("../inc/inc.Language.php"); require_once("../inc/inc.Init.php"); require_once("../inc/inc.Extension.php"); @@ -171,7 +171,8 @@ switch($command) { $result = array(); foreach($hits['folders'] as $hit) { if($hit->getAccessMode($user, 'search') >= M_READ) - $result[] = $hit->getID().'#'.$basefolder->getName().'/'.$hit->getName(); + //$result[] = $hit->getID().'#'.$basefolder->getName().'/'.$hit->getName(); + $result[] = $hit->getID().'#'.$hit->getFolderPathPlain(true, '/'); } header('Content-Type: application/json'); echo json_encode($result); @@ -182,7 +183,8 @@ switch($command) { $subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, M_READ); $result = array(); foreach($subfolders as $subfolder) { - $result[] = $subfolder->getID().'#'.$basefolder->getName().'/'.$subfolder->getName(); + //$result[] = $subfolder->getID().'#'.$basefolder->getName().'/'.$subfolder->getName(); + $result[] = $subfolder->getID().'#'.$subfolder->getFolderPathPlain(true, '/'); } header('Content-Type: application/json'); echo json_encode($result); @@ -197,7 +199,7 @@ switch($command) { $result = array(); foreach($hits['folders'] as $hit) { if($hit->getAccessMode($user, 'search') >= M_READ) - $result[] = $hit->getID().'#'.$hit->getName(); + $result[] = $hit->getID().'#'.$hit->getFolderPathPlain(true, '/'); } header('Content-Type: application/json'); echo json_encode($result); @@ -668,6 +670,37 @@ switch($command) { } break; /* }}} */ + case 'setmimetype': /* {{{ */ + if($user && $user->isAdmin()) { + if(checkFormKey('setmimetype', 'GET')) { + $content = $dms->getDocumentContent($_REQUEST['contentid']); + if($content) { + $document = $content->getDocument(); + if ($document->getAccessMode($user) >= M_READWRITE) { + $realmimetype = SeedDMS_Core_File::mimetype($dms->contentDir . $content->getPath()); + if (!$content->setMimeType($realmimetype)) { + header('Content-Type: application/json'); + echo json_encode(array('success'=>false, 'message'=>'Error setting mimetype', 'data'=>'')); + } else { + header('Content-Type: application/json'); + echo json_encode(array('success'=>true, 'message'=>getMLText('splash_mimetype_changed'), 'data'=>'')); + add_log_line(); + } + } else { + header('Content-Type: application/json'); + echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>'')); + } + } else { + header('Content-Type: application/json'); + echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>'')); + } + } else { + header('Content-Type: application/json'); + echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); + } + } + break; /* }}} */ + case 'submittranslation': /* {{{ */ if($settings->_showMissingTranslations) { if($user && !empty($_POST['phrase'])) { @@ -829,10 +862,11 @@ switch($command) { $controller->setParam('filetype', $fileType); $controller->setParam('userfiletype', $userfiletype); $minmax = $folder->getDocumentsMinMax(); + $deviation = rand(10, 1000)/10; if($settings->_defaultDocPosition == 'start') - $controller->setParam('sequence', $minmax['min'] - 1); + $controller->setParam('sequence', $minmax['min'] - $deviation); else - $controller->setParam('sequence', $minmax['max'] + 1); + $controller->setParam('sequence', $minmax['max'] + $deviation); $controller->setParam('reviewers', $reviewers); $controller->setParam('approvers', $approvers); $controller->setParam('reqversion', 1); @@ -1030,6 +1064,7 @@ switch($command) { } if($object) { if($index = $fulltextservice->Indexer()) { + $index->init($settings->_stopWordsFile); $idoc = $fulltextservice->IndexedDocument($object, true); $error = $idoc->getErrorMsg(); if(!$error) { @@ -1045,9 +1080,9 @@ switch($command) { $ires = $index->addDocument($idoc); header('Content-Type: application/json'); if(false === $ires) { - echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$prefix.$object->getID(), 'mimetype'=>$idoc->getMimeType(), 'cmd'=>$idoc->getCmd())); + echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed', ['name'=>$object->getName()]), 'data'=>$prefix.$object->getID(), 'mimetype'=>$idoc->getMimeType(), 'cmd'=>$idoc->getCmd())); } else { - echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$prefix.$object->getID(), 'cmd'=>$idoc->getCmd())); + echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed', ['name'=>$object->getName()]), 'data'=>$prefix.$object->getID(), 'cmd'=>$idoc->getCmd())); } } else { header('Content-Type: application/json'); diff --git a/op/op.ApproveDocument.php b/op/op.ApproveDocument.php index e7d00ddc1..4371c5e28 100644 --- a/op/op.ApproveDocument.php +++ b/op/op.ApproveDocument.php @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.Authentication.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassController.php"); diff --git a/op/op.AttributeMgr.php b/op/op.AttributeMgr.php index e263c93de..24b94a0eb 100644 --- a/op/op.AttributeMgr.php +++ b/op/op.AttributeMgr.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CancelCheckOut.php b/op/op.CancelCheckOut.php index 209d37e4e..bc4d5bab0 100644 --- a/op/op.CancelCheckOut.php +++ b/op/op.CancelCheckOut.php @@ -17,6 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); @@ -38,7 +39,8 @@ $documentid = $_POST["documentid"]; $document = $dms->getDocument($documentid); $checkoutstatus = $document->checkOutStatus(); -if($checkoutstatus != 3 && empty($settings->_enableCancelCheckout)) { +/* Check out of files which has been changed, can only be canceled if allowed in the configuration */ +if($checkoutstatus == 0 && empty($settings->_enableCancelCheckout)) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("operation_disallowed")); } diff --git a/op/op.Categories.php b/op/op.Categories.php index 1a7c79bfb..d43d2b5ba 100644 --- a/op/op.Categories.php +++ b/op/op.Categories.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ChangePassword.php b/op/op.ChangePassword.php index 7e066e7fb..b462640f3 100644 --- a/op/op.ChangePassword.php +++ b/op/op.ChangePassword.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.CheckInDocument.php b/op/op.CheckInDocument.php index 41f4a1407..47853f199 100644 --- a/op/op.CheckInDocument.php +++ b/op/op.CheckInDocument.php @@ -17,6 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CheckOutDocument.php b/op/op.CheckOutDocument.php index f6569ef22..1e22c7ffc 100644 --- a/op/op.CheckOutDocument.php +++ b/op/op.CheckOutDocument.php @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.ClearCache.php b/op/op.ClearCache.php index ad9a1d63f..72a168047 100644 --- a/op/op.ClearCache.php +++ b/op/op.ClearCache.php @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.ClearClipboard.php b/op/op.ClearClipboard.php index fb955afa6..df8313cfe 100644 --- a/op/op.ClearClipboard.php +++ b/op/op.ClearClipboard.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CreateDump.php b/op/op.CreateDump.php index 7b25963ef..e471484a5 100644 --- a/op/op.CreateDump.php +++ b/op/op.CreateDump.php @@ -17,8 +17,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -include("../inc/inc.Version.php"); include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CreateFolderArchive.php b/op/op.CreateFolderArchive.php index 07c1cb112..3c5cd384a 100644 --- a/op/op.CreateFolderArchive.php +++ b/op/op.CreateFolderArchive.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CreateSubFolderIndex.php b/op/op.CreateSubFolderIndex.php index 6d02e4778..1a58535e5 100644 --- a/op/op.CreateSubFolderIndex.php +++ b/op/op.CreateSubFolderIndex.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.CreateVersioningFiles.php b/op/op.CreateVersioningFiles.php index f3b8c30fc..4ab4e4ca6 100644 --- a/op/op.CreateVersioningFiles.php +++ b/op/op.CreateVersioningFiles.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.Cron.php b/op/op.Cron.php index ac05baacc..3ecd68d2e 100644 --- a/op/op.Cron.php +++ b/op/op.Cron.php @@ -19,16 +19,16 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); -include("../inc/inc.Language.php"); -include("../inc/inc.Utils.php"); -include("../inc/inc.Init.php"); -include("../inc/inc.Extension.php"); -include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassController.php"); -include("../inc/inc.Scheduler.php"); -include("../inc/inc.BasicAuthentication.php"); +require_once("../inc/inc.Settings.php"); +require_once("../inc/inc.Utils.php"); +require_once("../inc/inc.LogInit.php"); +require_once("../inc/inc.Language.php"); +require_once("../inc/inc.Init.php"); +require_once("../inc/inc.Extension.php"); +require_once("../inc/inc.DBInit.php"); +require_once("../inc/inc.ClassController.php"); +require_once("../inc/inc.Scheduler.php"); +require_once("../inc/inc.BasicAuthentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); @@ -44,6 +44,7 @@ if(!empty($_GET['mode']) && in_array($_GET['mode'], array('list', 'run', 'dryrun $mode = $_GET['mode']; $controller->setParam('settings', $settings); +$controller->setParam('logger', $logger); $controller->setParam('mode', $mode); if(!$controller->run()) { echo getMLText("error_occured"); diff --git a/op/op.DefaultKeywords.php b/op/op.DefaultKeywords.php index 069d8955a..5150d6b79 100644 --- a/op/op.DefaultKeywords.php +++ b/op/op.DefaultKeywords.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.DocumentAccess.php b/op/op.DocumentAccess.php index d4877c736..6fc483123 100644 --- a/op/op.DocumentAccess.php +++ b/op/op.DocumentAccess.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.DocumentNotify.php b/op/op.DocumentNotify.php index 1ce87d163..e0ba58116 100644 --- a/op/op.DocumentNotify.php +++ b/op/op.DocumentNotify.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.Download.php b/op/op.Download.php index eb1163af8..81d926288 100644 --- a/op/op.Download.php +++ b/op/op.Download.php @@ -20,9 +20,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); -include("../inc/inc.Utils.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); diff --git a/op/op.DropFolderPreview.php b/op/op.DropFolderPreview.php index 84f36213b..96f2209d1 100644 --- a/op/op.DropFolderPreview.php +++ b/op/op.DropFolderPreview.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditAttributes.php b/op/op.EditAttributes.php index 3eed0057e..cae040121 100644 --- a/op/op.EditAttributes.php +++ b/op/op.EditAttributes.php @@ -20,9 +20,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); -include("../inc/inc.Utils.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); diff --git a/op/op.EditComment.php b/op/op.EditComment.php index b0fe19994..65129ae12 100644 --- a/op/op.EditComment.php +++ b/op/op.EditComment.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditDocument.php b/op/op.EditDocument.php index 3f6e1a0c3..999bb4275 100644 --- a/op/op.EditDocument.php +++ b/op/op.EditDocument.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditDocumentFile.php b/op/op.EditDocumentFile.php index fbf621e98..fba5c1ba3 100644 --- a/op/op.EditDocumentFile.php +++ b/op/op.EditDocumentFile.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditEvent.php b/op/op.EditEvent.php index 7f73a438e..d2e220bef 100644 --- a/op/op.EditEvent.php +++ b/op/op.EditEvent.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditFolder.php b/op/op.EditFolder.php index bcaefe456..5f0a252f7 100644 --- a/op/op.EditFolder.php +++ b/op/op.EditFolder.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.EditOnline.php b/op/op.EditOnline.php index 71ba2f980..a6f6ba690 100644 --- a/op/op.EditOnline.php +++ b/op/op.EditOnline.php @@ -19,9 +19,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); -include("../inc/inc.Utils.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); diff --git a/op/op.EditUserData.php b/op/op.EditUserData.php index e72028156..66b1b5327 100644 --- a/op/op.EditUserData.php +++ b/op/op.EditUserData.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ExtensionMgr.php b/op/op.ExtensionMgr.php index 8e53c9d33..c7b2bf5e7 100644 --- a/op/op.ExtensionMgr.php +++ b/op/op.ExtensionMgr.php @@ -17,6 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.FolderAccess.php b/op/op.FolderAccess.php index 004abd871..63de4210f 100644 --- a/op/op.FolderAccess.php +++ b/op/op.FolderAccess.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.FolderNotify.php b/op/op.FolderNotify.php index ffca554c2..4ad783e93 100644 --- a/op/op.FolderNotify.php +++ b/op/op.FolderNotify.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.GroupMgr.php b/op/op.GroupMgr.php index c427c6b70..d51dd6842 100644 --- a/op/op.GroupMgr.php +++ b/op/op.GroupMgr.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.GroupView.php b/op/op.GroupView.php index 8219e30b9..152ee05e3 100644 --- a/op/op.GroupView.php +++ b/op/op.GroupView.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ImportFS.php b/op/op.ImportFS.php index 19cf01aea..260b2c487 100644 --- a/op/op.ImportFS.php +++ b/op/op.ImportFS.php @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.ImportUsers.php b/op/op.ImportUsers.php index e2f305996..e6b7891a8 100644 --- a/op/op.ImportUsers.php +++ b/op/op.ImportUsers.php @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); @@ -49,6 +49,10 @@ function getPasswordPlainData($colname, $coldata, $objdata) { /* {{{ */ return $objdata; } /* }}} */ +function renderPasswordHashedData($colname, $objdata) { /* {{{ */ + return substr($objdata[$colname], 0, 16).'...'; +} /* }}} */ + function renderPasswordPlainData($colname, $objdata) { /* {{{ */ return $objdata[$colname]; } /* }}} */ @@ -176,6 +180,8 @@ if (isset($_FILES['userdata']) && $_FILES['userdata']['error'] == 0) { $colmap[$i] = array("getFolderData", "renderFolderData", $colname); } elseif(in_array($colname, array('quota'))) { $colmap[$i] = array("getQuotaData", "renderQuotaData", $colname); + } elseif(in_array($colname, array('passenc'))) { + $colmap[$i] = array("getBaseData", "renderPasswordHashedData", $colname); } elseif(in_array($colname, array('password'))) { /* getPasswordPlainData() will set 'passenc' */ $colmap[$i] = array("getPasswordPlainData", "renderPasswordPlainData", 'passenc'); diff --git a/op/op.LockDocument.php b/op/op.LockDocument.php index 78b40e079..2d4cc408d 100644 --- a/op/op.LockDocument.php +++ b/op/op.LockDocument.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/op/op.Login.php b/op/op.Login.php index 30771e0f5..22930177a 100644 --- a/op/op.Login.php +++ b/op/op.Login.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); @@ -86,10 +86,12 @@ add_log_line(); $controller->setParam('login', $login); $controller->setParam('logininfo', !empty($_POST['logininfo']) ? $_POST['logininfo'] : ''); $controller->setParam('pwd', $pwd); +$controller->setParam('source', 'web'); $controller->setParam('lang', $lang); $controller->setParam('sesstheme', $sesstheme); $controller->setParam('referuri', $referuri); $controller->setParam('session', $session); +$controller->setParam('authenticator', $authenticator); $action = !empty($_POST['action']) ? $_POST['action'] : ''; switch($action) { case 'preparelogin': diff --git a/op/op.Logout.php b/op/op.Logout.php index 96b99e430..06af4bcc9 100644 --- a/op/op.Logout.php +++ b/op/op.Logout.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.ClassSession.php"); diff --git a/op/op.ManageNotify.php b/op/op.ManageNotify.php index e6c493977..f6b5e4088 100644 --- a/op/op.ManageNotify.php +++ b/op/op.ManageNotify.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.MoveClipboard.php b/op/op.MoveClipboard.php index bff27c200..d08841d19 100644 --- a/op/op.MoveClipboard.php +++ b/op/op.MoveClipboard.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.MoveDocument.php b/op/op.MoveDocument.php index 8006903c3..c785b3c57 100644 --- a/op/op.MoveDocument.php +++ b/op/op.MoveDocument.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.MoveFolder.php b/op/op.MoveFolder.php index b80a15c49..c37167971 100644 --- a/op/op.MoveFolder.php +++ b/op/op.MoveFolder.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.OverrideContentStatus.php b/op/op.OverrideContentStatus.php index af3de3898..253926e56 100644 --- a/op/op.OverrideContentStatus.php +++ b/op/op.OverrideContentStatus.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.PasswordForgotten.php b/op/op.PasswordForgotten.php index bfe719972..03ae90ac0 100644 --- a/op/op.PasswordForgotten.php +++ b/op/op.PasswordForgotten.php @@ -19,8 +19,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.PdfPreview.php b/op/op.PdfPreview.php index a516c6088..4b963426f 100644 --- a/op/op.PdfPreview.php +++ b/op/op.PdfPreview.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.Preview.php b/op/op.Preview.php index d62d4a31c..3ded08099 100644 --- a/op/op.Preview.php +++ b/op/op.Preview.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.RemoveApprovalLog.php b/op/op.RemoveApprovalLog.php index 8c971a951..b5424342c 100644 --- a/op/op.RemoveApprovalLog.php +++ b/op/op.RemoveApprovalLog.php @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.Authentication.php"); include("../inc/inc.ClassUI.php"); diff --git a/op/op.RemoveArchive.php b/op/op.RemoveArchive.php index ff71bb74b..7338fcaa8 100644 --- a/op/op.RemoveArchive.php +++ b/op/op.RemoveArchive.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveDocument.php b/op/op.RemoveDocument.php index 106bf6441..591214d33 100644 --- a/op/op.RemoveDocument.php +++ b/op/op.RemoveDocument.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveDocumentFile.php b/op/op.RemoveDocumentFile.php index 739e2938a..ea7e88953 100644 --- a/op/op.RemoveDocumentFile.php +++ b/op/op.RemoveDocumentFile.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveDocumentLink.php b/op/op.RemoveDocumentLink.php index 87d088d54..3863be9a8 100644 --- a/op/op.RemoveDocumentLink.php +++ b/op/op.RemoveDocumentLink.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveDump.php b/op/op.RemoveDump.php index 925891995..a7b8d39d5 100644 --- a/op/op.RemoveDump.php +++ b/op/op.RemoveDump.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveEvent.php b/op/op.RemoveEvent.php index 998671038..93d1f3b30 100644 --- a/op/op.RemoveEvent.php +++ b/op/op.RemoveEvent.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.RemoveFolder.php b/op/op.RemoveFolder.php index caae1ad54..312945ea1 100644 --- a/op/op.RemoveFolder.php +++ b/op/op.RemoveFolder.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveFolderFiles.php b/op/op.RemoveFolderFiles.php index dd060c70f..f71c333b3 100644 --- a/op/op.RemoveFolderFiles.php +++ b/op/op.RemoveFolderFiles.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveFromClipboard.php b/op/op.RemoveFromClipboard.php index 2bf32f712..d088fb6ac 100644 --- a/op/op.RemoveFromClipboard.php +++ b/op/op.RemoveFromClipboard.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveLog.php b/op/op.RemoveLog.php index ab33ad0bb..fd7c018a8 100644 --- a/op/op.RemoveLog.php +++ b/op/op.RemoveLog.php @@ -18,6 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveReviewLog.php b/op/op.RemoveReviewLog.php index 1e14c7b22..57621ebf5 100644 --- a/op/op.RemoveReviewLog.php +++ b/op/op.RemoveReviewLog.php @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.Authentication.php"); include("../inc/inc.ClassUI.php"); diff --git a/op/op.RemoveTransitionFromWorkflow.php b/op/op.RemoveTransitionFromWorkflow.php index 093ce03b6..2fb4f6188 100644 --- a/op/op.RemoveTransitionFromWorkflow.php +++ b/op/op.RemoveTransitionFromWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveVersion.php b/op/op.RemoveVersion.php index d372521b5..0d9045a24 100644 --- a/op/op.RemoveVersion.php +++ b/op/op.RemoveVersion.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveWorkflow.php b/op/op.RemoveWorkflow.php index fe361eb7c..6da10a93a 100644 --- a/op/op.RemoveWorkflow.php +++ b/op/op.RemoveWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveWorkflowAction.php b/op/op.RemoveWorkflowAction.php index 6d7e7c462..42844c586 100644 --- a/op/op.RemoveWorkflowAction.php +++ b/op/op.RemoveWorkflowAction.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveWorkflowFromDocument.php b/op/op.RemoveWorkflowFromDocument.php index ce83d2dd2..1dd21fb7e 100644 --- a/op/op.RemoveWorkflowFromDocument.php +++ b/op/op.RemoveWorkflowFromDocument.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RemoveWorkflowState.php b/op/op.RemoveWorkflowState.php index 22ace8ff0..11a3a10fa 100644 --- a/op/op.RemoveWorkflowState.php +++ b/op/op.RemoveWorkflowState.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ResetSu.php b/op/op.ResetSu.php index 12af8d57c..833ac2aef 100644 --- a/op/op.ResetSu.php +++ b/op/op.ResetSu.php @@ -17,6 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ReturnFromSubWorkflow.php b/op/op.ReturnFromSubWorkflow.php index 23ff85ed0..e76da43bf 100644 --- a/op/op.ReturnFromSubWorkflow.php +++ b/op/op.ReturnFromSubWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.ReviewDocument.php b/op/op.ReviewDocument.php index 4eacb6107..f7c51dd1b 100644 --- a/op/op.ReviewDocument.php +++ b/op/op.ReviewDocument.php @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.Authentication.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassController.php"); diff --git a/op/op.RewindWorkflow.php b/op/op.RewindWorkflow.php index b01b6a278..1a6b7fe71 100644 --- a/op/op.RewindWorkflow.php +++ b/op/op.RewindWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.RoleMgr.php b/op/op.RoleMgr.php index 62878bbb7..d0cdf6cb0 100644 --- a/op/op.RoleMgr.php +++ b/op/op.RoleMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.RunSubWorkflow.php b/op/op.RunSubWorkflow.php index 3e08f5725..092e03710 100644 --- a/op/op.RunSubWorkflow.php +++ b/op/op.RunSubWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.SchedulerTaskMgr.php b/op/op.SchedulerTaskMgr.php index c38c5e595..19f989e36 100644 --- a/op/op.SchedulerTaskMgr.php +++ b/op/op.SchedulerTaskMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.SetExpires.php b/op/op.SetExpires.php index 5efd3eee6..f18a7d303 100644 --- a/op/op.SetExpires.php +++ b/op/op.SetExpires.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.SetLanguage.php b/op/op.SetLanguage.php index 06c07651b..9cb0b2d02 100644 --- a/op/op.SetLanguage.php +++ b/op/op.SetLanguage.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.SetReviewersApprovers.php b/op/op.SetReviewersApprovers.php index 7e882ce56..5acb7fc9b 100644 --- a/op/op.SetReviewersApprovers.php +++ b/op/op.SetReviewersApprovers.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.SetWorkflow.php b/op/op.SetWorkflow.php index 13a961c00..8e9a9fda8 100644 --- a/op/op.SetWorkflow.php +++ b/op/op.SetWorkflow.php @@ -20,6 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.Settings.php b/op/op.Settings.php index e5fd20067..938c61b28 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.SubstituteUser.php b/op/op.SubstituteUser.php index d1621f147..160747d6f 100644 --- a/op/op.SubstituteUser.php +++ b/op/op.SubstituteUser.php @@ -17,6 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.TransferDocument.php b/op/op.TransferDocument.php index 7cae741e5..e00afdd5f 100644 --- a/op/op.TransferDocument.php +++ b/op/op.TransferDocument.php @@ -19,12 +19,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); diff --git a/op/op.TransmittalDownload.php b/op/op.TransmittalDownload.php index 57abc5b1f..f5e3de544 100644 --- a/op/op.TransmittalDownload.php +++ b/op/op.TransmittalDownload.php @@ -20,9 +20,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); -include("../inc/inc.Utils.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); diff --git a/op/op.TransmittalMgr.php b/op/op.TransmittalMgr.php index 73bbc1f52..f58f6de12 100644 --- a/op/op.TransmittalMgr.php +++ b/op/op.TransmittalMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.TriggerWorkflow.php b/op/op.TriggerWorkflow.php index a42511316..298e9849b 100644 --- a/op/op.TriggerWorkflow.php +++ b/op/op.TriggerWorkflow.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.UnlockDocument.php b/op/op.UnlockDocument.php index 576ea593d..467106bc3 100644 --- a/op/op.UnlockDocument.php +++ b/op/op.UnlockDocument.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index 1885a34f5..74d33ac6c 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.UpdateDocument2.php b/op/op.UpdateDocument2.php index f3ef0e008..318026e7d 100644 --- a/op/op.UpdateDocument2.php +++ b/op/op.UpdateDocument2.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.UploadChunks.php b/op/op.UploadChunks.php index a05f18562..e5855423e 100644 --- a/op/op.UploadChunks.php +++ b/op/op.UploadChunks.php @@ -20,7 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); +include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.UserDefaultKeywords.php b/op/op.UserDefaultKeywords.php index 93d03b845..6dddb58f1 100644 --- a/op/op.UserDefaultKeywords.php +++ b/op/op.UserDefaultKeywords.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.UserListCsv.php b/op/op.UserListCsv.php index 805787a62..1cc485721 100644 --- a/op/op.UserListCsv.php +++ b/op/op.UserListCsv.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.UsrMgr.php b/op/op.UsrMgr.php index 2dc304c5f..04401e52b 100644 --- a/op/op.UsrMgr.php +++ b/op/op.UsrMgr.php @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); include("../inc/inc.DBInit.php"); -include("../inc/inc.ClassAccessOperation.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.Authentication.php"); include("../inc/inc.ClassPasswordStrength.php"); diff --git a/op/op.ViewOnline.php b/op/op.ViewOnline.php index a5f8f1292..245d965e8 100644 --- a/op/op.ViewOnline.php +++ b/op/op.ViewOnline.php @@ -19,6 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); +include("../inc/inc.Utils.php"); include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); diff --git a/op/op.WorkflowActionsMgr.php b/op/op.WorkflowActionsMgr.php index fb91f0029..6ff1efe4e 100644 --- a/op/op.WorkflowActionsMgr.php +++ b/op/op.WorkflowActionsMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.WorkflowMgr.php b/op/op.WorkflowMgr.php index 7873ed88e..de6c72d24 100644 --- a/op/op.WorkflowMgr.php +++ b/op/op.WorkflowMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/op/op.WorkflowStatesMgr.php b/op/op.WorkflowStatesMgr.php index f80423001..b27342869 100644 --- a/op/op.WorkflowStatesMgr.php +++ b/op/op.WorkflowStatesMgr.php @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Language.php"); include("../inc/inc.Init.php"); include("../inc/inc.Extension.php"); diff --git a/out/out.AddDocument.php b/out/out.AddDocument.php index 8351afc35..84df7af84 100644 --- a/out/out.AddDocument.php +++ b/out/out.AddDocument.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); @@ -34,7 +34,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); $accessop = new SeedDMS_AccessOperation($dms, $user, $settings); if (!$accessop->check_view_access($view, $_GET)) { - UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("access_denied")); + UI::exitError(getMLText("folder_title", array("foldername" => '')),getMLText("access_denied")); } if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) { diff --git a/out/out.AddEvent.php b/out/out.AddEvent.php index 4638cd2f2..607a2f10a 100644 --- a/out/out.AddEvent.php +++ b/out/out.AddEvent.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.AddFile.php b/out/out.AddFile.php index 1cbdcda0e..c26c77e5f 100644 --- a/out/out.AddFile.php +++ b/out/out.AddFile.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.AddSubFolder.php b/out/out.AddSubFolder.php index 6ce343da5..3bc04ba10 100644 --- a/out/out.AddSubFolder.php +++ b/out/out.AddSubFolder.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.AdminTools.php b/out/out.AdminTools.php index 47eb46246..21bd9d42f 100644 --- a/out/out.AdminTools.php +++ b/out/out.AdminTools.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ApprovalSummary.php b/out/out.ApprovalSummary.php index e2c54d878..3699c7241 100644 --- a/out/out.ApprovalSummary.php +++ b/out/out.ApprovalSummary.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ApproveDocument.php b/out/out.ApproveDocument.php index f10dc368e..921869c52 100644 --- a/out/out.ApproveDocument.php +++ b/out/out.ApproveDocument.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.AttributeMgr.php b/out/out.AttributeMgr.php index f53f84c7a..a00f2bed7 100644 --- a/out/out.AttributeMgr.php +++ b/out/out.AttributeMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.BackupTools.php b/out/out.BackupTools.php index cb40cabe0..c8c9e8dc7 100644 --- a/out/out.BackupTools.php +++ b/out/out.BackupTools.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Calendar.php b/out/out.Calendar.php index b3ca7fb57..6104b96ba 100644 --- a/out/out.Calendar.php +++ b/out/out.Calendar.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.ClassCalendar.php"); require_once("inc/inc.Language.php"); diff --git a/out/out.Categories.php b/out/out.Categories.php index 672d32c00..c1634a463 100644 --- a/out/out.Categories.php +++ b/out/out.Categories.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.CategoryChooser.php b/out/out.CategoryChooser.php index b1fed4a5b..b690ffa78 100644 --- a/out/out.CategoryChooser.php +++ b/out/out.CategoryChooser.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.ClassUI.php"); require_once("inc/inc.Language.php"); diff --git a/out/out.ChangePassword.php b/out/out.ChangePassword.php index d734e7fc5..93ba0cb3b 100644 --- a/out/out.ChangePassword.php +++ b/out/out.ChangePassword.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Charts.php b/out/out.Charts.php index 813f84cf5..1b3645df4 100644 --- a/out/out.Charts.php +++ b/out/out.Charts.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Clipboard.php b/out/out.Clipboard.php index 91dbb4238..4460a3012 100644 --- a/out/out.Clipboard.php +++ b/out/out.Clipboard.php @@ -22,6 +22,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.CreateIndex.php b/out/out.CreateIndex.php index 36faf749d..35986561d 100644 --- a/out/out.CreateIndex.php +++ b/out/out.CreateIndex.php @@ -22,7 +22,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.DefaultKeywords.php b/out/out.DefaultKeywords.php index bc0f1b02f..0156b22f0 100644 --- a/out/out.DefaultKeywords.php +++ b/out/out.DefaultKeywords.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.DocumentAccess.php b/out/out.DocumentAccess.php index 6704bccdc..5124b52d4 100644 --- a/out/out.DocumentAccess.php +++ b/out/out.DocumentAccess.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.DocumentChooser.php b/out/out.DocumentChooser.php index 6fc2d395d..35aec30ce 100644 --- a/out/out.DocumentChooser.php +++ b/out/out.DocumentChooser.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.DocumentNotify.php b/out/out.DocumentNotify.php index 921408650..0dbf70976 100644 --- a/out/out.DocumentNotify.php +++ b/out/out.DocumentNotify.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.DocumentVersionDetail.php b/out/out.DocumentVersionDetail.php index cf94bc90e..db35437f5 100644 --- a/out/out.DocumentVersionDetail.php +++ b/out/out.DocumentVersionDetail.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.DropFolderChooser.php b/out/out.DropFolderChooser.php index 55efd5165..112892928 100644 --- a/out/out.DropFolderChooser.php +++ b/out/out.DropFolderChooser.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.EditAttributes.php b/out/out.EditAttributes.php index 36a176be5..36f0376b7 100644 --- a/out/out.EditAttributes.php +++ b/out/out.EditAttributes.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.EditComment.php b/out/out.EditComment.php index 99e9ef629..be9be5165 100644 --- a/out/out.EditComment.php +++ b/out/out.EditComment.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.EditDocument.php b/out/out.EditDocument.php index 17a5bc0e9..ef02d51bd 100644 --- a/out/out.EditDocument.php +++ b/out/out.EditDocument.php @@ -20,14 +20,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.EditDocumentFile.php b/out/out.EditDocumentFile.php index 614c7165a..245f094df 100644 --- a/out/out.EditDocumentFile.php +++ b/out/out.EditDocumentFile.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.EditEvent.php b/out/out.EditEvent.php index d089a6863..cf7b2bbba 100644 --- a/out/out.EditEvent.php +++ b/out/out.EditEvent.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.EditFolder.php b/out/out.EditFolder.php index a4f4ced41..1e3df9304 100644 --- a/out/out.EditFolder.php +++ b/out/out.EditFolder.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.EditOnline.php b/out/out.EditOnline.php index e4d3a1dc1..b1dbdf609 100644 --- a/out/out.EditOnline.php +++ b/out/out.EditOnline.php @@ -20,13 +20,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.EditUserData.php b/out/out.EditUserData.php index cd278e5f0..834bab280 100644 --- a/out/out.EditUserData.php +++ b/out/out.EditUserData.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ErrorDlg.php b/out/out.ErrorDlg.php index 015d0377e..4f2744e20 100644 --- a/out/out.ErrorDlg.php +++ b/out/out.ErrorDlg.php @@ -24,8 +24,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ExpiredDocuments.php b/out/out.ExpiredDocuments.php index d79a37f58..414527b6b 100644 --- a/out/out.ExpiredDocuments.php +++ b/out/out.ExpiredDocuments.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ExtensionMgr.php b/out/out.ExtensionMgr.php index 763e53d47..3802eb5ea 100644 --- a/out/out.ExtensionMgr.php +++ b/out/out.ExtensionMgr.php @@ -18,7 +18,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.FolderAccess.php b/out/out.FolderAccess.php index 98dd59442..413429999 100644 --- a/out/out.FolderAccess.php +++ b/out/out.FolderAccess.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.FolderChooser.php b/out/out.FolderChooser.php index d45c13c73..1cf5b27e2 100644 --- a/out/out.FolderChooser.php +++ b/out/out.FolderChooser.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.FolderNotify.php b/out/out.FolderNotify.php index 2c370fa03..f44fcd96e 100644 --- a/out/out.FolderNotify.php +++ b/out/out.FolderNotify.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ForcePasswordChange.php b/out/out.ForcePasswordChange.php index 36189235c..4b9d7a530 100644 --- a/out/out.ForcePasswordChange.php +++ b/out/out.ForcePasswordChange.php @@ -32,6 +32,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.GroupMgr.php b/out/out.GroupMgr.php index 3e51d83de..0a73d8d70 100644 --- a/out/out.GroupMgr.php +++ b/out/out.GroupMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.GroupView.php b/out/out.GroupView.php index ad92df4bc..a798cce6a 100644 --- a/out/out.GroupView.php +++ b/out/out.GroupView.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.Help.php b/out/out.Help.php index d0683778d..f49f69e17 100644 --- a/out/out.Help.php +++ b/out/out.Help.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.Hooks.php b/out/out.Hooks.php index 57090d568..dd67d777a 100644 --- a/out/out.Hooks.php +++ b/out/out.Hooks.php @@ -18,6 +18,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ImportFS.php b/out/out.ImportFS.php index 911f2e5cd..e085aa3fb 100644 --- a/out/out.ImportFS.php +++ b/out/out.ImportFS.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ImportUsers.php b/out/out.ImportUsers.php index b847f4754..ffba296d6 100644 --- a/out/out.ImportUsers.php +++ b/out/out.ImportUsers.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.IndexInfo.php b/out/out.IndexInfo.php index 832918cd9..1d8b0e2a7 100644 --- a/out/out.IndexInfo.php +++ b/out/out.IndexInfo.php @@ -21,7 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.Indexer.php b/out/out.Indexer.php index d514da3ce..698d175d9 100644 --- a/out/out.Indexer.php +++ b/out/out.Indexer.php @@ -21,7 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.Info.php b/out/out.Info.php index 9c891f180..557b78a91 100644 --- a/out/out.Info.php +++ b/out/out.Info.php @@ -21,7 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.KeywordChooser.php b/out/out.KeywordChooser.php index b1402036b..a0d2eb420 100644 --- a/out/out.KeywordChooser.php +++ b/out/out.KeywordChooser.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.LogManagement.php b/out/out.LogManagement.php index 9f0175efd..0e01eed3f 100644 --- a/out/out.LogManagement.php +++ b/out/out.LogManagement.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); @@ -39,7 +39,7 @@ if (isset($_GET["logname"])) $logname=basename($_GET["logname"], '.log').'.log'; else $logname=NULL; if (isset($_GET["mode"])) $mode=$_GET["mode"]; -else $mode='web'; +else $mode='default'; if($view) { $view->setParam('logname', $logname); diff --git a/out/out.Login.php b/out/out.Login.php index 5d3f19ca5..d929c81b7 100644 --- a/out/out.Login.php +++ b/out/out.Login.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ManageNotify.php b/out/out.ManageNotify.php index 05e7f0adf..0a393a56f 100644 --- a/out/out.ManageNotify.php +++ b/out/out.ManageNotify.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.MoveDocument.php b/out/out.MoveDocument.php index 921518611..d766ecbcd 100644 --- a/out/out.MoveDocument.php +++ b/out/out.MoveDocument.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.MoveFolder.php b/out/out.MoveFolder.php index fc86bd506..022099419 100644 --- a/out/out.MoveFolder.php +++ b/out/out.MoveFolder.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.MyAccount.php b/out/out.MyAccount.php index 7dd28c374..48322b824 100644 --- a/out/out.MyAccount.php +++ b/out/out.MyAccount.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.MyDocuments.php b/out/out.MyDocuments.php index dab3ad37e..743ba8c49 100644 --- a/out/out.MyDocuments.php +++ b/out/out.MyDocuments.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.NotificationServices.php b/out/out.NotificationServices.php index 9367fcf44..f985d37ed 100644 --- a/out/out.NotificationServices.php +++ b/out/out.NotificationServices.php @@ -18,6 +18,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ObjectCheck.php b/out/out.ObjectCheck.php index a616165cc..47f345a0c 100644 --- a/out/out.ObjectCheck.php +++ b/out/out.ObjectCheck.php @@ -21,7 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.Version.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); @@ -98,6 +98,10 @@ if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateContent') $duplicateversions = $dms->getDuplicateDocumentContent(); else $duplicateversions = null; +if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateSequence') + $duplicatesequences = $dms->getDuplicateSequenceNo(); +else + $duplicatesequences = null; $processwithoutusergroup = array(); foreach(array('review', 'approval', 'receipt', 'revision') as $process) { foreach(array('user', 'group') as $ug) { @@ -225,6 +229,11 @@ if(!isset($_GET['action']) || $_GET['action'] == 'listRepair') else $repairobjects = null; +if(isset($_GET['repairfolderid']) && is_numeric($_GET['repairfolderid'])) + $repairfolder = $dms->getFolder($_GET['repairfolderid']); +else + $repairfolder = null; + if($view) { $view->setParam('folder', $folder); $view->setParam('showtree', showtree()); @@ -236,6 +245,7 @@ if($view) { $view->setParam('nochecksumversions', $nochecksumversions); $view->setParam('wrongfiletypeversions', $wrongfiletypeversions); $view->setParam('duplicateversions', $duplicateversions); + $view->setParam('duplicatesequences', $duplicatesequences); $view->setParam('docsinrevision', $docsinrevision); $view->setParam('docsmissingrevsiondate', $docsmissingrevsiondate); $view->setParam('docsinreception', $docsinreception); @@ -245,6 +255,7 @@ if($view) { $view->setParam('setchecksum', $setchecksum); $view->setParam('setfiletype', $setfiletype); $view->setParam('repair', $repair); + $view->setParam('repairfolder', $repairfolder); $view->setParam('showtree', showtree()); $view->setParam('rootfolder', $rootfolder); $view->setParam('repairobjects', $repairobjects); diff --git a/out/out.OpensearchDesc.php b/out/out.OpensearchDesc.php index 5d34d75b9..1055d87dd 100644 --- a/out/out.OpensearchDesc.php +++ b/out/out.OpensearchDesc.php @@ -20,18 +20,19 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); require_once("inc/inc.ClassAccessOperation.php"); -require_once("inc/inc.Authentication.php"); +// No authentication because browsers do not send cookies when fetching the opensearch desc +//require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); +$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=null)); if($view) { $view($_GET); exit; diff --git a/out/out.OverrideContentStatus.php b/out/out.OverrideContentStatus.php index c6a0be1e9..478a5a026 100644 --- a/out/out.OverrideContentStatus.php +++ b/out/out.OverrideContentStatus.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.PasswordForgotten.php b/out/out.PasswordForgotten.php index deadffb54..0a036b64a 100644 --- a/out/out.PasswordForgotten.php +++ b/out/out.PasswordForgotten.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.PasswordSend.php b/out/out.PasswordSend.php index 8acf55af0..bd07ccbe7 100644 --- a/out/out.PasswordSend.php +++ b/out/out.PasswordSend.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveApprovalLog.php b/out/out.RemoveApprovalLog.php index c3c37c743..595a33fa8 100644 --- a/out/out.RemoveApprovalLog.php +++ b/out/out.RemoveApprovalLog.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RemoveArchive.php b/out/out.RemoveArchive.php index 76bf678fd..690d859d3 100644 --- a/out/out.RemoveArchive.php +++ b/out/out.RemoveArchive.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); @@ -42,6 +43,7 @@ $arkname = $_GET["arkname"]; if($view) { $view->setParam('archive', $arkname); + $view->setParam('accessobject', $accessop); $view($_GET); exit; } diff --git a/out/out.RemoveDocument.php b/out/out.RemoveDocument.php index 4df8d6976..6ae707c2a 100644 --- a/out/out.RemoveDocument.php +++ b/out/out.RemoveDocument.php @@ -20,14 +20,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.RemoveDocumentFile.php b/out/out.RemoveDocumentFile.php index 614c7165a..3bb662c2e 100644 --- a/out/out.RemoveDocumentFile.php +++ b/out/out.RemoveDocumentFile.php @@ -19,14 +19,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.RemoveDump.php b/out/out.RemoveDump.php index 8a75999a0..249c07ac5 100644 --- a/out/out.RemoveDump.php +++ b/out/out.RemoveDump.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveEvent.php b/out/out.RemoveEvent.php index 5a261568f..ee63ad8d6 100644 --- a/out/out.RemoveEvent.php +++ b/out/out.RemoveEvent.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveFolder.php b/out/out.RemoveFolder.php index df96fc2b4..f5d704b8d 100644 --- a/out/out.RemoveFolder.php +++ b/out/out.RemoveFolder.php @@ -20,8 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RemoveFolderFiles.php b/out/out.RemoveFolderFiles.php index 7c2c50c14..3ffea672b 100644 --- a/out/out.RemoveFolderFiles.php +++ b/out/out.RemoveFolderFiles.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveGroup.php b/out/out.RemoveGroup.php index 83ba873b0..e5e2d50f2 100644 --- a/out/out.RemoveGroup.php +++ b/out/out.RemoveGroup.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveLog.php b/out/out.RemoveLog.php index cd6907f3f..b9ea1aa52 100644 --- a/out/out.RemoveLog.php +++ b/out/out.RemoveLog.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveReviewLog.php b/out/out.RemoveReviewLog.php index 98c92b66c..77dbf14e1 100644 --- a/out/out.RemoveReviewLog.php +++ b/out/out.RemoveReviewLog.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RemoveUser.php b/out/out.RemoveUser.php index fd67f18fa..5e13909b8 100644 --- a/out/out.RemoveUser.php +++ b/out/out.RemoveUser.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveUserFromProcesses.php b/out/out.RemoveUserFromProcesses.php index 14fdf3cfc..7331dc721 100644 --- a/out/out.RemoveUserFromProcesses.php +++ b/out/out.RemoveUserFromProcesses.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RemoveVersion.php b/out/out.RemoveVersion.php index 3d0f24b28..c474fa83f 100644 --- a/out/out.RemoveVersion.php +++ b/out/out.RemoveVersion.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RemoveWorkflow.php b/out/out.RemoveWorkflow.php index 0f1b3c7d6..90f3b68fd 100644 --- a/out/out.RemoveWorkflow.php +++ b/out/out.RemoveWorkflow.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RemoveWorkflowFromDocument.php b/out/out.RemoveWorkflowFromDocument.php index ad224f1f1..05408394f 100644 --- a/out/out.RemoveWorkflowFromDocument.php +++ b/out/out.RemoveWorkflowFromDocument.php @@ -21,14 +21,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.ReturnFromSubWorkflow.php b/out/out.ReturnFromSubWorkflow.php index 0036a7467..5cdb716d2 100644 --- a/out/out.ReturnFromSubWorkflow.php +++ b/out/out.ReturnFromSubWorkflow.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ReviewDocument.php b/out/out.ReviewDocument.php index 1a062b38b..b86634968 100644 --- a/out/out.ReviewDocument.php +++ b/out/out.ReviewDocument.php @@ -21,14 +21,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { diff --git a/out/out.ReviewSummary.php b/out/out.ReviewSummary.php index e2c54d878..3699c7241 100644 --- a/out/out.ReviewSummary.php +++ b/out/out.ReviewSummary.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.RewindWorkflow.php b/out/out.RewindWorkflow.php index ad224f1f1..23db74e09 100644 --- a/out/out.RewindWorkflow.php +++ b/out/out.RewindWorkflow.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.RunSubWorkflow.php b/out/out.RunSubWorkflow.php index 1ab6412c1..58803e8d9 100644 --- a/out/out.RunSubWorkflow.php +++ b/out/out.RunSubWorkflow.php @@ -21,14 +21,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.Search.php b/out/out.Search.php index 98b0bcd2c..674b66698 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -20,14 +20,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); function getTime() { @@ -67,11 +66,15 @@ if (isset($_GET["removecategory"]) && is_numeric($_GET["removecategory"]) && $_G $removecategory = (int) $_GET['removecategory']; } +$terms = []; +$limit = (isset($_GET["limit"]) && is_numeric($_GET["limit"])) ? (int) $_GET['limit'] : 20; $fullsearch = ((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext') || !empty($_GET["fullsearch"])) && $settings->_enableFullSearch; if($fullsearch) { // Search in Fulltext {{{ if (isset($_GET["query"]) && is_string($_GET["query"])) { $query = $_GET["query"]; + if(isset($_GET['action']) && ($_GET['action'] == 'typeahead')) + $query .= '*'; } else { $query = ""; @@ -184,10 +187,11 @@ if($fullsearch) { $searchTime = 0; } else { $startTime = getTime(); - $limit = 20; +// $limit = 20; $total = 0; $index = $fulltextservice->Indexer(); if($index) { +// $terms = $index->terms($_GET['query']); $lucenesearch = $fulltextservice->Search(); $searchresult = $lucenesearch->search($query, array('record_type'=>$record_type, 'owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); if($searchresult === false) { @@ -203,7 +207,7 @@ if($fullsearch) { $facets = $searchresult['facets']; $dcount = 0; $fcount = 0; - if($searchresult) { + if($searchresult['hits']) { foreach($searchresult['hits'] as $hit) { if($hit['document_id'][0] == 'D') { if($tmp = $dms->getDocument(substr($hit['document_id'], 1))) { @@ -506,7 +510,7 @@ if($fullsearch) { // // Default page to display is always one. $pageNumber=1; - $limit = 15; +// $limit = 15; if (isset($_GET["pg"])) { if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { $pageNumber = (int) $_GET["pg"]; @@ -610,6 +614,7 @@ if($settings->_showSingleSearchHit && count($entries) == 1) { $view->setParam('changecategory', $changecategory); $view->setParam('removecategory', $removecategory); $view->setParam('searchhits', $entries); + $view->setParam('terms', $terms); $view->setParam('totalpages', $totalPages); $view->setParam('pagenumber', $pageNumber); $view->setParam('limit', $limit); diff --git a/out/out.SendLoginData.php b/out/out.SendLoginData.php index 61fd76659..f94a73053 100644 --- a/out/out.SendLoginData.php +++ b/out/out.SendLoginData.php @@ -20,6 +20,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Session.php b/out/out.Session.php index 0e1d9c126..1d6a830b1 100644 --- a/out/out.Session.php +++ b/out/out.Session.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.SetExpires.php b/out/out.SetExpires.php index 9dafab82d..d9c6bc707 100644 --- a/out/out.SetExpires.php +++ b/out/out.SetExpires.php @@ -21,14 +21,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.SetReviewersApprovers.php b/out/out.SetReviewersApprovers.php index fad59e50c..22d9fce22 100644 --- a/out/out.SetReviewersApprovers.php +++ b/out/out.SetReviewersApprovers.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.SetWorkflow.php b/out/out.SetWorkflow.php index 0918ce10a..a26f49b09 100644 --- a/out/out.SetWorkflow.php +++ b/out/out.SetWorkflow.php @@ -21,14 +21,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { diff --git a/out/out.Settings.php b/out/out.Settings.php index f4d03173b..b94732d7a 100644 --- a/out/out.Settings.php +++ b/out/out.Settings.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.Setup2Factor.php b/out/out.Setup2Factor.php index ac41c473d..f754c864f 100644 --- a/out/out.Setup2Factor.php +++ b/out/out.Setup2Factor.php @@ -13,6 +13,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Statistic.php b/out/out.Statistic.php index 473959506..57023c219 100644 --- a/out/out.Statistic.php +++ b/out/out.Statistic.php @@ -19,8 +19,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.SubstituteUser.php b/out/out.SubstituteUser.php index 593350714..5e7122e8d 100644 --- a/out/out.SubstituteUser.php +++ b/out/out.SubstituteUser.php @@ -18,14 +18,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.Tasks.php b/out/out.Tasks.php index 443fbf7e6..3584c171d 100644 --- a/out/out.Tasks.php +++ b/out/out.Tasks.php @@ -22,6 +22,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.Timeline.php b/out/out.Timeline.php index 793fd2223..4866af560 100644 --- a/out/out.Timeline.php +++ b/out/out.Timeline.php @@ -19,14 +19,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.TransferDocument.php b/out/out.TransferDocument.php index 855e7770e..54e779693 100644 --- a/out/out.TransferDocument.php +++ b/out/out.TransferDocument.php @@ -20,14 +20,13 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); require_once("inc/inc.DBInit.php"); require_once("inc/inc.ClassUI.php"); -require_once("inc/inc.ClassAccessOperation.php"); require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); diff --git a/out/out.TransferObjects.php b/out/out.TransferObjects.php index 22f3a4081..8cd1f65b3 100644 --- a/out/out.TransferObjects.php +++ b/out/out.TransferObjects.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.TriggerWorkflow.php b/out/out.TriggerWorkflow.php index 00005ab8a..3c33c29b1 100644 --- a/out/out.TriggerWorkflow.php +++ b/out/out.TriggerWorkflow.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.UpdateDocument.php b/out/out.UpdateDocument.php index 326d1ca9a..c80d8870f 100644 --- a/out/out.UpdateDocument.php +++ b/out/out.UpdateDocument.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.UpdateDocument2.php b/out/out.UpdateDocument2.php index 97a978981..77a4e612f 100644 --- a/out/out.UpdateDocument2.php +++ b/out/out.UpdateDocument2.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.UserDefaultKeywords.php b/out/out.UserDefaultKeywords.php index 5e03452bc..4e55cfb14 100644 --- a/out/out.UserDefaultKeywords.php +++ b/out/out.UserDefaultKeywords.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.UserImage.php b/out/out.UserImage.php index 6287c3eae..3f0378472 100644 --- a/out/out.UserImage.php +++ b/out/out.UserImage.php @@ -20,6 +20,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.UserList.php b/out/out.UserList.php index 43126a043..700558906 100644 --- a/out/out.UserList.php +++ b/out/out.UserList.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.UsrMgr.php b/out/out.UsrMgr.php index ec37c2855..103c9e967 100644 --- a/out/out.UsrMgr.php +++ b/out/out.UsrMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.UsrView.php b/out/out.UsrView.php index b1870c91d..1623826d0 100644 --- a/out/out.UsrView.php +++ b/out/out.UsrView.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ViewDocument.php b/out/out.ViewDocument.php index b73bdbf2b..4fa2384b4 100644 --- a/out/out.ViewDocument.php +++ b/out/out.ViewDocument.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); diff --git a/out/out.ViewEvent.php b/out/out.ViewEvent.php index 9fa755122..689908bca 100644 --- a/out/out.ViewEvent.php +++ b/out/out.ViewEvent.php @@ -19,6 +19,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.ViewFolder.php b/out/out.ViewFolder.php index 664ed4590..dfeecb6cc 100644 --- a/out/out.ViewFolder.php +++ b/out/out.ViewFolder.php @@ -21,8 +21,8 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); -require_once("inc/inc.LogInit.php"); require_once("inc/inc.Utils.php"); +require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); require_once("inc/inc.Extension.php"); @@ -100,7 +100,7 @@ if($view) { $view->setParam('offset', $offset); $view->setParam('limit', $limit); $view->setParam('onepage', $settings->_onePageMode); // do most navigation by reloading areas of pages with ajax - $view->setParam('currenttab', 'folderinfo'); + $view->setParam('currenttab', isset($_GET['currenttab']) ? $_GET['currenttab'] : "folderinfo"); $view($_GET); exit; } diff --git a/out/out.WorkflowActionsMgr.php b/out/out.WorkflowActionsMgr.php index fb88eed3a..f20f2b7e3 100644 --- a/out/out.WorkflowActionsMgr.php +++ b/out/out.WorkflowActionsMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.WorkflowGraph.php b/out/out.WorkflowGraph.php index 850aab813..ce313fb94 100644 --- a/out/out.WorkflowGraph.php +++ b/out/out.WorkflowGraph.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.WorkflowMgr.php b/out/out.WorkflowMgr.php index b26a120a9..a727d8d0b 100644 --- a/out/out.WorkflowMgr.php +++ b/out/out.WorkflowMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.WorkflowStatesMgr.php b/out/out.WorkflowStatesMgr.php index e9ccbf878..2938f2526 100644 --- a/out/out.WorkflowStatesMgr.php +++ b/out/out.WorkflowStatesMgr.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/out/out.WorkflowSummary.php b/out/out.WorkflowSummary.php index 062765122..9c4bc32e7 100644 --- a/out/out.WorkflowSummary.php +++ b/out/out.WorkflowSummary.php @@ -21,6 +21,7 @@ if(!isset($settings)) require_once("../inc/inc.Settings.php"); +require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); require_once("inc/inc.Init.php"); diff --git a/restapi/index.php b/restapi/index.php index 696c649df..462c3c535 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -1,11 +1,41 @@ 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"; @@ -19,6 +49,22 @@ class RestapiController { /* {{{ */ $this->container = $container; } + protected function __getAttributesData($obj) { /* {{{ */ + $attributes = $obj->getAttributes(); + $attrvalues = array(); + if($attributes) { + foreach($attributes as $attrdefid=>$attribute) { + $attrdef = $attribute->getAttributeDefinition(); + $attrvalues[] = array( + 'id'=>(int) $attrdef->getId(), + 'name'=>$attrdef->getName(), + 'value'=>$attribute->getValue() + ); + } + } + return $attrvalues; + } /* }}} */ + protected function __getDocumentData($document) { /* {{{ */ $data = array( 'type'=>'document', @@ -58,19 +104,13 @@ class RestapiController { /* {{{ */ } $data['categories'] = $c; } - $attributes = $document->getAttributes(); + $attributes = $this->__getAttributesData($document); if($attributes) { - $attrvalues = array(); - foreach($attributes as $attrdefid=>$attribute) - $attrvalues[] = array('id'=>(int)$attrdefid, 'value'=>$attribute->getValue()); - $data['attributes'] = $attrvalues; + $data['attributes'] = $attributes; } - $attributes = $lc->getAttributes(); + $attributes = $this->__getAttributesData($lc); if($attributes) { - $attrvalues = array(); - foreach($attributes as $attrdefid=>$attribute) - $attrvalues[] = array('id'=>(int)$attrdefid, 'value'=>$attribute->getValue()); - $data['version-attributes'] = $attrvalues; + $data['version_attributes'] = $attributes; } return $data; } /* }}} */ @@ -117,12 +157,9 @@ class RestapiController { /* {{{ */ 'comment'=>$folder->getComment(), 'date'=>date('Y-m-d H:i:s', $folder->getDate()), ); - $attributes = $folder->getAttributes(); + $attributes = $this->__getAttributesData($folder); if($attributes) { - $attrvalues = array(); - foreach($attributes as $attrdefid=>$attribute) - $attrvalues[] = array('id'=>(int)$attrdefid, 'value'=>$attribute->getValue()); - $data['attributes'] = $attrvalues; + $data['attributes'] = $attributes; } return $data; } /* }}} */ @@ -194,38 +231,27 @@ class RestapiController { /* {{{ */ $dms = $this->container->dms; $settings = $this->container->config; + $logger = $this->container->logger; + $authenticator = $this->container->authenticator; $params = $request->getParsedBody(); - if(empty($params['user']) || empty($params['pass'])) + if(empty($params['user']) || empty($params['pass'])) { + $logger->log("Login without username or password failed", PEAR_LOG_INFO); return $response->withJson(array('success'=>false, 'message'=>'No user or password given', 'data'=>''), 400); + } $username = $params['user']; $password = $params['pass']; - - // $userobj = $dms->getUserByLogin($username); - $userobj = null; - - /* Authenticate against LDAP server {{{ */ - if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { - require_once("../inc/inc.ClassLdapAuthentication.php"); - $authobj = new SeedDMS_LdapAuthentication($dms, $settings); - $userobj = $authobj->authenticate($username, $password); - } /* }}} */ - - /* Authenticate against SeedDMS database {{{ */ - if(!$userobj) { - require_once("../inc/inc.ClassDbAuthentication.php"); - $authobj = new SeedDMS_DbAuthentication($dms, $settings); - $userobj = $authobj->authenticate($username, $password); - } /* }}} */ + $userobj = $authenticator->authenticate($username, $password); if(!$userobj) { setcookie("mydms_session", '', time()-3600, $settings->_httpRoot); + $logger->log("Login with user name '".$username."' failed", PEAR_LOG_ERR); return $response->withJson(array('success'=>false, 'message'=>'Login failed', 'data'=>''), 403); } else { require_once("../inc/inc.ClassSession.php"); $session = new SeedDMS_Session($dms->getDb()); if(!$id = $session->create(array('userid'=>$userobj->getId(), 'theme'=>$userobj->getTheme(), 'lang'=>$userobj->getLanguage()))) { - exit; + return $response->withJson(array('success'=>false, 'message'=>'Creating session failed', 'data'=>''), 500); } // Set the session cookie. @@ -236,6 +262,7 @@ class RestapiController { /* {{{ */ setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot); $dms->setUser($userobj); + $logger->log("Login with user name '".$username."' successful", PEAR_LOG_INFO); return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$this->__getUserData($userobj)), 200); } } /* }}} */ @@ -387,16 +414,8 @@ class RestapiController { /* {{{ */ $folder = $dms->getFolder($args['id']); if($folder) { if ($folder->getAccessMode($userobj) >= M_READ) { - $recs = array(); - $attributes = $folder->getAttributes(); - foreach($attributes as $attribute) { - $recs[] = array( - 'id'=>(int)$attribute->getId(), - 'value'=>$attribute->getValue(), - 'name'=>$attribute->getAttributeDefinition()->getName(), - ); - } - return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$recs), 200); + $attributes = $this->__getAttributesData($folder); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$attributes), 200); } else { return $response->withJson(array('success'=>false, 'message'=>'No access', 'data'=>''), 403); } @@ -445,6 +464,9 @@ class RestapiController { /* {{{ */ $dms = $this->container->dms; $userobj = $this->container->userobj; $settings = $this->container->config; + $logger = $this->container->logger; + $fulltextservice = $this->container->fulltextservice; + $notifier = $this->container->notifier; if(!$userobj) { return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403); @@ -474,7 +496,10 @@ class RestapiController { /* {{{ */ $newattrs = array(); if(!empty($params['attributes'])) { foreach($params['attributes'] as $attrname=>$attrvalue) { - $attrdef = $dms->getAttributeDefinitionByName($attrname); + if((is_int($attrname) || ctype_digit($attrname)) && ((int) $attrname) > 0) + $attrdef = $dms->getAttributeDefinition((int) $attrname); + else + $attrdef = $dms->getAttributeDefinitionByName($attrname); if($attrdef) { $newattrs[$attrdef->getID()] = $attrvalue; } @@ -486,9 +511,24 @@ class RestapiController { /* {{{ */ return $response->withJson(array('success'=>false, 'message'=>getMLText("subfolder_duplicate_name"), 'data'=>''), 409); } } - if($folder = $parent->addSubFolder($params['name'], $comment, $userobj, $sequence, $newattrs)) { - $rec = $this->__getFolderData($folder); + $controller = Controller::factory('AddSubFolder'); + $controller->setParam('dms', $dms); + $controller->setParam('user', $userobj); + $controller->setParam('fulltextservice', $fulltextservice); + $controller->setParam('folder', $parent); + $controller->setParam('name', $params['name']); + $controller->setParam('comment', $comment); + $controller->setParam('sequence', $sequence); + $controller->setParam('attributes', $newattrs); + $controller->setParam('notificationgroups', []); + $controller->setParam('notificationusers', []); + if($folder = $controller()) { + $rec = $this->__getFolderData($folder); + $logger->log("Creating folder '".$folder->getName()."' (".$folder->getId().") successful", PEAR_LOG_INFO); + if($notifier) { + $notifier->sendNewFolderMail($folder, $userobj); + } return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$rec), 201); } else { return $response->withJson(array('success'=>false, 'message'=>'Could not create folder', 'data'=>''), 500); @@ -644,7 +684,11 @@ class RestapiController { /* {{{ */ } $attributes = isset($params["attributes"]) ? $params["attributes"] : array(); foreach($attributes as $attrdefid=>$attribute) { - if($attrdef = $dms->getAttributeDefinition($attrdefid)) { + if((is_int($attrdefid) || ctype_digit($attrdefid)) && ((int) $attrdefid) > 0) + $attrdef = $dms->getAttributeDefinition((int) $attrdefid); + else + $attrdef = $dms->getAttributeDefinitionByName($attrdefid); + if($attrdef) { if($attribute) { if(!$attrdef->validate($attribute)) { return $response->withJson(array('success'=>false, 'message'=>getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute), 'data'=>''), 400); @@ -725,7 +769,11 @@ class RestapiController { /* {{{ */ $comment = isset($params['comment']) ? $params['comment'] : null; $attributes = isset($params["attributes"]) ? $params["attributes"] : array(); foreach($attributes as $attrdefid=>$attribute) { - if($attrdef = $dms->getAttributeDefinition($attrdefid)) { + if((is_int($attrdefid) || ctype_digit($attrdefid)) && ((int) $attrdefid) > 0) + $attrdef = $dms->getAttributeDefinition((int) $attrdefid); + else + $attrdef = $dms->getAttributeDefinitionByName($attrdefid); + if($attrdef) { if($attribute) { if(!$attrdef->validate($attribute)) { return $response->withJson(array('success'=>false, 'message'=>getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute), 'data'=>''), 400); @@ -1281,16 +1329,39 @@ class RestapiController { /* {{{ */ $document = $dms->getDocument($args['id']); if($document) { if ($document->getAccessMode($userobj) >= M_READ) { - $recs = array(); - $attributes = $document->getAttributes(); - foreach($attributes as $attribute) { - $recs[] = array( - 'id'=>(int)$attribute->getId(), - 'value'=>$attribute->getValue(), - 'name'=>$attribute->getAttributeDefinition()->getName(), - ); + $attributes = $this->__getAttributesData($document); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$attributes), 200); + } else { + return $response->withJson(array('success'=>false, 'message'=>'No access', 'data'=>''), 403); + } + } else { + if($document === null) + $status=404; + else + $status=500; + return $response->withJson(array('success'=>false, 'message'=>'No document', 'data'=>''), $status); + } + } /* }}} */ + + function getDocumentContentAttributes($request, $response, $args) { /* {{{ */ + $dms = $this->container->dms; + $userobj = $this->container->userobj; + + $document = $dms->getDocument($args['id']); + if($document) { + if ($document->getAccessMode($userobj) >= M_READ) { + + $version = $document->getContentByVersion($args['version']); + if($version) { + if($version->getAccessMode($userobj) >= M_READ) { + $attributes = $this->__getAttributesData($version); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$attributes), 200); + } else { + return $response->withJson(array('success'=>false, 'message'=>'No access on version', 'data'=>''), 403); + } + } else { + return $response->withJson(array('success'=>false, 'message'=>'No version', 'data'=>''), 404); } - return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$recs), 200); } else { return $response->withJson(array('success'=>false, 'message'=>'No access', 'data'=>''), 403); } @@ -1346,7 +1417,7 @@ class RestapiController { /* {{{ */ return $response->withHeader('Content-Type', 'image/png') ->withHeader('Content-Description', 'File Transfer') ->withHeader('Content-Transfer-Encoding', 'binary') - ->withHeader('Content-Disposition', 'attachment; filename=preview-"' . $document->getID() . "-" . $object->getVersion() . "-" . $width . ".png" . '"') + ->withHeader('Content-Disposition', 'attachment; filename="preview-' . $document->getID() . "-" . $object->getVersion() . "-" . $width . ".png" . '"') ->withHeader('Content-Length', $previewer->getFilesize($object)) ->withBody($stream); } else { @@ -1496,6 +1567,171 @@ class RestapiController { /* {{{ */ } } /* }}} */ + function setDocumentAttribute($request, $response, $args) { /* {{{ */ + $dms = $this->container->dms; + $userobj = $this->container->userobj; + $logger = $this->container->logger; + + if(!$userobj) { + return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403); + return; + } + + if(!ctype_digit($args['id']) || $args['id'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No document given', 'data'=>''), 400); + return; + } + if(!ctype_digit($args['attrdefid']) || $args['attrdefid'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No attribute definition id given', 'data'=>''), 400); + return; + } + $attrdef = $dms->getAttributeDefinition($args['attrdefid']); + $doc = $dms->getDocument($args['id']); + if($doc && $attrdef) { + if($attrdef->getObjType() !== SeedDMS_Core_AttributeDefinition::objtype_document) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute definition not suitable for documents', 'data'=>''), 409); + } + + $params = $request->getParsedBody(); + if(!isset($params['value'])) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute value not set', 'data'=>''), 400); + } + $new = $doc->getAttributeValue($attrdef) ? true : false; + if(!$attrdef->validate($params['value'], $doc, $new)) { + return $response->withJson(array('success'=>false, 'message'=>'Validation of attribute value failed: '.$attrdef->getValidationError(), 'data'=>''), 400); + } + if($doc->getAccessMode($userobj, 'setDocumentAttribute') > M_READ) { + if ($doc->setAttributeValue($attrdef, $params['value'])) { + $logger->log("Setting attribute '".$attrdef->getName()."' (".$attrdef->getId().") to '".$params['value']."' successful", PEAR_LOG_INFO); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>''), 201); + } else { + return $response->withJson(array('success'=>false, 'message'=>'Could not set attribute value of document', 'data'=>''), 500); + } + } else { + return $response->withJson(array('success'=>false, 'message'=>'No access on document', 'data'=>''), 403); + } + } else { + if(!$doc) + return $response->withJson(array('success'=>false, 'message'=>'No such document', 'data'=>''), 404); + if(!$attrdef) + return $response->withJson(array('success'=>false, 'message'=>'No such attr definition', 'data'=>''), 404); + return $response->withJson(array('success'=>false, 'message'=>'Could not find user or document', 'data'=>''), 500); + } + } /* }}} */ + + function setDocumentContentAttribute($request, $response, $args) { /* {{{ */ + $dms = $this->container->dms; + $userobj = $this->container->userobj; + $logger = $this->container->logger; + + if(!$userobj) { + return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403); + return; + } + + if(!ctype_digit($args['id']) || $args['id'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No document given', 'data'=>''), 400); + return; + } + if(!ctype_digit($args['version']) || $args['version'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No version number given', 'data'=>''), 400); + return; + } + if(!ctype_digit($args['attrdefid']) || $args['attrdefid'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No attribute definition id given', 'data'=>''), 400); + return; + } + $attrdef = $dms->getAttributeDefinition($args['attrdefid']); + if($doc = $dms->getDocument($args['id'])) + $version = $doc->getContentByVersion($args['version']); + if($doc && $attrdef && $version) { + if($attrdef->getObjType() !== SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute definition not suitable for document versions', 'data'=>''), 409); + } + + $params = $request->getParsedBody(); + if(!isset($params['value'])) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute value not set', 'data'=>''), 400); + } + $new = $version->getAttributeValue($attrdef) ? true : false; + if(!$attrdef->validate($params['value'], $version, $new)) { + return $response->withJson(array('success'=>false, 'message'=>'Validation of attribute value failed: '.$attrdef->getValidationError(), 'data'=>''), 400); + } + if($doc->getAccessMode($userobj, 'setDocumentContentAttribute') > M_READ) { + if ($version->setAttributeValue($attrdef, $params['value'])) { + $logger->log("Setting attribute '".$attrdef->getName()."' (".$attrdef->getId().") to '".$params['value']."' successful", PEAR_LOG_INFO); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>''), 201); + } else { + return $response->withJson(array('success'=>false, 'message'=>'Could not set attribute value of document content', 'data'=>''), 500); + } + } else { + return $response->withJson(array('success'=>false, 'message'=>'No access on document', 'data'=>''), 403); + } + } else { + if(!$doc) + return $response->withJson(array('success'=>false, 'message'=>'No such document', 'data'=>''), 404); + if(!$version) + return $response->withJson(array('success'=>false, 'message'=>'No such version', 'data'=>''), 404); + if(!$attrdef) + return $response->withJson(array('success'=>false, 'message'=>'No such attr definition', 'data'=>''), 404); + return $response->withJson(array('success'=>false, 'message'=>'Could not find user or document', 'data'=>''), 500); + } + } /* }}} */ + + function setFolderAttribute($request, $response, $args) { /* {{{ */ + $dms = $this->container->dms; + $userobj = $this->container->userobj; + $logger = $this->container->logger; + + if(!$userobj) { + return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403); + return; + } + + if(!ctype_digit($args['id']) || $args['id'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No folder given', 'data'=>''), 400); + return; + } + if(!ctype_digit($args['attrdefid']) || $args['attrdefid'] == 0) { + return $response->withJson(array('success'=>false, 'message'=>'No attribute definition id given', 'data'=>''), 400); + return; + } + $attrdef = $dms->getAttributeDefinition($args['attrdefid']); + $obj = $dms->getFolder($args['id']); + if($obj && $attrdef) { + if($attrdef->getObjType() !== SeedDMS_Core_AttributeDefinition::objtype_folder) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute definition not suitable for folders', 'data'=>''), 409); + } + + $params = $request->getParsedBody(); + if(!isset($params['value'])) { + return $response->withJson(array('success'=>false, 'message'=>'Attribute value not set', 'data'=>''.$request->getHeader('Content-Type')[0]), 400); + } + if(strlen($params['value'])) { + $new = $obj->getAttributeValue($attrdef) ? true : false; + if(!$attrdef->validate($params['value'], $obj, $new)) { + return $response->withJson(array('success'=>false, 'message'=>'Validation of attribute value failed: '.$attrdef->getValidationError(), 'data'=>''), 400); + } + } + if($obj->getAccessMode($userobj, 'setFolderAttribute') > M_READ) { + if ($obj->setAttributeValue($attrdef, $params['value'])) { + $logger->log("Setting attribute '".$attrdef->getName()."' (".$attrdef->getId().") to '".$params['value']."' successful", PEAR_LOG_INFO); + return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>''), 201); + } else { + return $response->withJson(array('success'=>false, 'message'=>'Could not set attribute value of folder', 'data'=>''), 500); + } + } else { + return $response->withJson(array('success'=>false, 'message'=>'No access on folder', 'data'=>''), 403); + } + } else { + if(!$obj) + return $response->withJson(array('success'=>false, 'message'=>'No such folder', 'data'=>''), 404); + if(!$attrdef) + return $response->withJson(array('success'=>false, 'message'=>'No such attr definition', 'data'=>''), 404); + return $response->withJson(array('success'=>false, 'message'=>'Could not find user or folder', 'data'=>''), 500); + } + } /* }}} */ + function getAccount($request, $response) { /* {{{ */ $dms = $this->container->dms; $userobj = $this->container->userobj; @@ -1631,7 +1867,10 @@ class RestapiController { /* {{{ */ $query = $params['value']; if(empty($params['limit']) || !$limit = $params['limit']) $limit = 50; - $attrdef = $dms->getAttributeDefinitionByName($attrname); + if(ctype_digit($attrname) && ((int) $attrname) > 0) + $attrdef = $dms->getAttributeDefinition((int) $attrname); + else + $attrdef = $dms->getAttributeDefinitionByName($attrname); $entries = array(); if($attrdef) { $resArr = $attrdef->getObjects($query, $limit); @@ -2014,19 +2253,19 @@ class RestapiController { /* {{{ */ } /* }}} */ function addUserAccessToFolder($request, $response, $args) { /* {{{ */ - return changeFolderAccess($request, $response, $args, 'add', 'user'); + return $this->changeFolderAccess($request, $response, $args, 'add', 'user'); } /* }}} */ function addGroupAccessToFolder($request, $response, $args) { /* {{{ */ - return changeFolderAccess($request, $response, $args, 'add', 'group'); + return $this->changeFolderAccess($request, $response, $args, 'add', 'group'); } /* }}} */ function removeUserAccessFromFolder($request, $response, $args) { /* {{{ */ - return changeFolderAccess($request, $response, $args, 'remove', 'user'); + return $this->changeFolderAccess($request, $response, $args, 'remove', 'user'); } /* }}} */ function removeGroupAccessFromFolder($request, $response, $args) { /* {{{ */ - return changeFolderAccess($request, $response, $args, 'remove', 'group'); + return $this->changeFolderAccess($request, $response, $args, 'remove', 'group'); } /* }}} */ function changeFolderAccess($request, $response, $args, $operationType, $userOrGroup) { /* {{{ */ @@ -2167,6 +2406,7 @@ class RestapiController { /* {{{ */ function createCategory($request, $response) { /* {{{ */ $dms = $this->container->dms; $userobj = $this->container->userobj; + $logger = $this->container->logger; $check = $this->checkIfAdmin($request, $response); if($check !== true) @@ -2182,6 +2422,7 @@ class RestapiController { /* {{{ */ return $response->withJson(array('success'=>false, 'message'=>'Category already exists', 'data'=>''), 409); } else { if($data = $dms->addDocumentCategory($params['name'])) { + $logger->log("Creating category '".$data->getName()."' (".$data->getId().") successful", PEAR_LOG_INFO); return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$this->__getCategoryData($data)), 201); } else { return $response->withJson(array('success'=>false, 'message'=>'Could not add category', 'data'=>''), 500); @@ -2355,11 +2596,8 @@ class TestController { /* {{{ */ } /* }}} */ } /* }}} */ -//$app = new Slim(array('mode'=>'development', '_session.handler'=>null)); -$app = new \Slim\App(); - /* Middleware for authentication */ -class Auth { /* {{{ */ +class RestapiAuth { /* {{{ */ private $container; @@ -2381,7 +2619,20 @@ class Auth { /* {{{ */ // $this->container has the DI $dms = $this->container->dms; $settings = $this->container->config; + $logger = $this->container->logger; + $userobj = null; + if($this->container->has('userobj')) + $userobj = $this->container->userobj; + + if($userobj) { + $response = $next($request, $response); + return $response; + } + + $logger->log("Invoke middleware for method ".$request->getMethod()." on '".$request->getUri()->getPath()."'", PEAR_LOG_INFO); + $logger->log("Access with method ".$request->getMethod()." on '".$request->getUri()->getPath()."'".(isset($this->container->environment['HTTP_ORIGIN']) ? " with origin ".$this->container->environment['HTTP_ORIGIN'] : ''), PEAR_LOG_INFO); if($settings->_apiOrigin && isset($this->container->environment['HTTP_ORIGIN'])) { + $logger->log("Checking origin", PEAR_LOG_DEBUG); $origins = explode(',', $settings->_apiOrigin); if(!in_array($this->container->environment['HTTP_ORIGIN'], $origins)) { return $response->withStatus(403); @@ -2391,9 +2642,11 @@ class Auth { /* {{{ */ * don't even try to authorize. */ if($request->getMethod() == 'OPTIONS') { + $logger->log("Received preflight options request", PEAR_LOG_DEBUG); } elseif(!in_array($request->getUri()->getPath(), array('login')) && substr($request->getUri()->getPath(), 0, 5) != 'echo/') { $userobj = null; if(!empty($this->container->environment['HTTP_AUTHORIZATION']) && !empty($settings->_apiKey) && !empty($settings->_apiUserId)) { + $logger->log("Authorization key: ".$this->container->environment['HTTP_AUTHORIZATION'], PEAR_LOG_DEBUG); if($settings->_apiKey == $this->container->environment['HTTP_AUTHORIZATION']) { if(!($userobj = $dms->getUser($settings->_apiUserId))) { return $response->withStatus(403); @@ -2401,18 +2654,18 @@ class Auth { /* {{{ */ } else { return $response->withStatus(403); } + $logger->log("Login with apikey as '".$userobj->getLogin()."' successful", PEAR_LOG_INFO); } else { require_once("../inc/inc.ClassSession.php"); $session = new SeedDMS_Session($dms->getDb()); if (isset($_COOKIE["mydms_session"])) { $dms_session = $_COOKIE["mydms_session"]; + $logger->log("Session key: ".$dms_session, PEAR_LOG_DEBUG); if(!$resArr = $session->load($dms_session)) { /* Delete Cookie */ setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); - if($settings->_enableGuestLogin) - $userobj = $dms->getUser($settings->_guestID); - else - return $response->withStatus(403); + $logger->log("Session for id '".$dms_session."' has gone", PEAR_LOG_ERR); + return $response->withStatus(403); } /* Load user data */ @@ -2432,6 +2685,7 @@ class Auth { /* {{{ */ return $response->withStatus(403); } } +// $logger->log("Login with user name '".$userobj->getLogin()."' successful", PEAR_LOG_INFO); $dms->setUser($userobj); } else { return $response->withStatus(403); @@ -2444,11 +2698,26 @@ class Auth { /* {{{ */ } } /* }}} */ +$app = new \Slim\App(); + $container = $app->getContainer(); $container['dms'] = $dms; $container['config'] = $settings; $container['conversionmgr'] = $conversionmgr; -$app->add(new Auth($container)); +$container['logger'] = $logger; +$container['fulltextservice'] = $fulltextservice; +$container['notifier'] = $notifier; +$container['authenticator'] = $authenticator; + +$app->add(new RestapiAuth($container)); + +if(isset($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'] as $hookObj) { + if (method_exists($hookObj, 'addMiddleware')) { + $hookObj->addMiddleware($app); + } + } +} // Make CORS preflighted request possible $app->options('/{routes:.+}', function ($request, $response, $args) { @@ -2478,6 +2747,7 @@ $app->get('/folder/{id}/children', \RestapiController::class.':getFolderChildren $app->get('/folder/{id}/parent', \RestapiController::class.':getFolderParent'); $app->get('/folder/{id}/path', \RestapiController::class.':getFolderPath'); $app->get('/folder/{id}/attributes', \RestapiController::class.':getFolderAttributes'); +$app->put('/folder/{id}/attribute/{attrdefid}', \RestapiController::class.':setFolderAttribute'); $app->post('/folder/{id}/folder', \RestapiController::class.':createFolder'); $app->put('/folder/{id}/document', \RestapiController::class.':uploadDocumentPut'); $app->post('/folder/{id}/document', \RestapiController::class.':uploadDocument'); @@ -2490,11 +2760,14 @@ $app->get('/document/{id}/content', \RestapiController::class.':getDocumentConte $app->get('/document/{id}/versions', \RestapiController::class.':getDocumentVersions'); $app->get('/document/{id}/version/{version}', \RestapiController::class.':getDocumentVersion'); $app->put('/document/{id}/version/{version}', \RestapiController::class.':updateDocumentVersion'); +$app->get('/document/{id}/version/{version}/attributes', \RestapiController::class.':getDocumentContentAttributes'); +$app->put('/document/{id}/version/{version}/attribute/{attrdefid}', \RestapiController::class.':setDocumentContentAttribute'); $app->get('/document/{id}/files', \RestapiController::class.':getDocumentFiles'); $app->get('/document/{id}/file/{fileid}', \RestapiController::class.':getDocumentFile'); $app->get('/document/{id}/links', \RestapiController::class.':getDocumentLinks'); $app->post('/document/{id}/link/{documentid}', \RestapiController::class.':addDocumentLink'); $app->get('/document/{id}/attributes', \RestapiController::class.':getDocumentAttributes'); +$app->put('/document/{id}/attribute/{attrdefid}', \RestapiController::class.':setDocumentAttribute'); $app->get('/document/{id}/preview/{version}/{width}', \RestapiController::class.':getDocumentPreview'); $app->delete('/document/{id}/categories', \RestapiController::class.':removeDocumentCategories'); $app->delete('/document/{id}/category/{catid}', \RestapiController::class.':removeDocumentCategory'); @@ -2529,6 +2802,14 @@ $app->get('/attributedefinitions', \RestapiController::class.':getAttributeDefin $app->put('/attributedefinitions/{id}/name', \RestapiController::class.':changeAttributeDefinitionName'); $app->get('/echo/{data}', \TestController::class.':echoData'); $app->get('/statstotal', \RestapiController::class.':getStatsTotal'); + +if(isset($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'] as $hookObj) { + if (method_exists($hookObj, 'addRoute')) { + $hookObj->addRoute($app); + } + } +} + $app->run(); -?> diff --git a/restapi/swagger.yaml b/restapi/swagger.yaml index 4375e09e1..f19c5299c 100644 --- a/restapi/swagger.yaml +++ b/restapi/swagger.yaml @@ -13,6 +13,9 @@ info: license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" +servers: + - url: + description: Current host server host: "" basePath: "_httpRoot; ?>restapi/index.php" tags: @@ -22,6 +25,7 @@ tags: description: "Find out more about our store" url: "https://www.seeddms.org" schemes: +- "http" - "https" paths: /login: @@ -32,9 +36,9 @@ paths: description: "Log in by providing a username and password" operationId: "login" produces: - - "application/json" + - "application/json" consumes: - - application/x-www-form-urlencoded + - "application/x-www-form-urlencoded" parameters: - name: "user" in: "formData" @@ -111,7 +115,7 @@ paths: produces: - "application/json" consumes: - - application/x-www-form-urlencoded + - "application/x-www-form-urlencoded" parameters: - in: formData name: email @@ -138,7 +142,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - in: formData name: email @@ -208,7 +212,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - in: "formData" name: "user" @@ -371,7 +375,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -431,7 +435,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - in: "formData" name: "name" @@ -687,11 +691,106 @@ paths: $ref: "#/definitions/ApiResponse" security: - api_key: [] + /document/{id}/version/{version}/attributes: + get: + tags: + - "document" + summary: "Return attributes of document version" + description: "Returns the attributes of a given document version" + operationId: "getDocumentContentAttributes" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "ID of document whose attributes to be returned." + type: "integer" + required: true + format: "int64" + - name: "version" + in: "path" + description: "Version number of document" + required: true + type: "integer" + format: "int64" + responses: + "200": + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponseAttributes" + "403": + description: "No access" + schema: + $ref: "#/definitions/ApiResponse" + "404": + description: "Document or version not found" + schema: + $ref: "#/definitions/ApiResponse" + "500": + description: "Internal error" + schema: + $ref: "#/definitions/ApiResponse" + security: + - api_key: [] + /document/{id}/version/{version}/attribute/{attrdefid}: + put: + tags: + - "document" + summary: "Set document version attribute" + description: "Sets the attribute value of a document version. If the value is an empty string the attribute will be deleted." + operationId: "setDocumentContentAttribute" + produces: + - "application/json" + consumes: + - "application/x-www-form-urlencoded" + parameters: + - name: "id" + in: "path" + description: "ID of document" + required: true + type: "integer" + format: "int64" + - name: "version" + in: "path" + description: "Version number of document" + required: true + type: "integer" + format: "int64" + - name: "attrdefid" + in: "path" + description: "ID of attribute definition" + required: true + type: "integer" + format: "int64" + - in: "formData" + name: "value" + type: "string" + description: "Value of attribute" + required: true + responses: + "201": + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + "400": + description: "Invalid attribute value, or setting an attribute not allowed for the type of object" + schema: + $ref: "#/definitions/ApiResponse" + "403": + description: "No access" + schema: + $ref: "#/definitions/ApiResponse" + "404": + description: "Document, version or attribute definition not found" + schema: + $ref: "#/definitions/ApiResponse" + security: + - api_key: [] /document/{id}/attributes: get: tags: - "document" - summary: "Return attributes of document by ID" + summary: "Return attributes of document" description: "Returns the attributes of a given document" operationId: "getDocumentAttributes" produces: @@ -722,11 +821,59 @@ paths: $ref: "#/definitions/ApiResponse" security: - api_key: [] + /document/{id}/attribute/{attrdefid}: + put: + tags: + - "document" + summary: "Set document attribute" + description: "Sets the attribute value of a document. If the value is an empty string the attribute will be deleted." + operationId: "setDocumentAttribute" + produces: + - "application/json" + consumes: + - "application/x-www-form-urlencoded" + parameters: + - name: "id" + in: "path" + description: "ID of document" + required: true + type: "integer" + format: "int64" + - name: "attrdefid" + in: "path" + description: "ID of attribute definition" + required: true + type: "integer" + format: "int64" + - in: "formData" + name: "value" + type: "string" + description: "Value of attribute" + required: true + responses: + "201": + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + "400": + description: "Invalid attribute value, or setting an attribute not allowed for the type of object" + schema: + $ref: "#/definitions/ApiResponse" + "403": + description: "No access" + schema: + $ref: "#/definitions/ApiResponse" + "404": + description: "Document or attribute definition not found" + schema: + $ref: "#/definitions/ApiResponse" + security: + - api_key: [] /document/{id}/files: get: tags: - "document" - summary: "Return attached files of document by ID" + summary: "Return attached files of document" description: "Returns the attached files of a given document" operationId: "getDocumentFiles" produces: @@ -802,7 +949,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -920,7 +1067,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -957,7 +1104,6 @@ paths: $ref: "#/definitions/ApiResponse" security: - api_key: [] - /document/{id}/category/{catid}: delete: tags: - "document" @@ -1008,7 +1154,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -1223,7 +1369,7 @@ paths: get: tags: - "folder" - summary: "Return attributes of folder by ID" + summary: "Return attributes of folder" description: "Returns the attributes of a given folder" operationId: "getFolderAttributes" produces: @@ -1254,6 +1400,54 @@ paths: $ref: "#/definitions/ApiResponse" security: - api_key: [] + /folder/{id}/attribute/{attrdefid}: + put: + tags: + - "folder" + summary: "Set folder attribute" + description: "Sets the attribute value of a folder. If the value is an empty string the attribute will be deleted." + operationId: "setFolderAttribute" + produces: + - "application/json" + consumes: + - "application/x-www-form-urlencoded" + parameters: + - name: "id" + in: "path" + description: "ID of folder" + required: true + type: "integer" + format: "int64" + - name: "attrdefid" + in: "path" + description: "ID of attribute definition" + required: true + type: "integer" + format: "int64" + - in: "formData" + name: "value" + type: "string" + description: "Value of attribute" + required: true + responses: + "201": + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + "400": + description: "Invalid attribute value, or setting an attribute not allowed for the type of object" + schema: + $ref: "#/definitions/ApiResponse" + "403": + description: "No access" + schema: + $ref: "#/definitions/ApiResponse" + "404": + description: "Folder or attribute definition not found" + schema: + $ref: "#/definitions/ApiResponse" + security: + - api_key: [] /folder/{id}/folder: post: tags: @@ -1264,7 +1458,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -1316,7 +1510,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -1390,7 +1584,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - in: "formData" name: "name" @@ -1487,7 +1681,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -1543,7 +1737,7 @@ paths: produces: - "application/json" consumes: - - multipart/form-data + - "application/x-www-form-urlencoded" parameters: - name: "id" in: "path" @@ -1570,10 +1764,28 @@ paths: $ref: "#/definitions/ApiResponse" security: - api_key: [] + /statstotal: + get: + tags: + - "misc" + summary: "Return various statistical data" + description: "Just returns the body content" + operationId: "getStatsTotal" + produces: + - "application/json" + responses: + "200": + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + "400": + description: "Invalid status value" + security: + - api_key: [] /echo: get: tags: - - "test" + - "misc" summary: "Return what was send in the body" description: "Just returns the body content" operationId: "echoData" diff --git a/utils/delete.php b/utils/delete.php new file mode 100644 index 000000000..ec7282a38 --- /dev/null +++ b/utils/delete.php @@ -0,0 +1,179 @@ +] [-h] [-v] -f -e -d ".PHP_EOL; + echo PHP_EOL; + echo "Description:".PHP_EOL; + echo " This program deletes a folder or document.".PHP_EOL; + echo PHP_EOL; + echo "Options:".PHP_EOL; + echo " -h, --help: print usage information and exit.".PHP_EOL; + echo " -v, --version: print version and exit.".PHP_EOL; + echo " --config: set alternative config file.".PHP_EOL; + echo " -f : id of folder to be deleted".PHP_EOL; + echo " -e : id of folder to be emptied".PHP_EOL; + echo " -d : id of document to be deleted".PHP_EOL; + echo " -u : login name of user".PHP_EOL; + echo PHP_EOL; + echo "If the user is not given the user with id 1 will be used.".PHP_EOL; + echo "The options -d, -e and -f can be passed multiple times or the option value".PHP_EOL; + echo "can be a comma separated list of ids.".PHP_EOL; +} /* }}} */ + +$version = "0.0.1"; +$shortoptions = "e:f:d:u:hv"; +$longoptions = array('help', 'version', 'config:'); +if(false === ($options = getopt($shortoptions, $longoptions))) { + usage(); + exit(0); +} + +/* Print help and exit */ +if(isset($options['h']) || isset($options['help'])) { + usage(); + exit(0); +} + +/* Print version and exit */ +if(isset($options['v']) || isset($options['verѕion'])) { + echo $version.PHP_EOL; + exit(0); +} + +/* Set alternative config file */ +if(isset($options['config'])) { + define('SEEDDMS_CONFIG_FILE', $options['config']); +} elseif(isset($_SERVER['SEEDDMS_CONFIG_FILE'])) { + define('SEEDDMS_CONFIG_FILE', $_SERVER['SEEDDMS_CONFIG_FILE']); +} + +/* Set folders to be deleted */ +$folderids = array(); +if(isset($options['f'])) { + if(is_string($options['f'])) + $folderids = explode(',', $options['f']); + else + $folderids = $options['f']; +} + +/* Set folders to be emptied */ +$emptyids = array(); +if(isset($options['e'])) { + if(is_string($options['e'])) + $emptyids = explode(',', $options['e']); + else + $emptyids = $options['e']; +} + +/* Set documents to be deleted */ +$documentids = array(); +if(isset($options['d'])) { + if(is_string($options['d'])) + $documentids = explode(',', $options['d']); + else + $documentids = $options['d']; +} + +if(!$documentids && !$folderids && !$emptyids) { + echo "Neither folder ids nor document ids were given".PHP_EOL; + usage(); + exit(1); +} + +$username = ''; +if(isset($options['u'])) { + $username = $options['u']; +} + +include($myincpath."/inc/inc.Settings.php"); +include($myincpath."/inc/inc.Init.php"); +include($myincpath."/inc/inc.Extension.php"); +include($myincpath."/inc/inc.DBInit.php"); +include($myincpath."/inc/inc.ClassNotificationService.php"); +include($myincpath."/inc/inc.Notification.php"); +include($myincpath."/inc/inc.ClassController.php"); + +/* Create a global user object {{{ */ +if($username) { + if(!($user = $dms->getUserByLogin($username))) { + echo "No such user '".$username."'."; + exit; + } +} else + $user = $dms->getUser(1); + +$dms->setUser($user); +/* }}} */ + +foreach($folderids as $folderid) { + $folder = $dms->getFolder($folderid); + + if (!is_object($folder)) { + echo "Could not find folder with id ".$folderid.PHP_EOL; + } else { + + if ($folder->getAccessMode($user) < M_READWRITE) { + echo "Not sufficient access rights on folder with id ".$folderid.PHP_EOL; + } else { + $controller = Controller::factory('RemoveFolder', array('dms'=>$dms, 'user'=>$user)); + $controller->setParam('folder', $folder); + $controller->setParam('fulltextservice', $fulltextservice); + if(!$document = $controller->run()) { + echo "Could not remove folder with id ".$folderid.PHP_EOL; + } else { + echo "Folder with id ".$folderid." removed.".PHP_EOL; + } + } + } +} + +foreach($emptyids as $folderid) { + $folder = $dms->getFolder($folderid); + + if (!is_object($folder)) { + echo "Could not find folder with id ".$folderid.PHP_EOL; + } + + if ($folder->getAccessMode($user) < M_READWRITE) { + echo "Not sufficient access rights on folder with id ".$folderid.PHP_EOL; + } + + $controller = Controller::factory('EmptyFolder', array('dms'=>$dms, 'user'=>$user)); + $controller->setParam('folder', $folder); + $controller->setParam('fulltextservice', $fulltextservice); + if(!$document = $controller->run()) { + echo "Could not empty folder with id ".$folderid.PHP_EOL; + } else { + echo "Folder with id ".$folderid." emptied.".PHP_EOL; + } +} + +foreach($documentids as $documentid) { + $document = $dms->getDocument($documentid); + + if (!is_object($document)) { + echo "Could not find specified document with id ".$documentid.PHP_EOL; + } + + if ($document->getAccessMode($user) < M_READWRITE) { + echo "Not sufficient access rights on document with id ".$documentid.PHP_EOL; + } + + $controller = Controller::factory('RemoveDocument', array('dms'=>$dms, 'user'=>$user)); + $controller->setParam('document', $document); + $controller->setParam('fulltextservice', $fulltextservice); + if(!$document = $controller->run()) { + echo "Could not remove document with id ".$documentid.PHP_EOL; + } else { + echo "Document with id ".$documentid." removed.".PHP_EOL; + } +} + diff --git a/utils/expireddocs.php b/utils/expireddocs.php new file mode 100644 index 000000000..4c5dc2f3c --- /dev/null +++ b/utils/expireddocs.php @@ -0,0 +1,304 @@ +] [-u ] [-h] [-v] [-t] [-q] [-o] [-f ] [-u ] [-w] [-b ] [-c] -d -D ".PHP_EOL; + echo PHP_EOL; + echo "Description:".PHP_EOL; + echo " Check for files which will expire in the next days and inform the".PHP_EOL; + echo " the owner and all users watching the document.".PHP_EOL; + echo PHP_EOL; + echo "Options:".PHP_EOL; + echo " -h, --help: print usage information and exit.".PHP_EOL; + echo " -v, --version: print version and exit.".PHP_EOL; + echo " --config=: set alternative config file.".PHP_EOL; + echo " -u : login name of user".PHP_EOL; + echo " -w: send mail also to all users watching the document".PHP_EOL; + echo " -c: list also categories for each document".PHP_EOL; + echo " -f : set From field in notification mail".PHP_EOL; + echo " -b : set base for links in html email. The final link will be".PHP_EOL; + echo " out/out.ViewDocument.php. The default is".PHP_EOL; + echo " http://localhost".PHP_EOL; + echo " -d : check till n days in the future (default 14). Days always".PHP_EOL. + " start at 00:00:00 and end at 23:59:59. A value of '1' means today.".PHP_EOL; + " '-d 2' will search for documents expiring today or tomorrow.".PHP_EOL; + echo " -D : start checking in n days in the future (default 0). This value".PHP_EOL. + " must be less then -d. A value of 0 means to start checking today.".PHP_EOL. + " Any positive number will start checking in n days.".PHP_EOL. + " A negative number will look backwards in time.".PHP_EOL. + " '-d 10 -D 5' will search for documents expiring in 5 to 10 days.".PHP_EOL. + " '-d 10 -D -5' will search for documents which have expired in the last 5 days".PHP_EOL. + " or will expire in the next 10 days.".PHP_EOL; + echo " -o: list obsolete documents (default: do not list)".PHP_EOL; + echo " -t: run in test mode (will not send any mails)".PHP_EOL; + echo " -q: be quite (just output error messages)".PHP_EOL; +} /* }}} */ + +$version = "0.0.2"; +$tableformat = "%-60s %-14s"; +$tableformathtml = "%s%s"; +$baseurl = "http://localhost/"; +$mailfrom = "uwe@steinman.cx"; + +$shortoptions = "u:d:D:f:b:wtqhvo"; +$longoptions = array('help', 'version', 'config:'); +if(false === ($options = getopt($shortoptions, $longoptions))) { + usage(); + exit(0); +} + +/* Print help and exit */ +if(isset($options['h']) || isset($options['help'])) { + usage(); + exit(0); +} + +/* Print version and exit */ +if(isset($options['v']) || isset($options['verѕion'])) { + echo $version.PHP_EOL; + exit(0); +} + +/* Set alternative config file */ +if(isset($options['config'])) { + define('SEEDDMS_CONFIG_FILE', $options['config']); +} elseif(isset($_SERVER['SEEDDMS_CONFIG_FILE'])) { + define('SEEDDMS_CONFIG_FILE', $_SERVER['SEEDDMS_CONFIG_FILE']); +} + +include($myincpath."/inc/inc.Settings.php"); +include($myincpath."/inc/inc.Utils.php"); +include($myincpath."/inc/inc.Init.php"); +include($myincpath."/inc/inc.Language.php"); +include($myincpath."/inc/inc.Extension.php"); +include($myincpath."/inc/inc.DBInit.php"); + +$LANG['de_DE']['daylyDigestMail'] = 'Tägliche Benachrichtigungsmail'; +$LANG['en_GB']['daylyDigestMail'] = 'Dayly digest mail'; +$LANG['de_DE']['docsExpiringInNDays'] = 'Dokumente, die in den nächsten [days] Tagen ablaufen'; +$LANG['en_GB']['docsExpiringInNDays'] = 'Documents expiring in the next [days] days'; +$LANG['de_DE']['docsExpiringBetween'] = 'Dokumente, die zwischen dem [start] und [end] ablaufen'; +$LANG['en_GB']['docsExpiringBetween'] = 'Documents which expire between [start] and [end]'; + +require_once('Mail.php'); +require_once('Mail/mime.php'); + +$usernames = array(); +if(isset($options['u'])) { + $usernames = explode(',', $options['u']); +} + +$informwatcher = false; +if(isset($options['w'])) { + $informwatcher = true; +} + +$showcats = false; +if(isset($options['c'])) { + $showcats = true; + $tableformathtml = "%s%s%s"; +} + +$days = 14; +if(isset($options['d'])) { + $days = (int) $options['d']; +} +$enddays = 0; +if(isset($options['D'])) { + $enddays = (int) $options['D']; +} + +if($enddays >= $days) { + echo "Value of -D must be less then value of -d".PHP_EOL; + exit(1); +} + +if(isset($options['f'])) { + $mailfrom = trim($options['f']); +} + +if(isset($options['b'])) { + $baseurl = trim($options['b']); +} + +$showobsolete = false; +if(isset($options['o'])) { + $showobsolete = true; +} + +$dryrun = false; +if(isset($options['t'])) { + $dryrun = true; + echo "Running in test mode will not send any mail.".PHP_EOL; +} +$quite = false; +if(isset($options['q'])) { + $quite = true; +} + +$startts = strtotime("midnight", time()); +if(!$quite) + echo "Checking for documents expiring between ".getLongReadableDate($startts+$enddays*86400)." and ".getLongReadableDate($startts+$days*86400-1).PHP_EOL; + +$users = array(); +if(!$usernames) { + $users = $dms->getAllUsers(); +} else { + /* Create a global user object */ + foreach($usernames as $username) { + if(!$user = $dms->getUserByLogin($username)) { + echo "No such user with name '".$username."'".PHP_EOL; + exit(1); + } + $users[] = $user; + } +} + +if (!$db->createTemporaryTable("ttstatid") || !$db->createTemporaryTable("ttcontentid")) { + echo getMLText("internal_error_exit").PHP_EOL; + exit; +} + +foreach($users as $user) { + $groups = $user->getGroups(); + $groupids = array(); + foreach($groups as $group) + $groupids[] = $group->getID(); + $sendmail = false; /* Set to true if there is something to report */ + $body = ""; + $bodyhtml = "".PHP_EOL."".PHP_EOL."".PHP_EOL."SeedDMS: ".getMLText('daylyDigestMail', array(), "", $user->getLanguage())."".PHP_EOL."_httpRoot."\" />".PHP_EOL."".PHP_EOL."".PHP_EOL.""; + + /* + $queryStr = "SELECT `tblDocuments`.* FROM `tblDocuments`". + "WHERE `tblDocuments`.`owner` = '".$user->getID()."' ". + "AND `tblDocuments`.`expires` < '".($startts + $days*86400)."' ". + "AND `tblDocuments`.`expires` > '".($startts)."'"; + */ + + $queryStr = "SELECT DISTINCT a.*, `tblDocumentStatusLog`.* FROM `tblDocuments` a ". + "LEFT JOIN `ttcontentid` ON `ttcontentid`.`document` = `a`.`id` ". + "LEFT JOIN `tblDocumentContent` ON `a`.`id` = `tblDocumentContent`.`document` AND `tblDocumentContent`.`version` = `ttcontentid`.`maxVersion` ". + "LEFT JOIN `tblNotify` b ON a.`id`=b.`target` ". + "LEFT JOIN `tblDocumentStatus` ON `tblDocumentStatus`.`documentID` = `tblDocumentContent`.`document` AND `tblDocumentContent`.`version` = `tblDocumentStatus`.`version` ". + "LEFT JOIN `ttstatid` ON `ttstatid`.`statusID` = `tblDocumentStatus`.`statusID` ". + "LEFT JOIN `tblDocumentStatusLog` ON `tblDocumentStatusLog`.`statusLogID` = `ttstatid`.`maxLogID` ". + "WHERE (a.`owner` = '".$user->getID()."' ". + ($informwatcher ? " OR ((b.`userID` = '".$user->getID()."' ". + ($groupids ? "or b.`groupID` in (".implode(',', $groupids).")" : "").") ". + "AND b.`targetType` = 2) " : ""). + ") AND a.`expires` < '".($startts + $days*86400)."' ". + "AND a.`expires` > '".($startts + $enddays*86400)."' "; + if(!$showobsolete) + $queryStr .= "AND `tblDocumentStatusLog`.`status` != -2"; + + $resArr = $db->getResultArray($queryStr); + if (is_bool($resArr) && !$resArr) { + echo getMLText("internal_error_exit").PHP_EOL; + exit; + } + + $body .= "==== "; + $body .= getMLText('docsExpiringBetween', array('start'=>getReadableDate($startts + ($enddays)*86400), 'end'=>getReadableDate($startts + ($days)*86400)), "", $user->getLanguage()).PHP_EOL; + $body .= "==== "; + $body .= $user->getFullname(); + $body .= PHP_EOL.PHP_EOL; + $bodyhtml .= "

"; + $bodyhtml .= getMLText('docsExpiringBetween', array('start'=>getReadableDate($startts + ($enddays)*86400), 'end'=>getReadableDate($startts + ($days)*86400)), "", $user->getLanguage()).PHP_EOL; + $bodyhtml .= "

".PHP_EOL; + $bodyhtml .= "

"; + $bodyhtml .= $user->getFullname(); + $bodyhtml .= "

".PHP_EOL; + if (count($resArr)>0) { + $sendmail = true; + + $body .= sprintf($tableformat.PHP_EOL, getMLText("name", array(), "", $user->getLanguage()), getMLText("expires", array(), "", $user->getLanguage())); + $body .= "---------------------------------------------------------------------------------".PHP_EOL; + $bodyhtml .= "".PHP_EOL; + if($showcats) + $bodyhtml .= sprintf($tableformathtml.PHP_EOL, getMLText("name", array(), "", $user->getLanguage()), getMLText("categories", array(), "", $user->getLanguage()), getMLText("expires", array(), "", $user->getLanguage())); + else + $bodyhtml .= sprintf($tableformathtml.PHP_EOL, getMLText("name", array(), "", $user->getLanguage()), getMLText("expires", array(), "", $user->getLanguage())); + + foreach ($resArr as $res) { + if($doc = $dms->getDocument((int) $res['id'])) { + $catnames = array(); + if($cats = $doc->getCategories()) { + foreach($cats as $cat) + $catnames[] = $cat->getName(); + } + } + + $body .= sprintf($tableformat.PHP_EOL, $res["name"], (!$res["expires"] ? "-":getReadableDate($res["expires"]))); + if($showcats) + $body .= getMLText("categories", array(), "", $user->getLanguage()).": ".implode(', ', $catnames).PHP_EOL; + if($showcats) + $bodyhtml .= sprintf($tableformathtml.PHP_EOL, ''.htmlspecialchars($res["name"]).'', implode(', ', $catnames), (!$res["expires"] ? "-":getReadableDate($res["expires"]))); + else + $bodyhtml .= sprintf($tableformathtml.PHP_EOL, ''.htmlspecialchars($res["name"]).'', (!$res["expires"] ? "-":getReadableDate($res["expires"]))); + } + $bodyhtml .= "
".PHP_EOL; + + } else { + $body .= getMLText("no_docs_to_look_at", array(), "", $user->getLanguage()).PHP_EOL.PHP_EOL; + $bodyhtml .= "

".getMLText("no_docs_to_look_at", array(), "", $user->getLanguage())."

".PHP_EOL.PHP_EOL; + } + + if($sendmail) { + if($user->getEmail()) { + if(!$quite) { + echo "Send mail to ".$user->getLogin()." <".$user->getEmail().">".PHP_EOL; + echo $body; + echo "----------------------------".PHP_EOL.PHP_EOL.PHP_EOL; + echo $bodyhtml; + } + + if(!$dryrun) { + $mime = new Mail_mime(array('eol' => PHP_EOL)); + + $mime->setTXTBody($body); + $mime->setHTMLBody($bodyhtml); + + $body = $mime->get(array( + 'text_encoding'=>'8bit', + 'html_encoding'=>'8bit', + 'head_charset'=>'utf-8', + 'text_charset'=>'utf-8', + 'html_charset'=>'utf-8' + )); + $hdrs = $mime->headers(array('From' => $mailfrom, 'Subject' => 'SeedDMS: '.getMLText('daylyDigestMail', array(), "", $user->getLanguage()), 'Content-Type' => 'text/plain; charset=UTF-8')); + + $mail_params = array(); + if($settings->_smtpServer) { + $mail_params['host'] = $settings->_smtpServer; + if($settings->smtpPort) { + $mail_params['port'] = $settings->_smtpPort; + } + if($settings->smtpUser) { + $mail_params['auth'] = true; + $mail_params['username'] = $settings->_smtpUser; + $mail_params['password'] = $settings->_smtpPassword; + } + $mail = Mail::factory('smtp', $mail_params); + } else { + $mail = Mail::factory('mail'); + } + $mail->send($user->getEmail(), $hdrs, $body); + } + } else { + if(!$quite) { + echo "User ".$user->getLogin()." has no email".PHP_EOL; + } + } + } else { + if(!$quite) { + echo "No notification for user ".$user->getLogin()." needed".PHP_EOL; + } + } +} diff --git a/utils/importfs.php b/utils/importfs.php new file mode 100644 index 000000000..16323a2f5 --- /dev/null +++ b/utils/importfs.php @@ -0,0 +1,215 @@ +] [-h] [-v] -F -d ".PHP_EOL; + echo PHP_EOL; + echo "Description:".PHP_EOL; + echo " This program uploads a directory recursively into a folder of SeedDMS.".PHP_EOL; + echo PHP_EOL; + echo "Options:".PHP_EOL; + echo " -h, --help: print usage information and exit.".PHP_EOL; + echo " -v, --version: print version and exit.".PHP_EOL; + echo " --config: set alternative config file.".PHP_EOL; + echo " --user: use this user for accessing seeddms.".PHP_EOL; + echo " --exclude: exlude files/directories by name (defaults to .svn, .gitignore).".PHP_EOL; + echo " This must be just the file or directory without the path.".PHP_EOL; + echo " --filemtime: take over modification time from file.".PHP_EOL; + echo " --foldermtime: take over modification time from folder.".PHP_EOL; + echo " --basefolder: creates the base folder".PHP_EOL; + echo " -F : id of folder the file is uploaded to".PHP_EOL; + echo " -d : upload this directory".PHP_EOL; + echo " -e : encoding used by filesystem (defaults to iso-8859-1)".PHP_EOL; +} /* }}} */ + +$version = "0.0.1"; +$shortoptions = "d:F:e:hv"; +$longoptions = array('help', 'version', 'user:', 'basefolder', 'filemtime', 'foldermtime', 'exclude:', 'config:'); +if(false === ($options = getopt($shortoptions, $longoptions))) { + usage(); + exit(0); +} + +/* Print help and exit */ +if(!$options || isset($options['h']) || isset($options['help'])) { + usage(); + exit(0); +} + +/* Print version and exit */ +if(isset($options['v']) || isset($options['verѕion'])) { + echo $version.PHP_EOL; + exit(0); +} + +/* Set encoding of names in filesystem */ +$fsencoding = 'iso-8859-1'; +if(isset($options['e'])) { + $fsencoding = $options['e']; +} + +/* Set alternative config file */ +if(isset($options['config'])) { + define('SEEDDMS_CONFIG_FILE', $options['config']); +} elseif(isset($_SERVER['SEEDDMS_CONFIG_FILE'])) { + define('SEEDDMS_CONFIG_FILE', $_SERVER['SEEDDMS_CONFIG_FILE']); +} + +$excludefiles = array('.', '..'); +if(isset($options['exclude'])) { + if(is_array($options['exclude'])) + $excludefiles = array_merge($excludefiles, $options['exclude']); + else + $excludefiles[] = $options['exclude']; +} else { + $excludefiles[] = '.svn'; + $excludefiles[] = '.gitignore'; +} + +if(isset($options['user'])) { + $userlogin = $options['user']; +} else { + echo "Missing user".PHP_EOL; + usage(); + exit(1); +} + +/* check if base folder shall be created */ +$createbasefolder = false; +if(isset($options['basefolder'])) { + $createbasefolder = true; +} + +/* check if modification time shall be taken over */ +$filemtime = false; +if(isset($options['filemtime'])) { + $filemtime = true; +} +$foldermtime = false; +if(isset($options['foldermtime'])) { + $foldermtime = true; +} + +if(isset($settings->_extraPath)) + ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); + +if(isset($options['F'])) { + $folderid = (int) $options['F']; +} else { + echo "Missing folder ID".PHP_EOL; + usage(); + exit(1); +} + +$dirname = ''; +if(isset($options['d'])) { + $dirname = $options['d']; +} else { + echo "Missing import directory".PHP_EOL; + usage(); + exit(1); +} + +include($myincpath."/inc/inc.Settings.php"); +include($myincpath."/inc/inc.Utils.php"); +include($myincpath."/inc/inc.Init.php"); +include($myincpath."/inc/inc.Language.php"); +include($myincpath."/inc/inc.Extension.php"); +include($myincpath."/inc/inc.DBInit.php"); +include($myincpath."/inc/inc.ClassNotificationService.php"); +include($myincpath."/inc/inc.ClassEmailNotify.php"); +include($myincpath."/inc/inc.ClassController.php"); + +echo $settings->_contentDir.$settings->_contentOffsetDir.PHP_EOL; + +/* Create a global user object */ +if(!($user = $dms->getUserByLogin($userlogin))) { + echo "User with login '".$userlogin."' does not exists."; + exit; +} + +$folder = $dms->getFolder($folderid); +if (!is_object($folder)) { + echo "Could not find specified folder".PHP_EOL; + exit(1); +} + +if ($folder->getAccessMode($user) < M_READWRITE) { + echo "Not sufficient access rights".PHP_EOL; + exit(1); +} + +function import_folder($dirname, $folder, $filemtime, $foldermtime) { + global $user, $excludefiles, $fsencoding; + + $d = dir($dirname); + $sequence = 1; + while(false !== ($entry = $d->read())) { + $path = $dirname.'/'.$entry; + if(!in_array($entry, $excludefiles)) { + $name = iconv($fsencoding, 'utf-8', basename($path)); + if(is_file($path)) { + $filetmp = $path; + + $reviewers = array(); + $approvers = array(); + $comment = ''; + $version_comment = ''; + $reqversion = 1; + $expires = false; + $keywords = ''; + $categories = array(); + + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mimetype = finfo_file($finfo, $path); + $lastDotIndex = strrpos($name, "."); + if (is_bool($lastDotIndex) && !$lastDotIndex) $filetype = "."; + else $filetype = substr($name, $lastDotIndex); + + echo $mimetype." - ".$filetype." - ".$path.PHP_EOL; + $res = $folder->addDocument($name, $comment, $expires, $user, $keywords, + $categories, $filetmp, $name, + $filetype, $mimetype, $sequence, $reviewers, + $approvers, $reqversion, $version_comment); + + if (is_bool($res) && !$res) { + echo "Could not add document to folder".PHP_EOL; + exit(1); + } + if($filemtime) { + $newdoc = $res[0]; + $newdoc->setDate(filemtime($path)); + $lc = $newdoc->getLatestContent(); + $lc->setDate(filemtime($path)); + } + set_time_limit(1200); + } elseif(is_dir($path)) { + $newfolder = $folder->addSubFolder($name, '', $user, $sequence); + if($foldermtime) { + $newfolder->setDate(filemtime($path)); + } + import_folder($path, $newfolder, $filemtime, $foldermtime); + } + $sequence++; + } + } +} + +if($createbasefolder) { + if($newfolder = $folder->addSubFolder(basename($dirname), '', $user, 1)) { + if($foldermtime) { + $newfolder->setDate(filemtime($dirname)); + } + import_folder($dirname, $newfolder, $filemtime, $foldermtime); + } +} else { + import_folder($dirname, $folder, $filemtime, $foldermtime); +} + diff --git a/utils/indexer.php b/utils/indexer.php index 0784c6398..d04fcf1f1 100644 --- a/utils/indexer.php +++ b/utils/indexer.php @@ -89,15 +89,16 @@ function tree($dms, $fulltextservice, $folder, $indent='', $numdocs) { /* {{{ */ echo $prefix.$themes->green(" (Folder added)").PHP_EOL; $stats['folder']['add']++; } catch(Exception $e) { + $stats['folder']['error']++; echo $prefix.$themes->error(" (Timeout)").PHP_EOL; } } else { try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (Exception $e) { - $created = 0; + $indexed = 0; } - if($created >= $folder->getDate()) { + if($indexed >= $folder->getDate()) { if($config['verbosity'] >= 3) echo $prefix.$themes->italic(" (Folder unchanged)").PHP_EOL; $stats['folder']['unchanged']++; @@ -116,6 +117,7 @@ function tree($dms, $fulltextservice, $folder, $indent='', $numdocs) { /* {{{ */ echo $prefix.$themes->green(" (Folder updated)").PHP_EOL; $stats['folder']['update']++; } catch(Exception $e) { + $stats['folder']['error']++; echo $prefix.$themes->error(" (Timeout)").PHP_EOL; } } @@ -143,16 +145,17 @@ function tree($dms, $fulltextservice, $folder, $indent='', $numdocs) { /* {{{ */ echo $prefix.$themes->green(" (Document added)").PHP_EOL; $stats['document']['add']++; } catch(Exception $e) { + $stats['document']['error']++; echo $prefix.$themes->error(" (Timeout)").PHP_EOL; } } else { try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (Exception $e) { - $created = 0; + $indexed = 0; } $content = $document->getLatestContent(); - if($created >= $content->getDate()) { + if($indexed >= $content->getDate()) { if($config['verbosity'] >= 3) echo $prefix.$themes->italic(" (Document unchanged)").PHP_EOL; $stats['document']['unchanged']++; @@ -171,6 +174,7 @@ function tree($dms, $fulltextservice, $folder, $indent='', $numdocs) { /* {{{ */ echo $prefix.$themes->green(" (Document updated)").PHP_EOL; $stats['document']['update']++; } catch(Exception $e) { + $stats['document']['error']++; echo $prefix.$themes->error(" (Timeout)").PHP_EOL; } } @@ -189,9 +193,12 @@ if(!$index) { $stats['folder']['add'] = 0; $stats['folder']['unchanged'] = 0; $stats['folder']['update'] = 0; +$stats['folder']['error'] = 0; $stats['document']['add'] = 0; $stats['document']['unchanged'] = 0; $stats['document']['update'] = 0; +$stats['document']['error'] = 0; +$stats['time']['total'] = time(); $numdocs = $fulltextservice->Indexer()->count(); $folder = $dms->getFolder($settings->_rootFolderID); /* if numdocs is 0, then there is no need to check if a document/folder is already @@ -201,13 +208,17 @@ tree($dms, $fulltextservice, $folder,'', $numdocs); $index->commit(); $index->optimize(); +$stats['time']['total'] = time()-$stats['time']['total']; echo PHP_EOL; +echo $themes->black("Total Time: ".$stats['time']['total'].' sec.').PHP_EOL; echo $themes->black("Documents").PHP_EOL; echo $themes->black(" added: ".$stats['document']['add']).PHP_EOL; echo $themes->black(" updated: ".$stats['document']['update']).PHP_EOL; echo $themes->black(" unchanged: ".$stats['document']['unchanged']).PHP_EOL; +echo $themes->black(" error: ".$stats['document']['error']).PHP_EOL; echo $themes->black("Folders").PHP_EOL; echo $themes->black(" added: ".$stats['folder']['add']).PHP_EOL; echo $themes->black(" updated: ".$stats['folder']['update']).PHP_EOL; echo $themes->black(" unchanged: ".$stats['folder']['unchanged']).PHP_EOL; +echo $themes->black(" error: ".$stats['folder']['error']).PHP_EOL; diff --git a/utils/schedulercli.php b/utils/schedulercli.php index e0f0ef6c6..e45e9432f 100644 --- a/utils/schedulercli.php +++ b/utils/schedulercli.php @@ -59,8 +59,8 @@ if(isset($options['mode'])) { } include($myincpath."/inc/inc.Settings.php"); -include($myincpath."/inc/inc.LogInit.php"); include($myincpath."/inc/inc.Utils.php"); +include($myincpath."/inc/inc.LogInit.php"); include($myincpath."/inc/inc.Init.php"); include($myincpath."/inc/inc.Language.php"); include($myincpath."/inc/inc.Extension.php"); diff --git a/utils/seeddms-delete b/utils/seeddms-delete new file mode 100755 index 000000000..8e1c857fd --- /dev/null +++ b/utils/seeddms-delete @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ -z "${SEEDDMS_HOME}" ]; then + parentdir=$(dirname "$0") + export SEEDDMS_HOME=$(dirname "$parentdir") +fi + +exec php -f "${SEEDDMS_HOME}/utils/delete.php" -- "${@}" + diff --git a/utils/seeddms-expireddocs b/utils/seeddms-expireddocs new file mode 100755 index 000000000..bf95f3e40 --- /dev/null +++ b/utils/seeddms-expireddocs @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -z "${SEEDDMS_HOME}" ]; then + parentdir=$(dirname "$0") + export SEEDDMS_HOME=$(dirname "$parentdir") +fi + +php -f ${SEEDDMS_HOME}/utils/expireddocs.php -- "${@}" diff --git a/utils/seeddms-importfs b/utils/seeddms-importfs new file mode 100755 index 000000000..82ce84188 --- /dev/null +++ b/utils/seeddms-importfs @@ -0,0 +1,7 @@ +#!/bin/sh +if [ -z "${SEEDDMS_HOME}" ]; then + parentdir=$(dirname "$0") + export SEEDDMS_HOME=$(dirname "$parentdir") +fi + +php -f ${SEEDDMS_HOME}/utils/importfs.php -- "$@" diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index b5a08c1b6..e0b6e70ae 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -182,7 +182,7 @@ $(document).ready( function() { - + formSubmit(' '.getMLText('rm_attrdef'),'','','secondary');?> "; - if ($i +1 < count($path)) { - $txtpath .= "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">". + if ($i+1 < count($path)) { + $txtpath .= "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" data-name=\"".htmlspecialchars($path[$i]->getName())."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">". htmlspecialchars($path[$i]->getName()).""; } else { - $txtpath .= ($tagAll ? "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\">".htmlspecialchars($path[$i]->getName())."" : htmlspecialchars($path[$i]->getName())); + $txtpath .= ($tagAll ? "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" data-name=\"".htmlspecialchars($path[$i]->getName())."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">".htmlspecialchars($path[$i]->getName())."" : htmlspecialchars($path[$i]->getName())); } $txtpath .= " /"; } if($document) - $txtpath .= "
  • params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getId()."\">".htmlspecialchars($document->getName())."
  • "; + $txtpath .= "
  • params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getId()."\" class=\"table-document-row\" rel=\"document_".$document->getId()."\" data-name=\"".htmlspecialchars($document->getName())."\" formtoken=\"".createFormKey('')."\">".htmlspecialchars($document->getName())."
  • "; return ''; } /* }}} */ @@ -1330,6 +1330,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);; case 'danger': $class = 'btn-danger'; break; + case 'secondary': + $class = 'btn-secondary'; + break; + case 'neutral': + $class = ''; + break; case 'primary': default: $class = 'btn-primary'; @@ -3367,6 +3373,11 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) $content .= ""; $content .= $this->documentListRowAction($document, $previewer, $skipcont, $version, $extracontent); $content .= ""; + if(!empty($extracontent['columns_last'])) { + foreach($extracontent['columns_last'] as $col) + $content .= ''.$col.''; + } + if(!$skipcont) $content .= $this->documentListRowEnd($document); } diff --git a/views/bootstrap/class.Calendar.php b/views/bootstrap/class.Calendar.php index bf37d2b9f..3e09a3d00 100644 --- a/views/bootstrap/class.Calendar.php +++ b/views/bootstrap/class.Calendar.php @@ -120,7 +120,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style { ">

    htmlspecialchars($event["name"])));?>

    - + formSubmit(" ".getMLText('delete'),'','','danger'); ?> contentContainerEnd(); diff --git a/views/bootstrap/class.Categories.php b/views/bootstrap/class.Categories.php index a7c83fdbb..f86268025 100644 --- a/views/bootstrap/class.Categories.php +++ b/views/bootstrap/class.Categories.php @@ -92,7 +92,7 @@ $(document).ready( function() { - + formSubmit(' '.getMLText('rm_document_category'),'','','danger');?> getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID()); + $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID(), array(array('data-subtitle', $category->countDocumentsByCategory().' '.getMLText('documents')))); } $this->formField( null, //getMLText("selection"), diff --git a/views/bootstrap/class.ChangePassword.php b/views/bootstrap/class.ChangePassword.php index 335fc9270..a6fe8046c 100644 --- a/views/bootstrap/class.ChangePassword.php +++ b/views/bootstrap/class.ChangePassword.php @@ -35,8 +35,8 @@ class SeedDMS_View_ChangePassword extends SeedDMS_Theme_Style { header('Content-Type: application/javascript; charset=UTF-8'); parent::jsTranslations(array('js_form_error', 'js_form_errors')); ?> -document.form1.newpassword.focus(); $(document).ready(function() { + $('#newpassword').focus(); $("#form1").validate({ rules: { newpasswordrepeat: { @@ -78,7 +78,16 @@ $(document).ready(function() { $this->contentContainerStart(); $this->formField( getMLText("password"), - '' + array( + 'element'=>'input', + 'type'=>'password', + 'id'=>'newpassword', + 'name'=>'newpassword', + 'autocomplete'=>'off', + 'required'=>true, + 'class'=>'pwd', + 'attributes'=>[['rel', 'strengthbar']] + ) ); if($passwordstrength > 0) { $this->formField( diff --git a/views/bootstrap/class.CheckInDocument.php b/views/bootstrap/class.CheckInDocument.php index 4dbe2b4e4..42df6c10f 100644 --- a/views/bootstrap/class.CheckInDocument.php +++ b/views/bootstrap/class.CheckInDocument.php @@ -698,7 +698,7 @@ $(document).ready(function() { - "> + formSubmit(getMLText('cancel_checkout'),'','','danger');?> contentContainerStart('warning'); ?> - +

    + +

    +

    + +

    +

    +

    diff --git a/views/bootstrap/class.DefaultKeywords.php b/views/bootstrap/class.DefaultKeywords.php index eb96e797b..1fdfd3313 100644 --- a/views/bootstrap/class.DefaultKeywords.php +++ b/views/bootstrap/class.DefaultKeywords.php @@ -87,7 +87,7 @@ $(document).ready( function() { - + formSubmit(' '.getMLText('rm_default_keyword_category'),'','','danger');?>   - + formSubmit(' '.getMLText('new_default_keywords'),'','','primary');?> @@ -221,7 +221,7 @@ $(document).ready( function() { foreach ($categories as $category) { $owner = $category->getOwner(); if ($user->isAdmin() || ($owner->getID() == $user->getID())) - $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcategory && $category->getID()==$selcategory->getID()); + $options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcategory && $category->getID()==$selcategory->getID(), array(array('data-subtitle', $category->countKeywordLists().' '.getMLText('keywords')))); } $this->formField( null, //getMLText("selection"), diff --git a/views/bootstrap/class.EditEvent.php b/views/bootstrap/class.EditEvent.php index 67b0dcc4c..8805fc4c8 100644 --- a/views/bootstrap/class.EditEvent.php +++ b/views/bootstrap/class.EditEvent.php @@ -122,7 +122,7 @@ $(document).ready(function() {

    - + formSubmit(' '.getMLText('save'),'','','neutral');?>
    check_controller_access('EditOnline')) { if($user->getId() == $luser->getId()) { echo $this->warningMsg(getMLText('edit_online_warning')); -?> - -formSubmit(' '.getMLText('save'),'update','','primary'); } else { echo $this->errorMsg(getMLText('edit_online_not_allowed')); } diff --git a/views/bootstrap/class.ExtensionMgr.php b/views/bootstrap/class.ExtensionMgr.php index 64d4962d2..e5b7cbeae 100644 --- a/views/bootstrap/class.ExtensionMgr.php +++ b/views/bootstrap/class.ExtensionMgr.php @@ -306,11 +306,11 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style { $this->columnStart(8); ?>
    -
    + showStartPaneContent('installed', (!$currenttab || $currenttab == 'installed')); ?>
    -

    +

    formSubmit(" " . getMLText('refresh'));?>

    -
    + showEndPaneContent('installed', $currenttab); ?> -
    + showStartPaneContent('repository', ($currenttab == 'repository')); ?> getRepositoryUrl()) { echo "\n"; @@ -374,13 +374,13 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style { - + formSubmit(" " . getMLText('force_update'));?> showEndPaneContent('repository', $currenttab); ?> - columnEnd(); diff --git a/views/bootstrap/class.ImportUsers.php b/views/bootstrap/class.ImportUsers.php index f2c10acb1..80f1ab296 100644 --- a/views/bootstrap/class.ImportUsers.php +++ b/views/bootstrap/class.ImportUsers.php @@ -120,6 +120,11 @@ class SeedDMS_View_ImportUsers extends SeedDMS_Theme_Style { } */ echo "
    "; + } else { + if($colmap) + $this->warningMsg(getMLText('import_users_no_users')); + else + $this->warningMsg(getMLText('import_users_no_column_mapping')); } $this->columnEnd(); $this->rowEnd(); diff --git a/views/bootstrap/class.IndexInfo.php b/views/bootstrap/class.IndexInfo.php index 18b51e699..d5ade2b5c 100644 --- a/views/bootstrap/class.IndexInfo.php +++ b/views/bootstrap/class.IndexInfo.php @@ -45,18 +45,18 @@ class SeedDMS_View_IndexInfo extends SeedDMS_Theme_Style { $numDocs = $index->count(); echo "".$numDocs." ".getMLText('documents').""; /* - $this->contentContainerStart(); + $this->contentContainerStart('fulltextinfo'); for ($id = 0; $id < $numDocs; $id++) { if (!$index->isDeleted($id)) { if($hit = $index->getDocument($id)) - echo "document_id."\">".htmlspecialchars($hit->title)."\n"; + echo "document_id."\">".htmlspecialchars($hit->title)." "; } } $this->contentContainerEnd(); */ $terms = $index->terms(); - echo "".count($terms)." Terms"; + echo "".count($terms)." overall Terms"; // echo "
    ";
     		$field = '';
     		foreach($terms as $term) {
    @@ -64,10 +64,10 @@ class SeedDMS_View_IndexInfo extends SeedDMS_Theme_Style {
     				if($field)
     					$this->contentContainerEnd();
     				echo "
    ".htmlspecialchars($term->field)."
    "; - $this->contentContainerStart(); + $this->contentContainerStart('fulltextinfo'); $field = $term->field; } - echo htmlspecialchars($term->text)."\n"; + echo ''.htmlspecialchars($term->text)." "; // echo "_occurrence."\">".htmlspecialchars($term->text)."\n"; } $this->contentContainerEnd(); diff --git a/views/bootstrap/class.Indexer.php b/views/bootstrap/class.Indexer.php index 36c91696e..33339c716 100644 --- a/views/bootstrap/class.Indexer.php +++ b/views/bootstrap/class.Indexer.php @@ -42,17 +42,17 @@ class SeedDMS_View_Indexer_Process_Folder { /* {{{ */ if(($this->numdocs == 0) || !($hit = $lucenesearch->getFolder($folder->getId()))) { echo " getID()."\" class=\"indexme indexstatus\" data-docid=\"F".$folder->getID()."\">".getMLText('index_waiting').""; } else { - /* Check if the attribute created is set or has a value older + /* Check if the attribute indexed is set or has a value older * than the lastet content. Documents without such an attribute * where added when a new document was added to the dms. In such * a case the document content wasn't indexed. */ try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (/* Zend_Search_Lucene_ */Exception $e) { - $created = 0; + $indexed = 0; } - if($created >= $folder->getDate() && !$this->forceupdate) { + if($indexed >= $folder->getDate() && !$this->forceupdate) { echo "getID()."\" class=\"indexstatus\" data-docid=\"F".$folder->getID()."\">".getMLText('index_document_unchanged').""; } else { $this->fulltextservice->Indexer()->delete($hit->id); @@ -70,18 +70,18 @@ class SeedDMS_View_Indexer_Process_Folder { /* {{{ */ if(($this->numdocs == 0) || !($hit = $lucenesearch->getDocument($document->getId()))) { echo " getID()."\" class=\"indexme indexstatus\" data-docid=\"D".$document->getID()."\">".getMLText('index_waiting').""; } else { - /* Check if the attribute created is set or has a value older + /* Check if the attribute indexed is set or has a value older * than the lastet content. Documents without such an attribute * where added when a new document was added to the dms. In such * a case the document content wasn't indexed. */ try { - $created = (int) $hit->getDocument()->getFieldValue('created'); + $indexed = (int) $hit->getDocument()->getFieldValue('indexed'); } catch (/* Zend_Search_Lucene_ */Exception $e) { - $created = 0; + $indexed = 0; } $content = $document->getLatestContent(); - if($created >= $content->getDate() && !$this->forceupdate) { + if($indexed >= $content->getDate() && !$this->forceupdate) { echo "getID()."\" class=\"indexstatus\" data-docid=\"D".$document->getID()."\">".getMLText('index_document_unchanged').""; } else { $this->fulltextservice->Indexer()->delete($hit->id); @@ -132,7 +132,7 @@ function check_queue() { } var command = ''; docid = funcArray.pop(); - $('#status_'+docid).html('Processsing ...'); + $('#status_'+docid).html(''); if(docid[0] == 'F') { command = 'indexfolder'; } else { @@ -161,11 +161,12 @@ function check_queue() { // console.log('success ' + data.data); if(data.success) { if(data.cmd) - $('#status_'+data.data).html(''); + $('#status_'+data.data).html(''); else - $('#status_'+data.data).html(''); + $('#status_'+data.data).html(''); } else { - $('#status_'+data.data).html(''); + $('#update_messages').append('
    Docid: ' + data.data + ' (' + data.mimetype + ')
    ' + 'Cmd: ' + data.cmd + '
    ' + data.message+'
    '); + $('#status_'+data.data).html(''); noty({ text: '

    Docid: ' + data.data + ' (' + data.mimetype + ')

    ' + '

    Cmd: ' + data.cmd + '

    ' + data.message, type: 'error', @@ -196,7 +197,7 @@ $(document).ready( function() { $('.indexme').each(function(index) { var element = $(this); var docid = element.data('docid'); - element.html(''); + element.html(''); funcArray.push(docid); }); docstoindex = funcArray.length; @@ -218,6 +219,8 @@ $(document).ready( function() { $this->globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); + $this->rowStart(); + $this->columnStart(6); $this->contentHeading(getMLText("update_fulltext_index")); if($fulltextservice) { $index = $fulltextservice->Indexer(); @@ -230,24 +233,29 @@ div.folder {font-weight: bold; line-height: 20px; margin-top: 10px;} .progress {margin-bottom: 2px;} .bar-legend {text-align: right; font-size: 85%; margin-bottom: 15px;} -
    -
    +
    -
    +
    "; + $this->columnEnd(); + $this->columnStart(6); + $this->contentHeading(getMLText("update_fulltext_messages")); + echo '
    '; + echo '
    '; + $this->columnEnd(); + $this->rowEnd(); $index->commit(); $index->optimize(); diff --git a/views/bootstrap/class.Info.php b/views/bootstrap/class.Info.php index e7623c98a..78350783a 100644 --- a/views/bootstrap/class.Info.php +++ b/views/bootstrap/class.Info.php @@ -35,6 +35,7 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style { $dms = $this->params['dms']; $user = $this->params['user']; $settings = $this->params['settings']; + $httproot = $settings->_httpRoot; $version = $this->params['version']; $availversions = $this->params['availversions']; $extmgr = $this->params['extmgr']; @@ -67,16 +68,21 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style { echo "\n"; echo "\n\n\n"; $dbversion = $dms->getDBVersion(); - echo "".getMLText('seeddms_version')."".$version->version()."\n"; + echo "".getMLText('seeddms_version')."".$version->version()."\n"; if($user->isAdmin()) { - echo "".getMLText('database_schema_version')."".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."\n"; + echo "".getMLText('database_schema_version')."".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."\n"; foreach($seedextensions as $extname=>$extconf) { echo ""; if(!$settings->extensionIsDisabled($extname)) echo " "; else echo " "; - echo "".$extname."
    ".$extconf['title']."".$extconf['version'].""; + echo ""; + echo ""; + if($extconf['icon']) + echo "\"".$extname."\""; + echo ""; + echo "".$extname."
    ".$extconf['title']."".$extconf['version'].""; echo "\n"; } } diff --git a/views/bootstrap/class.LogManagement.php b/views/bootstrap/class.LogManagement.php index a46dd99d8..5de437662 100644 --- a/views/bootstrap/class.LogManagement.php +++ b/views/bootstrap/class.LogManagement.php @@ -104,41 +104,51 @@ $("input[type=checkbox]").each(function () { this.checked = !this.checked; }); $this->contentHeading(getMLText("log_management")); - $entries = array(); - $wentries = array(); + $sections = array( + array('default', 'Web'), + array('webdav', 'WebDAV'), + array('restapi', 'RestAPI'), + ); + if($es = $this->callHook('extraSections')) + $sections = array_merge($sections, $es); + $entries = []; + foreach($sections as $section) { + $entries[$section[0]] = array(); + } + $handle = opendir($this->logdir); if($handle) { while ($e = readdir($handle)){ if (is_dir($this->logdir.$e)) continue; if (strpos($e,".log")==FALSE) continue; if (strcmp($e,"current.log")==0) continue; - if(substr($e, 0, 6) == 'webdav') { - $wentries[] = $e; - } else { - $entries[] = $e; - } + $section = strtok($e, '-'); + if(isset($entries[$section])) + $entries[$section][] = $e; + else + $entries['default'][] = $e; } closedir($handle); - sort($entries); - sort($wentries); - $entries = array_reverse($entries); - $wentries = array_reverse($wentries); + foreach($sections as $section) { + sort($entries[$section[0]]); + $entries[$section[0]] = array_reverse($entries[$section[0]]); + } } ?> -
    _configFilePath)) { -?> - -formSubmit(" ".getMLText('save')); } ?> diff --git a/views/bootstrap/class.SubstituteUser.php b/views/bootstrap/class.SubstituteUser.php index 0249629ab..335b27556 100644 --- a/views/bootstrap/class.SubstituteUser.php +++ b/views/bootstrap/class.SubstituteUser.php @@ -73,10 +73,12 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Theme_Style { echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")"; if($hasemail) echo ""; - echo "
    "; + if($currUser->getComment()) + echo "
    ".htmlspecialchars($currUser->getComment()).""; if($hasemail) - echo "".htmlspecialchars($currUser->getEmail())."
    "; - echo "".htmlspecialchars($currUser->getComment()).""; + echo "
    getEmail())."\">".htmlspecialchars($currUser->getEmail()).""; + if($homefolder = $currUser->getHomeFolder()) + echo "
    ".htmlspecialchars($dms->getFolder($homefolder)->getName()).""; echo ""; echo ""; echo getMLText('role').": "; diff --git a/views/bootstrap/class.TriggerWorkflow.php b/views/bootstrap/class.TriggerWorkflow.php index d700a11c0..f04e1c2e2 100644 --- a/views/bootstrap/class.TriggerWorkflow.php +++ b/views/bootstrap/class.TriggerWorkflow.php @@ -113,7 +113,7 @@ $(document).ready(function() { 'required'=>false ) ); - $this->formSubmit(getMLText("action_".strtolower($action->getName()), array(), $action->getName())); + $this->formSubmit(getMLText("action_".strtolower($action->getName()), array(), htmlspecialchars($action->getName()))); ?> - + formSubmit(' '.getMLText('rm_default_keyword_category'),'','','danger');?>
    @@ -151,7 +151,7 @@ $(document).ready(function() { - + formSubmit(' '.getMLText('save'),'','','neutral');?>
    @@ -170,14 +170,14 @@ $(document).ready(function() { "> "> - + formSubmit(' '.getMLText('save'),'','','neutral');?>
    "> - + formSubmit(' '.getMLText('delete'),'','','danger');?>

    diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 3f8df3aec..1a71eac9e 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -383,9 +383,10 @@ $(document).ready( function() { print "
  • ".htmlspecialchars($file->getName())."
  • \n"; if($file->getName() != $file->getOriginalFileName()) print "
  • ".htmlspecialchars($file->getOriginalFileName())."
  • \n"; - if ($file_exists) + if ($file_exists) { + $realmimetype = SeedDMS_Core_File::mimetype($dms->contentDir . $file->getPath()); print "
  • ".SeedDMS_Core_File::format_filesize(filesize($dms->contentDir . $file->getPath())) ." bytes, ".htmlspecialchars($file->getMimeType())."
  • "; - else print "
  • ".htmlspecialchars($file->getMimeType())." - ".getMLText("document_deleted")."
  • "; + } else print "
  • ".htmlspecialchars($file->getMimeType())." - ".getMLText("document_deleted")."
  • "; print "
  • ".getMLText("uploaded_by")." getEmail())."\">".htmlspecialchars($responsibleUser->getFullName())."
  • "; print "
  • ".getLongReadableDate($file->getDate())."
  • "; @@ -448,6 +449,7 @@ $(document).ready( function() { } foreach($infos as $info) { $checkoutuser = $dms->getUser($info['userID']); + $checkoutstatus = $document->checkOutStatus(); echo ""; @@ -825,6 +827,11 @@ $(document).ready( function() { if ($file_exists) { print "
  • ". SeedDMS_Core_File::format_filesize($latestContent->getFileSize()) .", "; print htmlspecialchars($latestContent->getMimeType()); + if($user->isAdmin()) { + $realmimetype = SeedDMS_Core_File::mimetype($dms->contentDir . $latestContent->getPath()); + if($realmimetype != $latestContent->getMimeType()) + echo " getId()."\" data-param3=\"formtoken=".createFormKey('setmimetype')."\" title=\"".htmlspecialchars($realmimetype)."\"> "; + } if(in_array($latestContent->getMimeType(), ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'])) { $imsize = getimagesize($dms->contentDir . $latestContent->getPath(), $moreinfo); if(!empty($moreinfo['APP13'])) { diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php index 76cb89033..bc557963e 100644 --- a/views/bootstrap/class.ViewFolder.php +++ b/views/bootstrap/class.ViewFolder.php @@ -137,6 +137,9 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Theme_Style { header('Content-Type: application/javascript; charset=UTF-8'); parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder')); ?> +$(document).ready(function() { + $('#searchfield').focus(); +}); seeddms_folder = getID() ?>; function folderSelectedmaintree(id, name) { @@ -235,7 +238,7 @@ $('body').on('click', '.order-btn', function(ev) { if($showtree == 1) $this->printNewTreeNavigationJs($folder->getID(), M_READ, 0, 'maintree', ($expandFolderTree == 1) ? -1 : 3, $orderby); - if ($enableDropUpload && $folder->getAccessMode($user) >= M_READWRITE) { + if ($enableDropUpload /*&& $folder->getAccessMode($user) >= M_READWRITE*/) { echo "SeedDMSUpload.setUrl('".$this->params['settings']->_httpRoot."op/op.Ajax.php');"; echo "SeedDMSUpload.setAbortBtnLabel('".getMLText("cancel")."');"; echo "SeedDMSUpload.setEditBtnLabel('".getMLText("edit_document_props")."');"; @@ -483,7 +486,7 @@ $('body').on('click', '.order-btn', function(ev) { if(is_string($txt)) echo $txt; else { - $this->pageNavigation($this->getFolderPathHTML($folder), "view_folder", $folder); + $this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder); } echo $this->callHook('preContent'); diff --git a/views/bootstrap/styles/application.css b/views/bootstrap/styles/application.css index 10d2c690c..68898a15b 100644 --- a/views/bootstrap/styles/application.css +++ b/views/bootstrap/styles/application.css @@ -265,6 +265,15 @@ span.datepicker { span.datepicker input { max-width: 100px; } + +div.typeahead span.path { + font-size: 85%; + color: #888; +} + +div.fulltextinfo > span:hover { + background-color: lightblue; +} /* Sidenav for Docs * -------------------------------------------------- */ diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index 13beb2f18..fef4a5614 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -96,13 +96,9 @@ function initMost() { d.setFullYear(pastYear); // console.log(d.toISOString().split('T')[0]); -// $.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) { var data = { query: query, - limit: 18, -// fullsearch: 1, -// creationdate: 1, -// createstart: d.toISOString().split('T')[0], + limit: 15, action: 'typeahead' }; /* Return a list of json objects, each containing @@ -148,11 +144,11 @@ function initMost() { **/ highlighter : function (item) { if(item.type.charAt(0) == 'D') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else if(item.type.charAt(0) == 'F') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else - return ' ' + item.name.replace(/ ' + item.name.replace(/ 0 ? ' (' + item.occurences + ')' : ''); }, /* This only works with a modified version of bootstrap typeahead located * in boostrap-typeahead.js Search for 'render' @@ -549,7 +545,13 @@ $(document).ready( function() { $("body").on("click", ".ajax-click", function() { /* {{{ */ var element = $(this); - var url = element.data('href')+"?"+element.data('param1'); + var url = seeddms_webroot+"op/op.Ajax.php"+"?"+element.data('param1'); + var param2 = element.data('param2'); + var param3 = element.data('param3'); + if(typeof param2 !== 'undefined') + url += "&"+param2; + if(typeof param3 !== 'undefined') + url += "&"+param3; $.ajax({ type: 'GET', url: url, diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 69d304902..ad617eb56 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -57,9 +57,11 @@ class SeedDMS_Theme_Style extends SeedDMS_View_Common { * X-Content-Security-Policy is deprecated, Firefox understands * Content-Security-Policy since version 23+ * 'worker-src blob:' is needed for cytoscape + * 'unsafe-inline' is needed for jquery 3.6.1 when loading the remote + * content of a modal box */ $csp_rules = []; - $csp_rule = "script-src 'self' 'unsafe-eval'"; + $csp_rule = "script-src 'self' 'unsafe-eval' 'unsafe-inline'"; if($this->nonces) { $csp_rule .= " 'nonce-".implode("' 'nonce-", $this->nonces)."'"; } @@ -471,16 +473,16 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $txtpath = ""; for ($i = 0; $i < count($path); $i++) { $txtpath .= "
  • "; - if ($i +1 < count($path)) { - $txtpath .= "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">". + if ($i+1 < count($path)) { + $txtpath .= "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" data-name=\"".htmlspecialchars($path[$i]->getName())."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">". htmlspecialchars($path[$i]->getName()).""; } else { - $txtpath .= ($tagAll ? "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\">".htmlspecialchars($path[$i]->getName())."" : htmlspecialchars($path[$i]->getName())); + $txtpath .= ($tagAll ? "params['settings']->_httpRoot."out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" data-name=\"".htmlspecialchars($path[$i]->getName())."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">".htmlspecialchars($path[$i]->getName())."" : htmlspecialchars($path[$i]->getName())); } } if($document) - $txtpath .= "
  • params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getId()."\">".htmlspecialchars($document->getName())."
  • "; + $txtpath .= "
  • params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getId()."\" class=\"table-document-row\" rel=\"document_".$document->getId()."\" data-name=\"".htmlspecialchars($document->getName())."\" formtoken=\"".createFormKey('')."\">".htmlspecialchars($document->getName())."
  • "; return ''; } /* }}} */ @@ -1250,6 +1252,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);; case 'danger': $class = 'btn-danger'; break; + case 'secondary': + $class = 'btn-secondary'; + break; + case 'neutral': + $class = ''; + break; case 'primary': default: $class = 'btn-primary'; @@ -1410,8 +1418,10 @@ function getOverallStatusIcon($status) { /* {{{ */ function getModalBoxLinkAttributes($config) { /* {{{ */ $attrs = array(); $attrs[] = array('data-target', '#'.$config['target']); - if(isset($config['remote'])) + if(isset($config['remote'])) { $attrs[] = array('href', $config['remote']); + $attrs[] = array('data-remote', $config['remote']); + } $attrs[] = array('data-toggle', 'modal'); $attrs[] = array('role', 'button'); if(isset($config['class'])) { @@ -3320,6 +3330,11 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) $content .= ""; $content .= $this->documentListRowAction($document, $previewer, $skipcont, $version, $extracontent); $content .= ""; + if(!empty($extracontent['columns_last'])) { + foreach($extracontent['columns_last'] as $col) + $content .= ''.$col.''; + } + if(!$skipcont) $content .= $this->documentListRowEnd($document); } diff --git a/views/bootstrap4/styles/application.css b/views/bootstrap4/styles/application.css index 06636e767..3a487f668 100644 --- a/views/bootstrap4/styles/application.css +++ b/views/bootstrap4/styles/application.css @@ -275,6 +275,15 @@ a.accordion2-toggle:focus, a.accordion2-toggle:hover { span.datepicker { padding: 0px; } + +div.typeahead span.path { + font-size: 85%; + color: #888; +} + +div.fulltextinfo > span:hover { + background-color: lightblue; +} /* Sidenav for Docs * -------------------------------------------------- */ diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index bcf9d170d..208a2f4c3 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -101,13 +101,9 @@ function initMost() { d.setFullYear(pastYear); // console.log(d.toISOString().split('T')[0]); -// $.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) { var data = { query: query, - limit: 18, -// fullsearch: 1, -// creationdate: 1, -// createstart: d.toISOString().split('T')[0], + limit: 15, action: 'typeahead' }; /* Return a list of json objects, each containing @@ -153,11 +149,11 @@ function initMost() { **/ highlighter : function (item) { if(item.type.charAt(0) == 'D') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else if(item.type.charAt(0) == 'F') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else - return ' ' + item.name.replace(/ ' + item.name.replace(/ 0 ? ' (' + item.occurences + ')' : ''); }, /* This only works with a modified version of bootstrap typeahead located * in boostrap-typeahead.js Search for 'render' @@ -580,7 +576,13 @@ $(document).ready( function() { $("body").on("click", ".ajax-click", function() { /* {{{ */ var element = $(this); - var url = element.data('href')+"?"+element.data('param1'); + var url = seeddms_webroot+"op/op.Ajax.php"+"?"+element.data('param1'); + var param2 = element.data('param2'); + var param3 = element.data('param3'); + if(typeof param2 !== 'undefined') + url += "&"+param2; + if(typeof param3 !== 'undefined') + url += "&"+param3; $.ajax({ type: 'GET', url: url, diff --git a/webdav/index.php b/webdav/index.php index a6be8fa13..a33249766 100644 --- a/webdav/index.php +++ b/webdav/index.php @@ -1,6 +1,7 @@ ServeRequest($dms, $logger, $notifier); +$server->ServeRequest($dms, $settings, $logger, $notifier, $authenticator); //$files = array(); //$options = array('path'=>'/Test1/subdir', 'depth'=>1); //echo $server->MKCOL(&$options); diff --git a/webdav/webdav.php b/webdav/webdav.php index 396be6714..a05015dd2 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -32,7 +32,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server var $logger = null; /** - * A reference to a notifier + * A reference to a notification service * * This is set by ServeRequest * @@ -41,6 +41,16 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ var $notifier = null; + /** + * A reference to the authentication service + * + * This is set by ServeRequest + * + * @access private + * @var object + */ + var $authenticator = null; + /** * Currently logged in user * @@ -77,7 +87,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server * @access public * @param object $dms reference to DMS */ - function ServeRequest($dms = null, $logger = null, $notifier = null) /* {{{ */ + function ServeRequest($dms = null, $settings = null, $logger = null, $notifier = null, $authenticator = null) /* {{{ */ { // set root directory, defaults to webserver document root if not set if ($dms) { @@ -86,12 +96,22 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return false; } + // set settings + if ($settings) { + $this->settings = $settings; + } else { + return false; + } + // set logger $this->logger = $logger; - // set notifier + // set notification service $this->notifier = $notifier; + // set authentication service + $this->authenticator = $authenticator; + // special treatment for litmus compliance test // reply on its identifier header // not needed for the test itself but eases debugging @@ -148,50 +168,26 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function check_auth($type, $user, $pass) /* {{{ */ { - global $settings; - if($this->logger) $this->logger->log('check_auth: type='.$type.', user='.$user.'', PEAR_LOG_INFO); - $userobj = false; - - /* Authenticate against LDAP server {{{ */ - if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { - require_once("../inc/inc.ClassLdapAuthentication.php"); - $authobj = new SeedDMS_LdapAuthentication($this->dms, $settings); - $userobj = $authobj->authenticate($user, $pass); - if($userobj && $this->logger) - $this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated against LDAP', PEAR_LOG_INFO); - } /* }}} */ - - /* Authenticate against SeedDMS database {{{ */ - if(!$userobj) { - require_once("../inc/inc.ClassDbAuthentication.php"); - $authobj = new SeedDMS_DbAuthentication($this->dms, $settings); - $userobj = $authobj->authenticate($user, $pass); - if($userobj && $this->logger) - $this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated against database', PEAR_LOG_INFO); - } /* }}} */ - - if(!$userobj) { - if($this->logger) - $this->logger->log('check_auth: No such user'.$user, PEAR_LOG_NOTICE); + $controller = Controller::factory('Login', array('dms'=>$this->dms)); + $controller->setParam('authenticator', $this->authenticator); + $controller->setParam('login', $user); + $controller->setParam('pwd', $pass); + $controller->setParam('source', 'webdav'); + if(!$controller()) { + if($this->logger) { + $this->logger->log($controller->getErrorMsg(), PEAR_LOG_NOTICE); + $this->logger->log('check_auth: error authenicating user '.$user, PEAR_LOG_NOTICE); + } return false; } - if(($userobj->getID() == $settings->_guestID) && (!$settings->_enableGuestLogin)) { - if($this->logger) - $this->logger->log('check_auth: Login as guest is not allowed', PEAR_LOG_NOTICE); - return false; - } + if($this->logger) + $this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated', PEAR_LOG_INFO); - if($userobj->isDisabled()) - return false; - - if($userobj->isAdmin() && ($_SERVER['REMOTE_ADDR'] != $settings->_adminIP ) && ( $settings->_adminIP != "")) - return false; - - $this->user = $userobj; + $this->user = $controller->getUser(); return true; } /* }}} */ @@ -441,6 +437,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $info["props"][] = $this->mkprop("SeedDMS:", "keywords", $keywords); $info["props"][] = $this->mkprop("SeedDMS:", "id", $obj->getID()); $info["props"][] = $this->mkprop("SeedDMS:", "version", $content->getVersion()); + if($content->getComment()) + $info["props"][] = $this->mkprop("SeedDMS:", "version-comment", $content->getComment()); $status = $content->getStatus(); $info["props"][] = $this->mkprop("SeedDMS:", "status", $status['status']); $info["props"][] = $this->mkprop("SeedDMS:", "status-comment", $status['comment']); @@ -623,7 +621,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function PUT(&$options) /* {{{ */ { - global $settings, $fulltextservice; + global $fulltextservice; $this->log_options('PUT', $options); @@ -655,19 +653,20 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server } fclose($fp); - $finfo = new finfo(FILEINFO_MIME); + $finfo = new finfo(FILEINFO_MIME_TYPE); $mimetype = $finfo->file($tmpFile); - $tmp = explode(';', $mimetype); - $mimetype = $tmp[0]; + $lastDotIndex = strrpos($name, "."); + if($lastDotIndex === false) $fileType = "."; + else $fileType = substr($name, $lastDotIndex); switch($mimetype) { - case 'application/pdf'; + case 'application/pdf': $fileType = ".pdf"; break; - default: - $lastDotIndex = strrpos($name, "."); - if($lastDotIndex === false) $fileType = "."; - else $fileType = substr($name, $lastDotIndex); + case 'text/plain': + if($fileType == '.md') + $mimetype = 'text/markdown'; + break; } if($this->logger) $this->logger->log('PUT: file is of type '.$mimetype, PEAR_LOG_INFO); @@ -695,7 +694,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server unlink($tmpFile); return "403 Forbidden"; } else { - /* Check if the new version iѕ identical to the current version. + /* Check if the new version is identical to the current version. * In that case just update the modification date */ $lc = $document->getLatestContent(); @@ -708,7 +707,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $name == $lc->getOriginalFileName() && $fileType == $lc->getFileType() && $mimetype == $lc->getMimeType() && - $settings->_enableWebdavReplaceDoc) { + $this->settings->_enableWebdavReplaceDoc) { if($this->logger) $this->logger->log('PUT: replacing latest version', PEAR_LOG_INFO); if(!$document->replaceContent($lc->getVersion(), $this->user, $tmpFile, $name, $fileType, $mimetype)) { @@ -726,12 +725,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $reviewers = array('i'=>[], 'g'=>[]); $approvers = array('i'=>[], 'g'=>[]); $workflow = null; - if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') { - if($settings->_workflowMode == 'traditional') { + if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') { + if($this->settings->_workflowMode == 'traditional') { $reviewers = getMandatoryReviewers($document->getFolder(), $this->user); } $approvers = getMandatoryApprovers($document->getFolder(), $this->user); - } elseif($settings->_workflowMode == 'advanced') { + } elseif($this->settings->_workflowMode == 'advanced') { if($workflows = $this->user->getMandatoryWorkflows()) { $workflow = array_shift($workflows); } @@ -754,7 +753,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('attributes', array()); $controller->setParam('workflow', $workflow); - if(!$content = $controller->run()) { + if(!$content = $controller()) { if($this->logger) $this->logger->log('PUT: error adding new version', PEAR_LOG_ERR); unlink($tmpFile); @@ -764,24 +763,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('PUT: Sending Notifications', PEAR_LOG_INFO); - $notifyList = $document->getNotifyList(); - $folder = $document->getFolder(); - - $subject = "document_updated_email_subject"; - $message = "document_updated_email_body"; - $params = array(); - $params['name'] = $document->getName(); - $params['folder_path'] = $folder->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['comment'] = $document->getComment(); - $params['version_comment'] = $content->getComment(); - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $notifyList["users"], $subject, $message, $params); - foreach ($notifyList["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendNewDocumentVersionMail($document, $this->user); } } } @@ -797,7 +779,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server /* Check if name already exists in the folder */ /* - if(!$settings->_enableDuplicateDocNames) { + if(!$this->settings->_enableDuplicateDocNames) { if($folder->hasDocumentByName($name)) { return "403 Forbidden"; } @@ -807,12 +789,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $reviewers = array('i'=>[], 'g'=>[]); $approvers = array('i'=>[], 'g'=>[]); $workflow = null; - if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') { - if($settings->_workflowMode == 'traditional') { + if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') { + if($this->settings->_workflowMode == 'traditional') { $reviewers = getMandatoryReviewers($folder, $this->user); } $approvers = getMandatoryApprovers($folder, $this->user); - } elseif($settings->_workflowMode == 'advanced') { + } elseif($this->settings->_workflowMode == 'advanced') { if($workflows = $this->user->getMandatoryWorkflows()) { $workflow = array_shift($workflows); } @@ -835,7 +817,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('filetype', $fileType); $controller->setParam('userfiletype', $mimetype); $minmax = $folder->getDocumentsMinMax(); - if($settings->_defaultDocPosition == 'start') + if($this->settings->_defaultDocPosition == 'start') $controller->setParam('sequence', $minmax['min'] - 1); else $controller->setParam('sequence', $minmax['max'] + 1); @@ -848,10 +830,10 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('workflow', $workflow); $controller->setParam('notificationgroups', array()); $controller->setParam('notificationusers', array()); - $controller->setParam('initialdocumentstatus', $settings->_initialDocumentStatus); - $controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText); - $controller->setParam('defaultaccessdocs', $settings->_defaultAccessDocs); - if(!$document = $controller->run()) { + $controller->setParam('initialdocumentstatus', $this->settings->_initialDocumentStatus); + $controller->setParam('maxsizeforfulltext', $this->settings->_maxSizeForFullText); + $controller->setParam('defaultaccessdocs', $this->settings->_defaultAccessDocs); + if(!$document = $controller()) { // if(!$res = $folder->addDocument($name, '', 0, $this->user, '', array(), $tmpFile, $name, $fileType, $mimetype, 0, array(), array(), 0, "")) { unlink($tmpFile); if($this->logger) @@ -861,29 +843,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('PUT: Sending Notifications', PEAR_LOG_INFO); - $fnl = $folder->getNotifyList(); - $dnl = $document->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($dnl['users'], $fnl['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($dnl['groups'], $fnl['groups']), SORT_REGULAR) - ); - - $subject = "new_document_email_subject"; - $message = "new_document_email_body"; - $params = array(); - $params['name'] = $name; - $params['folder_name'] = $folder->getName(); - $params['folder_path'] = $folder->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['comment'] = ''; - $params['version_comment'] = ''; - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendNewDocumentMail($document, $this->user); } } @@ -900,8 +860,6 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function MKCOL($options) /* {{{ */ { - global $settings; - $this->log_options('MKCOL', $options); $path = $options["path"]; @@ -957,7 +915,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('attributes', array()); $controller->setParam('notificationgroups', array()); $controller->setParam('notificationusers', array()); - if(!$subFolder = $controller->run()) { + if(!$subFolder = $controller()) { // if (!$folder->addSubFolder($name, '', $this->user, 0)) { return "409 Conflict ".$controller->getErrorMsg(); } @@ -965,28 +923,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('MKCOL: Sending Notifications', PEAR_LOG_INFO); - $fnl = $folder->getNotifyList(); - $snl = $subFolder->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($snl['users'], $fnl['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($snl['groups'], $fnl['groups']), SORT_REGULAR) - ); - - $subject = "new_subfolder_email_subject"; - $message = "new_subfolder_email_body"; - $params = array(); - $params['name'] = $subFolder->getName(); - $params['folder_name'] = $folder->getName(); - $params['folder_path'] = $folder->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['comment'] = ''; - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$subFolder->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendNewFolderMail($subFolder, $this->user); } return ("201 Created"); @@ -1001,7 +938,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function DELETE($options) /* {{{ */ { - global $settings, $fulltextservice; + global $fulltextservice; $this->log_options('DELETE', $options); @@ -1028,79 +965,37 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server return "409 Conflict"; } - $parent = $obj->getParent(); - $fnl = $obj->getNotifyList(); - $pnl = $parent->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($fnl['users'], $pnl['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($fnl['groups'], $pnl['groups']), SORT_REGULAR) - ); - $foldername = $obj->getName(); - $controller = Controller::factory('RemoveFolder'); $controller->setParam('dms', $this->dms); $controller->setParam('user', $this->user); $controller->setParam('folder', $obj); $controller->setParam('fulltextservice', $fulltextservice); - if(!$controller->run()) { + if(!$controller()) { return "409 Conflict ".$controller->getErrorMsg(); } if($this->notifier) { if($this->logger) $this->logger->log('DELETE: Sending Notifications', PEAR_LOG_INFO); - $subject = "folder_deleted_email_subject"; - $message = "folder_deleted_email_body"; - $params = array(); - $params['name'] = $foldername; - $params['folder_path'] = $parent->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$parent->getID(); - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendDeleteFolderMail($obj, $this->user); } } else { - /* Get the notify list before removing the document - * Also inform the users/groups of the parent folder - */ - $folder = $obj->getFolder(); - $dnl = $obj->getNotifyList(); - $fnl = $folder->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($dnl['users'], $fnl['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($dnl['groups'], $fnl['groups']), SORT_REGULAR) - ); - $docname = $obj->getName(); - $controller = Controller::factory('RemoveDocument'); $controller->setParam('dms', $this->dms); $controller->setParam('user', $this->user); $controller->setParam('document', $obj); $controller->setParam('fulltextservice', $fulltextservice); - if(!$controller->run()) { + if(!$controller()) { return "409 Conflict ".$controller->getErrorMsg(); } if($this->notifier){ if($this->logger) $this->logger->log('DELETE: Sending Notifications', PEAR_LOG_INFO); - $subject = "document_deleted_email_subject"; - $message = "document_deleted_email_body"; - $params = array(); - $params['name'] = $docname; - $params['folder_path'] = $folder->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID(); - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + /* $obj still has the data from the just deleted document, + * which is just enough to send the email. + */ + $this->notifier->sendDeleteDocumentMail($obj, $this->user); } } @@ -1116,8 +1011,6 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function MOVE($options) /* {{{ */ { - global $settings; - $this->log_options('MOVE', $options); // no copying to different WebDAV Servers yet @@ -1192,7 +1085,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server /* Set the new Folder of the source object */ if(get_class($objsource) == $this->dms->getClassname('document')) { /* Check if name already exists in the folder */ - if(!$settings->_enableDuplicateDocNames) { + if(!$this->settings->_enableDuplicateDocNames) { if($newdocname) { if($objdest->hasDocumentByName($newdocname)) { return "403 Forbidden"; @@ -1209,34 +1102,14 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('MOVE: Sending Notifications', PEAR_LOG_INFO); - $nl1 = $oldFolder->getNotifyList(); - $nl2 = $objsource->getNotifyList(); - $nl3 = $objdest->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($nl1['users'], $nl2['users'], $nl3['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($nl1['groups'], $nl2['groups'], $nl3['groups']), SORT_REGULAR) - ); - $subject = "document_moved_email_subject"; - $message = "document_moved_email_body"; - $params = array(); - $params['name'] = $objsource->getName(); - $params['old_folder_path'] = $oldFolder->getFolderPathPlain(); - $params['new_folder_path'] = $objdest->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$objsource->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendMovedDocumentMail($objsource, $this->user, $oldFolder); } } else { return "500 Internal server error"; } } elseif(get_class($objsource) == $this->dms->getClassname('folder')) { /* Check if name already exists in the folder */ - if(!$settings->_enableDuplicateSubFolderNames) { + if(!$this->settings->_enableDuplicateSubFolderNames) { if($newdocname) { if($objdest->hasSubFolderByName($newdocname)) { return "403 Forbidden"; @@ -1252,27 +1125,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('MOVE: Sending Notifications', PEAR_LOG_INFO); - $nl1 = $oldFolder->getNotifyList(); - $nl2 = $objsource->getNotifyList(); - $nl3 = $objdest->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($nl1['users'], $nl2['users'], $nl3['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($nl1['groups'], $nl2['groups'], $nl3['groups']), SORT_REGULAR) - ); - $subject = "folder_moved_email_subject"; - $message = "folder_moved_email_body"; - $params = array(); - $params['name'] = $objsource->getName(); - $params['old_folder_path'] = $oldFolder->getFolderPathPlain(); - $params['new_folder_path'] = $objdest->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$objsource->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendMovedFolderMail($objsource, $this->user, $oldFolder); } } else { return "500 Internal server error"; @@ -1293,7 +1146,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server */ function COPY($options) /* {{{ */ { - global $settings, $fulltextservice; + global $fulltextservice; $this->log_options('COPY', $options); @@ -1393,7 +1246,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server /* Check if name already exists in the folder */ /* - if(!$settings->_enableDuplicateDocNames) { + if(!$this->settings->_enableDuplicateDocNames) { if($objdest->hasDocumentByName($newdocname)) { return "403 Forbidden"; } @@ -1403,12 +1256,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $reviewers = array('i'=>[], 'g'=>[]); $approvers = array('i'=>[], 'g'=>[]); $workflow = null; - if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') { - if($settings->_workflowMode == 'traditional') { + if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') { + if($this->settings->_workflowMode == 'traditional') { $reviewers = getMandatoryReviewers($objdest, $this->user); } $approvers = getMandatoryApprovers($objdest, $this->user); - } elseif($settings->_workflowMode == 'advanced') { + } elseif($this->settings->_workflowMode == 'advanced') { if($workflows = $this->user->getMandatoryWorkflows()) { $workflow = array_shift($workflows); } @@ -1435,7 +1288,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('filetype', $content->getFileType()); $controller->setParam('userfiletype', $content->getMimeType()); $minmax = $objdest->getDocumentsMinMax(); - if($settings->_defaultDocPosition == 'start') + if($this->settings->_defaultDocPosition == 'start') $controller->setParam('sequence', $minmax['min'] - 1); else $controller->setParam('sequence', $minmax['max'] + 1); @@ -1448,10 +1301,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $controller->setParam('workflow', $workflow); $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, "")) { + $controller->setParam('maxsizeforfulltext', $this->settings->_maxSizeForFullText); + $controller->setParam('defaultaccessdocs', $this->settings->_defaultAccessDocs); + if(!$document = $controller()) { if($this->logger) $this->logger->log('COPY: error copying object', PEAR_LOG_ERR); return "409 Conflict"; @@ -1460,29 +1312,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server if($this->notifier) { if($this->logger) $this->logger->log('COPY: Sending Notifications', PEAR_LOG_INFO); - $fnl = $objdest->getNotifyList(); - $dnl = $document->getNotifyList(); - $nl = array( - 'users'=>array_unique(array_merge($dnl['users'], $fnl['users']), SORT_REGULAR), - 'groups'=>array_unique(array_merge($dnl['groups'], $fnl['groups']), SORT_REGULAR) - ); - - $subject = "new_document_email_subject"; - $message = "new_document_email_body"; - $params = array(); - $params['name'] = $newdocname; - $params['folder_name'] = $objdest->getName(); - $params['folder_path'] = $objdest->getFolderPathPlain(); - $params['username'] = $this->user->getFullName(); - $params['comment'] = ''; - $params['version_comment'] = ''; - $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); - $params['sitename'] = $settings->_siteName; - $params['http_root'] = $settings->_httpRoot; - $this->notifier->toList($this->user, $nl["users"], $subject, $message, $params); - foreach ($nl["groups"] as $grp) { - $this->notifier->toGroup($this->user, $grp, $subject, $message, $params); - } + $this->notifier->sendNewDocumentMail($document, $this->user); } return "201 Created"; }