Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2025-10-20 13:43:44 +02:00
commit 0b5b585d6f
11 changed files with 45 additions and 25 deletions

View File

@ -347,6 +347,8 @@
- add endpoints to rest api for setting comment and name of folder - add endpoints to rest api for setting comment and name of folder
- initial support for installation from git - initial support for installation from git
- memcached support can be configured (still rarely used) - memcached support can be configured (still rarely used)
- fix folder parameter passed to hook 'folderRowAction'
- require unrestricted access on document/folder for deletion by rest api
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.41 Changes in version 5.1.41

View File

@ -16,7 +16,7 @@
} }
}, },
"require": { "require": {
"pear/http_request2": "2.5.0", "pear/http_request2": "^2",
"robthree/twofactorauth": "^3.0", "robthree/twofactorauth": "^3.0",
"php-mime-mail-parser/php-mime-mail-parser": "*", "php-mime-mail-parser/php-mime-mail-parser": "*",
"slim/slim": "^4.0", "slim/slim": "^4.0",
@ -37,7 +37,7 @@
"alecrabbit/php-console-colour": "*", "alecrabbit/php-console-colour": "*",
"zf1/zend-search-lucene": "*", "zf1/zend-search-lucene": "*",
"symfony/http-foundation": "^5.4", "symfony/http-foundation": "^5.4",
"php-di/php-di": "^6.4", "php-di/php-di": "^7",
"hfig/mapi": "*", "hfig/mapi": "*",
"slim/psr7": "^1.7", "slim/psr7": "^1.7",
"chillerlan/php-qrcode": "^5.0", "chillerlan/php-qrcode": "^5.0",

View File

@ -22,7 +22,7 @@
"require": { "require": {
"php": ">=8.2.0", "php": ">=8.2.0",
"phing/phing": "3.*", "phing/phing": "3.*",
"pear/http_request2": "2.5.0", "pear/http_request2": "^2",
"robthree/twofactorauth": "^3.0", "robthree/twofactorauth": "^3.0",
"php-mime-mail-parser/php-mime-mail-parser": "*", "php-mime-mail-parser/php-mime-mail-parser": "*",
"slim/slim": "^4.0", "slim/slim": "^4.0",
@ -43,7 +43,7 @@
"alecrabbit/php-console-colour": "*", "alecrabbit/php-console-colour": "*",
"zf1/zend-search-lucene": "*", "zf1/zend-search-lucene": "*",
"symfony/http-foundation": "^5.4", "symfony/http-foundation": "^5.4",
"php-di/php-di": "^6.4", "php-di/php-di": "^7",
"hfig/mapi": "*", "hfig/mapi": "*",
"slim/psr7": "^1.7", "slim/psr7": "^1.7",
"chillerlan/php-qrcode": "^5.0", "chillerlan/php-qrcode": "^5.0",
@ -56,12 +56,12 @@
}, },
"require-dev": { "require-dev": {
"composer/composer": "dev-main", "composer/composer": "dev-main",
"behat/mink": "1.8.1", "behat/mink": "^1",
"behat/mink-selenium2-driver": "1.4.0", "behat/mink-selenium2-driver": "^1",
"dmore/chrome-mink-driver": "2.8.0", "dmore/chrome-mink-driver": "^2",
"friendsofphp/php-cs-fixer": "3.87.2", "friendsofphp/php-cs-fixer": "^3",
"phpunit/phpunit": "9.5.9", "phpunit/phpunit": "9.5.9",
"squizlabs/php_codesniffer": "3.6.0", "squizlabs/php_codesniffer": "^4",
"phpstan/phpstan": "^2.1", "phpstan/phpstan": "^2.1",
"pear/archive_tar": "*" "pear/archive_tar": "*"
}, },
@ -102,6 +102,9 @@
} }
} }
], ],
"scripts": {
"phpcs": "phpcs -s"
},
"extra": { "extra": {
"merge-plugin": { "merge-plugin": {
"include": [ "include": [

View File

@ -241,6 +241,8 @@ in your current installation with new versions from the quickstart archive.
3. copy the directory `pear` from the unpacked archive into your current 3. copy the directory `pear` from the unpacked archive into your current
installation, replacing the existing directory. Make a backup of `pear` before installation, replacing the existing directory. Make a backup of `pear` before
the replacement if you want to ensure to be able to go back to your old version. the replacement if you want to ensure to be able to go back to your old version.
Since version 5.1.42 and 6.0.35 of SeeDMS the directory `pear` was replaced
by `vendor`, which was previously a ѕubdirectory of `pear`.
4. you may compare your `conf/settings.xml` file with the shipped version 4. you may compare your `conf/settings.xml` file with the shipped version
`conf/settings.xml.template` for new parameters. If you don't do it, the next `conf/settings.xml.template` for new parameters. If you don't do it, the next
time you save the configuration the default values will be used. time you save the configuration the default values will be used.

View File

@ -1318,6 +1318,20 @@ class SeedDMS_Utils { /* {{{ */
} }
} /* }}} */ } /* }}} */
/**
* Create a random string
*
* @param integer $n number of chars
* @param string $alph alphabet used as source for chars
* @return string random string
*/
static public function makeRandomString($n, $alph = "0123456789abcdefghijklmnopqrstuvwxyz") { /* {{{ */
$s = "";
for ($i = 0; $i != $n; ++$i)
$s .= $alph[mt_rand(0, 35)];
return $s;
} /* }}} */
} /* }}} */ } /* }}} */
/** /**

View File

@ -646,7 +646,7 @@ final class SeedDMS_RestapiController { /* {{{ */
} }
$mfolder = $dms->getFolder($args['id']); $mfolder = $dms->getFolder($args['id']);
if($mfolder) { if($mfolder) {
if ($mfolder->getAccessMode($userobj, 'removeFolder') >= M_READWRITE) { if ($mfolder->getAccessMode($userobj, 'removeFolder') > M_READWRITE) {
if($mfolder->remove()) { if($mfolder->remove()) {
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200); return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200);
} else { } else {
@ -1224,7 +1224,7 @@ final class SeedDMS_RestapiController { /* {{{ */
$document = $dms->getDocument($args['id']); $document = $dms->getDocument($args['id']);
if($document) { if($document) {
if ($document->getAccessMode($userobj, 'deleteDocument') >= M_READWRITE) { if ($document->getAccessMode($userobj, 'deleteDocument') > M_READWRITE) {
if($document->remove()) { if($document->remove()) {
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200); return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>''))->withStatus(200);
} else { } else {

View File

@ -3669,7 +3669,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$hookObjs = $this->getHookObjects(); $hookObjs = $this->getHookObjects();
foreach($hookObjs as $hookObj) { foreach($hookObjs as $hookObj) {
if (method_exists($hookObj, 'folderRowAction')) { if (method_exists($hookObj, 'folderRowAction')) {
$actions = $hookObj->folderRowAction($this, $folder, $actions); $actions = $hookObj->folderRowAction($this, $subFolder, $actions);
} }
} }

View File

@ -626,6 +626,7 @@ $(document).ready( function() {
break; break;
case 'video/webm': case 'video/webm':
case 'video/mp4': case 'video/mp4':
case 'video/mpeg':
case 'video/avi': case 'video/avi':
case 'video/msvideo': case 'video/msvideo':
case 'video/x-msvideo': case 'video/x-msvideo':

View File

@ -3695,7 +3695,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$hookObjs = $this->getHookObjects(); $hookObjs = $this->getHookObjects();
foreach($hookObjs as $hookObj) { foreach($hookObjs as $hookObj) {
if (method_exists($hookObj, 'folderRowAction')) { if (method_exists($hookObj, 'folderRowAction')) {
$actions = $hookObj->folderRowAction($this, $folder, $actions); $actions = $hookObj->folderRowAction($this, $subFolder, $actions);
} }
} }

View File

@ -1718,7 +1718,7 @@ $(document).ready(function() { /* {{{ */
$(document).ready(function() { /* {{{ */ $(document).ready(function() { /* {{{ */
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function(){ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function(){
if($(this).attr("href")) if($(this).attr('href'))
$($(this).data("target")+' .modal-body').load($(this).attr('href')); $($(this).data("target")+' .modal-body').load($(this).attr('href'));
}); });
}); /* }}} */ }); /* }}} */

View File

@ -34,7 +34,7 @@ require "inc/inc.Settings.php";
use DI\ContainerBuilder; use DI\ContainerBuilder;
use Slim\Factory\AppFactory; use Slim\Factory\AppFactory;
if(true) { if (true) {
require_once("inc/inc.Utils.php"); require_once("inc/inc.Utils.php");
require_once("inc/inc.LogInit.php"); require_once("inc/inc.LogInit.php");
require_once("inc/inc.Language.php"); require_once("inc/inc.Language.php");
@ -60,8 +60,8 @@ if(true) {
$container->set('notifier', $notifier); $container->set('notifier', $notifier);
$container->set('authenticator', $authenticator); $container->set('authenticator', $authenticator);
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
if (method_exists($hookObj, 'addMiddleware')) { if (method_exists($hookObj, 'addMiddleware')) {
$hookObj->addMiddleware($app); $hookObj->addMiddleware($app);
} }
@ -70,8 +70,8 @@ if(true) {
$app->addErrorMiddleware(false, true, true); $app->addErrorMiddleware(false, true, true);
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
if (method_exists($hookObj, 'addRoute')) { if (method_exists($hookObj, 'addRoute')) {
// FIXME: pass $app only just like initRestAPI. $app has a container // FIXME: pass $app only just like initRestAPI. $app has a container
// which contains all other objects // which contains all other objects
@ -81,16 +81,14 @@ if(true) {
} }
/* Catch all route */ /* Catch all route */
$app->get('/{path:.*}', function($request, $response) use ($settings) { $app->get('/{path:.*}', function ($request, $response) use ($settings) {
return $response return $response
->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php') ->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php')
->withStatus(302); ->withStatus(302);
}); });
$app->run(); $app->run();
} else { } else {
header("Location: ". (isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php")); header("Location: ". (isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php"));
?> ?>
<html> <html>