From 5a3ba8243d4d35fb1f02bf53adb7903d884f47a4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 12 Oct 2024 13:49:51 +0200 Subject: [PATCH 1/7] some general information about converting documents --- doc/README.Converters | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/README.Converters b/doc/README.Converters index e2cdebf72..dfa22f0c4 100644 --- a/doc/README.Converters +++ b/doc/README.Converters @@ -1,3 +1,23 @@ +Commands for converting documents +---------------------------------- + +This file contains commands for converting different document types +into + +* text (for fulltext search) +* png (for preview images) +* pdf (for pdf documents) + +Such conversions may not necessarily output an excact equivalent of +the input file, but outputs a suitable representation, e.g. +converting an mp3 file into text may output the metadata or even the +lyrics of the song. Converting it into a preview image may result +in a picture of the album cover. + +Please note, that when ever a command outputs anything to stderr, +this will considered as a failure of the command. Most command line +programs have a parameter (.e.g. `-q`) to suppress such an output. + Conversion to text for fulltext search ======================================= @@ -78,6 +98,9 @@ message/rfc822 text/plain iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | ps2pdf - - + The parameter `-q` is important because a2ps sends some statistical + data to stderr, which makes SeedDMS believe the command has failed. + application/x-xopp xournalpp -p "%o" "%f" From cd0ec529310663bc7dc0dc469105cd9bec432607 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 12 Oct 2024 13:50:30 +0200 Subject: [PATCH 2/7] pass context to getAccessMode() --- views/bootstrap/class.Bootstrap.php | 6 ++++-- views/bootstrap4/class.Bootstrap4.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 81ede0ba3..24bd2e592 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -774,9 +774,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires')); } } - if ($accessMode == M_ALL) { + if ($document->getAccessMode($this->params['user'], 'removeDocument') == M_ALL) { if ($accessobject->check_view_access('RemoveDocument')) $menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document')); + } + if($accessMode == M_ALL) { if ($accessobject->check_view_access('DocumentAccess')) $menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access')); } @@ -3144,7 +3146,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) if(!empty($extracontent['begin_action_list'])) $content .= $extracontent['begin_action_list']; if($accessop->check_view_access('RemoveDocument')) { - if($document->getAccessMode($user) >= M_ALL) { + if($document->getAccessMode($user, 'removeDocument') >= M_ALL) { $actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true); } else { $actions['remove_document'] = ''; diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index c0a2d23d1..63514c45b 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -773,9 +773,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires')); } } - if ($accessMode == M_ALL) { + if ($document->getAccessMode($this->params['user'], 'removeDocument') == M_ALL) { if ($accessobject->check_view_access('RemoveDocument')) $menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document')); + } + if($accessMode == M_ALL) { if ($accessobject->check_view_access('DocumentAccess')) $menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access')); } @@ -3194,7 +3196,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) if(!empty($extracontent['begin_action_list'])) $content .= $extracontent['begin_action_list']; if($accessop->check_view_access('RemoveDocument')) { - if($document->getAccessMode($user) >= M_ALL) { + if($document->getAccessMode($user, 'removeDocument') >= M_ALL) { $actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true); } else { $actions['remove_document'] = ''; From 886a79119e436cd5882221042934b3243ea6d7af Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 16 Oct 2024 07:28:13 +0200 Subject: [PATCH 3/7] fix typo --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 09962b3c8..3b02962f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,7 +11,7 @@ - use rename() on windows when moving an extension to its final destination - fixed bug in AddDocument, approver group wasn't checked properly against mandatory approvers -- email from address in settings can be force for all outgoing mail +- email From-address in settings can be forced for all outgoing mail - checking of ssl certificate for smtp can be turned off - add chart for disk space per month - clearing cache of js files works for a large number of files From ec04ed665e6c02fb7e9fb9e6c098cc3600a1f5f0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 22 Oct 2024 10:18:30 +0200 Subject: [PATCH 4/7] place mandatory reviewers/approvers into own box --- views/bootstrap/class.UsrMgr.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index 774e6c38d..91edd2685 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -177,6 +177,10 @@ $(document).ready( function() { $session = array_shift($sessions); echo "".getMLText('lastaccess')."".getLongReadableDate($session->getLastAccess())."\n"; } + $item = $this->callHook('addInfoItem', $seluser); + if($item) { + echo "".$item[0]."".$item[1]."\n"; + } echo ""; } @@ -420,9 +424,11 @@ $(document).ready( function() { ); } } + $this->contentContainerEnd(); if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') { if($workflowmode == "traditional") { $this->contentSubHeading(getMLText("mandatory_reviewers")); + $this->contentContainerStart(); $options = array(); if($currUser) $res=$currUser->getMandatoryReviewers(); @@ -468,8 +474,10 @@ $(document).ready( function() { ) ); } + $this->contentContainerEnd(); $this->contentSubHeading(getMLText("mandatory_approvers")); + $this->contentContainerStart(); $options = array(); if($currUser) $res=$currUser->getMandatoryApprovers(); @@ -514,10 +522,12 @@ $(document).ready( function() { 'options'=>$options ) ); + $this->contentContainerEnd(); } elseif($workflowmode == 'advanced') { $workflows = $dms->getAllWorkflows(); if($workflows) { $this->contentSubHeading(getMLText("workflow")); + $this->contentContainerStart(); $options = array(); $mandatoryworkflows = $currUser ? $currUser->getMandatoryWorkflows() : array(); foreach ($workflows as $workflow) { @@ -536,9 +546,9 @@ $(document).ready( function() { 'options'=>$options ) ); + $this->contentContainerEnd(); } } - $this->contentContainerEnd(); $this->formSubmit(" ".getMLText($currUser ? "save" : "add_user")); ?> From c4014dfddf692c6eda9e49f0bf3a274ea1a812c7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 26 Oct 2024 11:46:40 +0200 Subject: [PATCH 5/7] code beautify --- out/out.EditUserData.php | 78 +++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/out/out.EditUserData.php b/out/out.EditUserData.php index 589729e06..dbe1fd94f 100644 --- a/out/out.EditUserData.php +++ b/out/out.EditUserData.php @@ -1,49 +1,61 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://www.seeddms.org Main Site + */ + +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.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' => $user)); $accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings); if ($user->isGuest()) { - UI::exitError(getMLText("edit_user_details"),getMLText("access_denied")); + UI::exitError(getMLText("edit_user_details"), getMLText("access_denied")); } if (!$user->isAdmin() && ($settings->_disableSelfEdit)) { - UI::exitError(getMLText("edit_user_details"),getMLText("access_denied")); + UI::exitError(getMLText("edit_user_details"), getMLText("access_denied")); } -if($view) { +if ($view) { $view->setParam('enableuserimage', $settings->_enableUserImage); $view->setParam('enablelanguageselector', $settings->_enableLanguageSelector); $view->setParam('enablethemeselector', $settings->_enableThemeSelector); From 122959d11c37370fe9f3474001ab05cfc7712f1f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 26 Oct 2024 11:47:06 +0200 Subject: [PATCH 6/7] code beautify --- index.php | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/index.php b/index.php index ce750c740..b6fa64a0d 100644 --- a/index.php +++ b/index.php @@ -1,23 +1,35 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://www.seeddms.org Main Site + */ -require("inc/inc.Settings.php"); +require "inc/inc.Settings.php"; if(true) { require_once("inc/inc.Utils.php"); From 4f4f3923b9ee0b6db3bdd829ab0643daf25f727a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 26 Oct 2024 11:47:22 +0200 Subject: [PATCH 7/7] code beautifying --- out/out.ReviewSummary.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/out/out.ReviewSummary.php b/out/out.ReviewSummary.php index 3632abc60..0fe37b405 100644 --- a/out/out.ReviewSummary.php +++ b/out/out.ReviewSummary.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, null, $user, $settings); if ($user->isGuest()) { - UI::exitError(getMLText("my_documents"),getMLText("access_denied")); + UI::exitError(getMLText("my_documents"), getMLText("access_denied")); } if($view) {