From bb3071bdae0372b03b3659535f28764a71837129 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 11 Sep 2017 08:21:28 +0200 Subject: [PATCH 01/10] use cmd timeout when indexing document (Closes 344) --- op/op.Ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index d25efbb3f..6fd1843ab 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -754,7 +754,7 @@ switch($command) { $index = $indexconf['Indexer']::open($settings->_luceneDir); if($index) { $indexconf['Indexer']::init($settings->_stopWordsFile); - $idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false); + $idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout); if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) { if (method_exists($hookObj, 'preIndexDocument')) { From 5f564e2b966f0c66347584be2c5ee0b1386d5a6d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 11 Sep 2017 08:22:21 +0200 Subject: [PATCH 02/10] add entry for 5.0.14 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index b4a314aca..f6f900093 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- Changes in version 5.0.14 -------------------------------------------------------------------------------- +- use cmd timeout when indexing documents (Closes #344) -------------------------------------------------------------------------------- Changes in version 5.0.13 From 626c65b0e4385b6abb86fb656de1259805209d4d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 07:14:09 +0200 Subject: [PATCH 03/10] createPreview() returns falls if converter programm fails --- SeedDMS_Preview/Preview/Previewer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index 970fcdb95..c32271c29 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -140,6 +140,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base { try { self::execWithTimeout($cmd, $this->timeout); } catch(Exception $e) { + return false; } } return true; From 8c776c82698fe0ca07e42efd0ef638e137a43eb2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 07:14:39 +0200 Subject: [PATCH 04/10] new version 1.2.3 --- SeedDMS_Preview/package.xml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index 71eb627ba..6c0211aef 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,10 +11,10 @@ uwe@steinmann.cx yes - 2017-03-02 - + 2017-09-18 + - 1.2.2 + 1.2.3 1.2.0 @@ -23,8 +23,7 @@ GPL License -commands can be set for mimetypes 'xxxx/*' and '*' -pass mimetype as parameter '%m' to converter +createPreview() returns false if running the converter command fails @@ -271,5 +270,22 @@ add new previewer which converts document to pdf instead of png setConverters() overrides exiting converters + + 2017-03-02 + + + 1.2.2 + 1.2.0 + + + stable + stable + + GPL License + +commands can be set for mimetypes 'xxxx/*' and '*' +pass mimetype as parameter '%m' to converter + + From 82ca6f830253a6b6986b67a1915a01d4b2eff2e0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 10:22:39 +0200 Subject: [PATCH 05/10] createPreview() returns false if command cannot be executed --- SeedDMS_Preview/Preview/PdfPreviewer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/SeedDMS_Preview/Preview/PdfPreviewer.php b/SeedDMS_Preview/Preview/PdfPreviewer.php index f3c618b9f..49b303359 100644 --- a/SeedDMS_Preview/Preview/PdfPreviewer.php +++ b/SeedDMS_Preview/Preview/PdfPreviewer.php @@ -101,6 +101,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base { try { self::execWithTimeout($cmd, $this->timeout); } catch(Exception $e) { + return false; } } return true; From a1ca5991d891e049f01ee8523288a25531c7b413 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 10:23:26 +0200 Subject: [PATCH 06/10] remove some empty lines --- SeedDMS_Preview/Preview/Base.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SeedDMS_Preview/Preview/Base.php b/SeedDMS_Preview/Preview/Base.php index b68186c69..25a36cdee 100644 --- a/SeedDMS_Preview/Preview/Base.php +++ b/SeedDMS_Preview/Preview/Base.php @@ -64,13 +64,13 @@ class SeedDMS_Preview_Base { 2 => array("pipe", "w") ); $pipes = array(); - + $timeout += time(); $process = proc_open($cmd, $descriptorspec, $pipes); if (!is_resource($process)) { throw new Exception("proc_open failed on: " . $cmd); } - + $output = ''; $timeleft = $timeout - time(); $read = array($pipes[1]); @@ -78,13 +78,13 @@ class SeedDMS_Preview_Base { $exeptions = NULL; do { stream_select($read, $write, $exeptions, $timeleft, 200000); - + if (!empty($read)) { $output .= fread($pipes[1], 8192); } $timeleft = $timeout - time(); } while (!feof($pipes[1]) && $timeleft > 0); - + if ($timeleft <= 0) { proc_terminate($process); throw new Exception("command timeout on: " . $cmd); @@ -109,7 +109,7 @@ class SeedDMS_Preview_Base { /** * Check if converter for a given mimetype is set * - * @param string $mimetype + * @param string $mimetype * @return boolean true if converter exists, otherwise false */ function hasConverter($mimetype) { /* {{{ */ From f666996f201fd5b15eea802abdc4b31c7cb5372f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 10:23:40 +0200 Subject: [PATCH 07/10] remove default icon if preview could not be created --- op/op.Preview.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/op/op.Preview.php b/op/op.Preview.php index 91c057be0..85effaf9f 100644 --- a/op/op.Preview.php +++ b/op/op.Preview.php @@ -71,8 +71,15 @@ if(!empty($_GET["width"])) $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir, $_GET["width"]); else $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir); -if(!$previewer->hasPreview($object)) - $previewer->createPreview($object); +if(!$previewer->hasPreview($object)) { + if(!$previewer->createPreview($object)) { + } +} +if(!$previewer->hasPreview($object)) { + header('Content-Type: image/svg+xml'); + readfile('../views/'.$theme.'/images/empty.svg'); + exit; +} header('Content-Type: image/png'); $previewer->getPreview($object); From 450d4cc27d7bf85f64b40dee2f5b05ed10197562 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 10:54:05 +0200 Subject: [PATCH 08/10] fix label in form --- views/bootstrap/class.PasswordForgotten.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.PasswordForgotten.php b/views/bootstrap/class.PasswordForgotten.php index dcf88d2b2..89363237a 100644 --- a/views/bootstrap/class.PasswordForgotten.php +++ b/views/bootstrap/class.PasswordForgotten.php @@ -82,7 +82,7 @@ document.form1.email.focus();

- +
From 649ed029868d957e4cc96fa8dbcb22dfb2e89e5c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 18 Sep 2017 10:54:13 +0200 Subject: [PATCH 09/10] add entry for 4.3.37 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 4ab10c2ed..d43439ad7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- Changes in version 4.3.37 -------------------------------------------------------------------------------- +- fix label in password forgotten form (Closes #346) -------------------------------------------------------------------------------- Changes in version 4.3.36 From 0967c109d0635c8586d93f1a33bd50644175acc4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 20 Sep 2017 09:22:43 +0200 Subject: [PATCH 10/10] urlencode file name in printDropFolderChooserHtml() --- views/bootstrap/class.Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 70d7205f9..0602ab109 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1150,7 +1150,7 @@ $(document).ready(function() { print "\n"; ?>