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
- initial support for installation from git
- 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

View File

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

View File

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

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

View File

@ -3669,7 +3669,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$hookObjs = $this->getHookObjects();
foreach($hookObjs as $hookObj) {
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;
case 'video/webm':
case 'video/mp4':
case 'video/mpeg':
case 'video/avi':
case 'video/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();
foreach($hookObjs as $hookObj) {
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() { /* {{{ */
$('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'));
});
}); /* }}} */

View File

@ -85,12 +85,10 @@ if(true) {
return $response
->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php')
->withStatus(302);
});
$app->run();
} else {
header("Location: ". (isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php"));
?>
<html>