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

This commit is contained in:
Uwe Steinmann 2024-09-05 18:10:48 +02:00
commit dfe73c8cb1
5 changed files with 14 additions and 6 deletions

View File

@ -303,6 +303,9 @@
- fix bugs when importing files from filesystem with metadata, better logging
- fix potential xss attack when showing log file
- support for different storage of documents (not yet used)
- do not treat repository url like a directory name (will no longer add a
directory seperator)
- use rename() on windows when moving an extension to its final destination
--------------------------------------------------------------------------------
Changes in version 5.1.35

View File

@ -569,12 +569,16 @@ class SeedDMS_Extension_Mgr {
* location and leave the extracted archive in place. The next time an
* extension is imported the last extracted archive will be removed.
*/
// if(!rename($newdir, $this->extdir ."/". $extname)) {
if(false === exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname))) {
if(strpos(PHP_OS, 'WIN') === 0)
$ret = rename($newdir, $this->extdir ."/". $extname);
else
$ret = exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname));
if(false === $ret) {
/* If copy didn't succeed, then there is probably nothing to delete,
* but do it anyway, just to be sure not just parts of the extension
* has been copied.
*/
$this->errmsgs[] = "Cannot move temp. extension directory to final destination";
$this->rrmdir($this->extdir ."/". $extname);
return false;
}

View File

@ -170,7 +170,7 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
if($settings->_enableLoginByEmail) {
$ldapsearchterm = "|(".$ldapsearchterm.")(mail=".$username.")";
}
/* If a ldap filter is set, it will be anded */
/* If a ldap filter is set, it will be added */
if($settings->_ldapFilter) {
$ldapsearchterm = "&(".$ldapsearchterm.")".$settings->_ldapFilter;
}

View File

@ -187,7 +187,7 @@ if ($action == "saveSettings")
setDirValue("backupDir");
setDirValue("checkOutDir");
setBoolValue("createCheckOutDir");
setDirValue("repositoryUrl");
setStrValue("repositoryUrl");
setDirValue("proxyUrl");
setDirValue("proxyUser");
setDirValue("proxyPassword");

View File

@ -671,9 +671,10 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
break;
case 'select':
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
$multiple = empty($conf['multiple']) ? false : $conf['multiple'];
if(!empty($conf['options'])) {
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." style=\"width: 100%;\">";
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_option")."\" style=\"width: 100%;\">";
if(is_array($conf['options'])) {
$options = $conf['options'];
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
@ -696,7 +697,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
case "categories":
$categories = $dms->getDocumentCategories();
if($categories) {
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_category")."\" style=\"width: 100%;\">";
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".($multiple ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." data-placeholder=\"".getMLText("select_category")."\" style=\"width: 100%;\">";
if($allowempty)
echo "<option value=\"\"></option>";
foreach($categories as $category) {