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

This commit is contained in:
Uwe Steinmann 2021-09-30 07:56:50 +02:00
commit 77a606cebe
5 changed files with 168 additions and 168 deletions

View File

@ -491,7 +491,7 @@ class SeedDMS_Core_User { /* {{{ */
$classname = $dms->getClassname('role'); $classname = $dms->getClassname('role');
for ($i = 0; $i < count($resArr); $i++) { for ($i = 0; $i < count($resArr); $i++) {
/** @var SeedDMS_Core_User $user */ /** @var SeedDMS_Core_User $user */
$role = $classname::getInstance($resArr[$i]['role'], $dms); $role = $classname::getInstance($resArr[$i]['role'], $dms);
$user = new self($resArr[$i]["id"], $resArr[$i]["login"], $resArr[$i]["pwd"], $resArr[$i]["fullName"], $resArr[$i]["email"], (isset($resArr[$i]["language"])?$resArr[$i]["language"]:NULL), (isset($resArr[$i]["theme"])?$resArr[$i]["theme"]:NULL), $resArr[$i]["comment"], $role, $resArr[$i]["hidden"], $resArr[$i]["disabled"], $resArr[$i]["pwdExpiration"], $resArr[$i]["loginfailures"], $resArr[$i]["quota"], $resArr[$i]["homefolder"]); $user = new self($resArr[$i]["id"], $resArr[$i]["login"], $resArr[$i]["pwd"], $resArr[$i]["fullName"], $resArr[$i]["email"], (isset($resArr[$i]["language"])?$resArr[$i]["language"]:NULL), (isset($resArr[$i]["theme"])?$resArr[$i]["theme"]:NULL), $resArr[$i]["comment"], $role, $resArr[$i]["hidden"], $resArr[$i]["disabled"], $resArr[$i]["pwdExpiration"], $resArr[$i]["loginfailures"], $resArr[$i]["quota"], $resArr[$i]["homefolder"]);
$user->setDMS($dms); $user->setDMS($dms);
@ -1751,9 +1751,9 @@ class SeedDMS_Core_User { /* {{{ */
"AND `tblDocumentReviewers`.`type`='0' ". "AND `tblDocumentReviewers`.`type`='0' ".
"AND `tblDocumentReviewers`.`required`='". $this->_id ."' ". "AND `tblDocumentReviewers`.`required`='". $this->_id ."' ".
"ORDER BY `tblDocumentReviewLog`.`reviewLogID` DESC"; "ORDER BY `tblDocumentReviewLog`.`reviewLogID` DESC";
$resArr = $db->getResultArray($queryStr); $resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr === false) if (is_bool($resArr) && $resArr === false)
return false; return false;
if (count($resArr)>0) { if (count($resArr)>0) {
foreach ($resArr as $res) { foreach ($resArr as $res) {
if(isset($status["indstatus"][$res['documentID']])) { if(isset($status["indstatus"][$res['documentID']])) {
@ -1764,7 +1764,7 @@ class SeedDMS_Core_User { /* {{{ */
$status["indstatus"][$res['documentID']] = $res; $status["indstatus"][$res['documentID']] = $res;
} }
} }
} }
// See if the user is the member of a group that has been assigned to // See if the user is the member of a group that has been assigned to
// review the document version. // review the document version.

View File

@ -216,7 +216,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
if (isset($GLOBALS['SEEDDMS_HOOKS']['mailqueue'])) { if (isset($GLOBALS['SEEDDMS_HOOKS']['mailqueue'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['mailqueue'] as $queueService) { foreach($GLOBALS['SEEDDMS_HOOKS']['mailqueue'] as $queueService) {
if(method_exists($queueService, 'queueMailJob')) { if(method_exists($queueService, 'queueMailJob')) {
$ret = $queueService->queueMailJob($mail_params, $to, $hdrs, getMLText($subject, $params, "", $lang), $message); $ret = $queueService->queueMailJob($mail_params, $to, $hdrs, getMLText($subject, $params, "", $lang), $message);
if($ret !== null) if($ret !== null)
return $ret; return $ret;

View File

@ -446,8 +446,8 @@ class Settings { /* {{{ */
* *
*/ */
function arrayToString($value) { /* {{{ */ function arrayToString($value) { /* {{{ */
return implode(";", $value); return implode(";", $value);
} /* }}} */ } /* }}} */
/** /**
* Return array from ';' seperated string * Return array from ';' seperated string
@ -456,8 +456,8 @@ class Settings { /* {{{ */
* *
*/ */
function stringToArray($value) { /* {{{ */ function stringToArray($value) { /* {{{ */
return explode(";", $Value); return explode(";", $Value);
} /* }}} */ } /* }}} */
/** /**
* set $_viewOnlineFileTypes * set $_viewOnlineFileTypes
@ -465,9 +465,9 @@ class Settings { /* {{{ */
* @param string $stringValue string value * @param string $stringValue string value
* *
*/ */
function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */ function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */
$this->_viewOnlineFileTypes = explode(";", $stringValue); $this->_viewOnlineFileTypes = explode(";", $stringValue);
} /* }}} */ } /* }}} */
/** /**
* get $_viewOnlineFileTypes in a string value * get $_viewOnlineFileTypes in a string value
@ -475,9 +475,9 @@ class Settings { /* {{{ */
* @return string value * @return string value
* *
*/ */
function getViewOnlineFileTypesToString() { /* {{{ */ function getViewOnlineFileTypesToString() { /* {{{ */
return implode(";", $this->_viewOnlineFileTypes); return implode(";", $this->_viewOnlineFileTypes);
} /* }}} */ } /* }}} */
/** /**
* set $_editOnlineFileTypes * set $_editOnlineFileTypes
@ -485,9 +485,9 @@ class Settings { /* {{{ */
* @param string $stringValue string value * @param string $stringValue string value
* *
*/ */
function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */ function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */
$this->_editOnlineFileTypes = explode(";", $stringValue); $this->_editOnlineFileTypes = explode(";", $stringValue);
} /* }}} */ } /* }}} */
/** /**
* get $_editOnlineFileTypes in a string value * get $_editOnlineFileTypes in a string value
@ -495,9 +495,9 @@ class Settings { /* {{{ */
* @return string value * @return string value
* *
*/ */
function getEditOnlineFileTypesToString() { /* {{{ */ function getEditOnlineFileTypesToString() { /* {{{ */
return implode(";", $this->_editOnlineFileTypes); return implode(";", $this->_editOnlineFileTypes);
} /* }}} */ } /* }}} */
/** /**
* Load config file * Load config file
@ -870,22 +870,22 @@ class Settings { /* {{{ */
* *
* @return true/false * @return true/false
*/ */
protected function setXMLAttributValue($node, $attributName, $attributValue) { /* {{{ */ protected function setXMLAttributValue($node, $attributName, $attributValue) { /* {{{ */
if (is_bool($attributValue)) { if (is_bool($attributValue)) {
if ($attributValue) if ($attributValue)
$attributValue = "true"; $attributValue = "true";
else else
$attributValue = "false"; $attributValue = "false";
} elseif(is_array($attributValue)) { } elseif(is_array($attributValue)) {
$attributValue = implode(';', $attributValue); $attributValue = implode(';', $attributValue);
} }
if (isset($node[$attributName])) { if (isset($node[$attributName])) {
$node[$attributName] = $attributValue; $node[$attributName] = $attributValue;
} else { } else {
$node->addAttribute($attributName, $attributValue); $node->addAttribute($attributName, $attributValue);
} }
} /* }}} */ } /* }}} */
/** /**
* Get XML node, create it if not exists * Get XML node, create it if not exists
@ -917,12 +917,12 @@ class Settings { /* {{{ */
* @return true/false * @return true/false
*/ */
public function save($configFilePath=NULL) { /* {{{ */ public function save($configFilePath=NULL) { /* {{{ */
if (is_null($configFilePath)) if (is_null($configFilePath))
$configFilePath = $this->_configFilePath; $configFilePath = $this->_configFilePath;
// Load // Load
$xml = simplexml_load_string(file_get_contents($configFilePath)); $xml = simplexml_load_string(file_get_contents($configFilePath));
$this->getXMLNode($xml, '/', 'configuration'); $this->getXMLNode($xml, '/', 'configuration');
// XML Path: /configuration/site/display // XML Path: /configuration/site/display
$this->getXMLNode($xml, '/configuration', 'site'); $this->getXMLNode($xml, '/configuration', 'site');
@ -1044,71 +1044,71 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage); $this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit); $this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
// XML Path: /configuration/system/authentication/connectors // XML Path: /configuration/system/authentication/connectors
foreach($this->_usersConnectors as $keyConn => $paramConn) foreach($this->_usersConnectors as $keyConn => $paramConn)
{ {
// search XML node // search XML node
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="'. $keyConn .'"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="'. $keyConn .'"]');
// Just the first is configured // Just the first is configured
if (isset($node)) if (isset($node))
{ {
if (count($node)>0) if (count($node)>0)
{ {
$node = $node[0]; $node = $node[0];
} }
else else
{ {
$nodeParent = $xml->xpath('/configuration/system/authentication/connectors'); $nodeParent = $xml->xpath('/configuration/system/authentication/connectors');
$node = $nodeParent[0]->addChild("connector"); $node = $nodeParent[0]->addChild("connector");
} }
foreach($paramConn as $key => $value) foreach($paramConn as $key => $value)
{ {
$this->setXMLAttributValue($node, $key, $value); $this->setXMLAttributValue($node, $key, $value);
} }
} // isset($node) } // isset($node)
} // foreach } // foreach
// XML Path: /configuration/system/authentication/connectors // XML Path: /configuration/system/authentication/connectors
// manage old settings parameters // manage old settings parameters
if (isset($this->_ldapHost) && (strlen($this->_ldapHost)>0)) if (isset($this->_ldapHost) && (strlen($this->_ldapHost)>0))
{ {
if ($this->_ldapType == 1) if ($this->_ldapType == 1)
{ {
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="AD"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="AD"]');
$node = $node[0]; $node = $node[0];
$this->setXMLAttributValue($node, "accountDomainName", $this->_ldapAccountDomainName); $this->setXMLAttributValue($node, "accountDomainName", $this->_ldapAccountDomainName);
} }
else else
{ {
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="ldap"]'); $node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="ldap"]');
$node = $node[0]; $node = $node[0];
} }
$this->setXMLAttributValue($node, "host", $this->_ldapHost); $this->setXMLAttributValue($node, "host", $this->_ldapHost);
$this->setXMLAttributValue($node, "port", $this->_ldapPort); $this->setXMLAttributValue($node, "port", $this->_ldapPort);
$this->setXMLAttributValue($node, "baseDN", $this->_ldapBaseDN); $this->setXMLAttributValue($node, "baseDN", $this->_ldapBaseDN);
} }
// XML Path: /configuration/system/database // XML Path: /configuration/system/database
$node = $this->getXMLNode($xml, '/configuration/system', 'database'); $node = $this->getXMLNode($xml, '/configuration/system', 'database');
$this->setXMLAttributValue($node, "dbDriver", $this->_dbDriver); $this->setXMLAttributValue($node, "dbDriver", $this->_dbDriver);
$this->setXMLAttributValue($node, "dbHostname", $this->_dbHostname); $this->setXMLAttributValue($node, "dbHostname", $this->_dbHostname);
$this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase); $this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase);
$this->setXMLAttributValue($node, "dbUser", $this->_dbUser); $this->setXMLAttributValue($node, "dbUser", $this->_dbUser);
$this->setXMLAttributValue($node, "dbPass", $this->_dbPass); $this->setXMLAttributValue($node, "dbPass", $this->_dbPass);
$this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion); $this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion);
// XML Path: /configuration/system/smtp // XML Path: /configuration/system/smtp
$node = $this->getXMLNode($xml, '/configuration/system', 'smtp'); $node = $this->getXMLNode($xml, '/configuration/system', 'smtp');
$this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer); $this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer);
$this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort); $this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort);
$this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom); $this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom);
$this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser); $this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser);
$this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword); $this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword);
// XML Path: /configuration/advanced/display // XML Path: /configuration/advanced/display
$advnode = $this->getXMLNode($xml, '/configuration', 'advanced'); $advnode = $this->getXMLNode($xml, '/configuration', 'advanced');
@ -1119,62 +1119,62 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations); $this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations);
// $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields); // $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields);
// XML Path: /configuration/advanced/authentication // XML Path: /configuration/advanced/authentication
$node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication');
$this->setXMLAttributValue($node, "guestID", $this->_guestID); $this->setXMLAttributValue($node, "guestID", $this->_guestID);
$this->setXMLAttributValue($node, "adminIP", $this->_adminIP); $this->setXMLAttributValue($node, "adminIP", $this->_adminIP);
$this->setXMLAttributValue($node, "apiKey", $this->_apiKey); $this->setXMLAttributValue($node, "apiKey", $this->_apiKey);
$this->setXMLAttributValue($node, "apiUserId", $this->_apiUserId); $this->setXMLAttributValue($node, "apiUserId", $this->_apiUserId);
$this->setXMLAttributValue($node, "apiOrigin", $this->_apiOrigin); $this->setXMLAttributValue($node, "apiOrigin", $this->_apiOrigin);
// XML Path: /configuration/advanced/edition // XML Path: /configuration/advanced/edition
$node = $this->getXMLNode($xml, '/configuration/advanced', 'edition'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'edition');
$this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp); $this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp);
$this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp); $this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp);
$this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp); $this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp);
$this->setXMLAttributValue($node, "enableUpdateRevApp", $this->_enableUpdateRevApp); $this->setXMLAttributValue($node, "enableUpdateRevApp", $this->_enableUpdateRevApp);
$this->setXMLAttributValue($node, "enableRemoveRevApp", $this->_enableRemoveRevApp); $this->setXMLAttributValue($node, "enableRemoveRevApp", $this->_enableRemoveRevApp);
$this->setXMLAttributValue($node, "enableSelfReceipt", $this->_enableSelfReceipt); $this->setXMLAttributValue($node, "enableSelfReceipt", $this->_enableSelfReceipt);
$this->setXMLAttributValue($node, "enableAdminReceipt", $this->_enableAdminReceipt); $this->setXMLAttributValue($node, "enableAdminReceipt", $this->_enableAdminReceipt);
$this->setXMLAttributValue($node, "enableOwnerReceipt", $this->_enableOwnerReceipt); $this->setXMLAttributValue($node, "enableOwnerReceipt", $this->_enableOwnerReceipt);
$this->setXMLAttributValue($node, "enableUpdateReceipt", $this->_enableUpdateReceipt); $this->setXMLAttributValue($node, "enableUpdateReceipt", $this->_enableUpdateReceipt);
$this->setXMLAttributValue($node, "enableFilterReceipt", $this->_enableFilterReceipt); $this->setXMLAttributValue($node, "enableFilterReceipt", $this->_enableFilterReceipt);
$this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate); $this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate);
$this->setXMLAttributValue($node, "initialDocumentStatus", $this->_initialDocumentStatus); $this->setXMLAttributValue($node, "initialDocumentStatus", $this->_initialDocumentStatus);
$this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName); $this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName);
$this->setXMLAttributValue($node, "workflowMode", $this->_workflowMode); $this->setXMLAttributValue($node, "workflowMode", $this->_workflowMode);
$this->setXMLAttributValue($node, "enableReceiptWorkflow", $this->_enableReceiptWorkflow); $this->setXMLAttributValue($node, "enableReceiptWorkflow", $this->_enableReceiptWorkflow);
$this->setXMLAttributValue($node, "enableReceiptReject", $this->_enableReceiptReject); $this->setXMLAttributValue($node, "enableReceiptReject", $this->_enableReceiptReject);
$this->setXMLAttributValue($node, "enableRevisionWorkflow", $this->_enableRevisionWorkflow); $this->setXMLAttributValue($node, "enableRevisionWorkflow", $this->_enableRevisionWorkflow);
$this->setXMLAttributValue($node, "enableRevisionOneVoteReject", $this->_enableRevisionOneVoteReject); $this->setXMLAttributValue($node, "enableRevisionOneVoteReject", $this->_enableRevisionOneVoteReject);
$this->setXMLAttributValue($node, "allowReviewerOnly", $this->_allowReviewerOnly); $this->setXMLAttributValue($node, "allowReviewerOnly", $this->_allowReviewerOnly);
$this->setXMLAttributValue($node, "allowChangeRevAppInProcess", $this->_allowChangeRevAppInProcess); $this->setXMLAttributValue($node, "allowChangeRevAppInProcess", $this->_allowChangeRevAppInProcess);
$this->setXMLAttributValue($node, "enableVersionDeletion", $this->_enableVersionDeletion); $this->setXMLAttributValue($node, "enableVersionDeletion", $this->_enableVersionDeletion);
$this->setXMLAttributValue($node, "enableVersionModification", $this->_enableVersionModification); $this->setXMLAttributValue($node, "enableVersionModification", $this->_enableVersionModification);
$this->setXMLAttributValue($node, "enableDuplicateDocNames", $this->_enableDuplicateDocNames); $this->setXMLAttributValue($node, "enableDuplicateDocNames", $this->_enableDuplicateDocNames);
$this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames); $this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames);
$this->setXMLAttributValue($node, "enableCancelCheckout", $this->_enableCancelCheckout); $this->setXMLAttributValue($node, "enableCancelCheckout", $this->_enableCancelCheckout);
$this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType); $this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType);
$this->setXMLAttributValue($node, "advancedAcl", $this->_advancedAcl); $this->setXMLAttributValue($node, "advancedAcl", $this->_advancedAcl);
$this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder); $this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder);
// XML Path: /configuration/advanced/notification // XML Path: /configuration/advanced/notification
$node = $this->getXMLNode($xml, '/configuration/advanced', 'notification'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'notification');
$this->setXMLAttributValue($node, "enableNotificationAppRev", $this->_enableNotificationAppRev); $this->setXMLAttributValue($node, "enableNotificationAppRev", $this->_enableNotificationAppRev);
$this->setXMLAttributValue($node, "enableOwnerNotification", $this->_enableOwnerNotification); $this->setXMLAttributValue($node, "enableOwnerNotification", $this->_enableOwnerNotification);
$this->setXMLAttributValue($node, "enableNotificationWorkflow", $this->_enableNotificationWorkflow); $this->setXMLAttributValue($node, "enableNotificationWorkflow", $this->_enableNotificationWorkflow);
// XML Path: /configuration/advanced/server // XML Path: /configuration/advanced/server
$node = $this->getXMLNode($xml, '/configuration/advanced', 'server'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'server');
$this->setXMLAttributValue($node, "coreDir", $this->_coreDir); $this->setXMLAttributValue($node, "coreDir", $this->_coreDir);
$this->setXMLAttributValue($node, "luceneClassDir", $this->_luceneClassDir); $this->setXMLAttributValue($node, "luceneClassDir", $this->_luceneClassDir);
$this->setXMLAttributValue($node, "extraPath", $this->_extraPath); $this->setXMLAttributValue($node, "extraPath", $this->_extraPath);
$this->setXMLAttributValue($node, "contentOffsetDir", $this->_contentOffsetDir); $this->setXMLAttributValue($node, "contentOffsetDir", $this->_contentOffsetDir);
$this->setXMLAttributValue($node, "maxDirID", $this->_maxDirID); $this->setXMLAttributValue($node, "maxDirID", $this->_maxDirID);
$this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime); $this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime);
$this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime); $this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime);
$this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout); $this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout);
$this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode); $this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode);
/* Check if there is still a converters list with a target attribute */ /* Check if there is still a converters list with a target attribute */
$node = $xml->xpath('/configuration/advanced/converters[count(@*)=0]'); $node = $xml->xpath('/configuration/advanced/converters[count(@*)=0]');
@ -1213,8 +1213,8 @@ class Settings { /* {{{ */
} // foreach } // foreach
// XML Path: /configuration/extensions // XML Path: /configuration/extensions
$extnodes = $xml->xpath('/configuration/extensions'); $extnodes = $xml->xpath('/configuration/extensions');
if(!$extnodes) { if(!$extnodes) {
$nodeParent = $xml->xpath('/configuration'); $nodeParent = $xml->xpath('/configuration');
$extnodes = $nodeParent[0]->addChild("extensions"); $extnodes = $nodeParent[0]->addChild("extensions");
@ -1222,9 +1222,9 @@ class Settings { /* {{{ */
unset($xml->extensions); unset($xml->extensions);
$extnodes = $xml->addChild("extensions"); $extnodes = $xml->addChild("extensions");
} }
foreach($this->_extensions as $name => $extension) foreach($this->_extensions as $name => $extension)
{ {
// search XML node // search XML node
$extnode = $extnodes->addChild('extension'); $extnode = $extnodes->addChild('extension');
$this->setXMLAttributValue($extnode, 'name', $name); $this->setXMLAttributValue($extnode, 'name', $name);
$this->setXMLAttributValue($extnode, 'disable', $extension['__disable__'] ? 'true' : 'false'); $this->setXMLAttributValue($extnode, 'disable', $extension['__disable__'] ? 'true' : 'false');
@ -1250,10 +1250,10 @@ class Settings { /* {{{ */
*/ */
} // foreach } // foreach
// Save // Save
return $xml->asXML($configFilePath); return $xml->asXML($configFilePath);
} /* }}} */ } /* }}} */
/** /**
@ -1325,15 +1325,15 @@ class Settings { /* {{{ */
$pageURL = 'http'; $pageURL = 'http';
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$pageURL .= "s"; $pageURL .= "s";
} }
$pageURL .= "://"; $pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") { if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else { } else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
} }
return $pageURL; return $pageURL;

View File

@ -39,25 +39,25 @@ if(!trim($settings->_encryptionKey)) {
$__basedir = dirname(dirname(__DIR__)); $__basedir = dirname(dirname(__DIR__));
$__datadir = dirname(dirname(__DIR__))."/data";; $__datadir = dirname(dirname(__DIR__))."/data";;
if(empty($settings->_rootDir)) { if(empty($settings->_rootDir)) {
$settings->_rootDir = $__basedir."/www/"; $settings->_rootDir = $__basedir."/www/";
} }
if(empty($settings->_contentDir)) { if(empty($settings->_contentDir)) {
$settings->_contentDir = $__basedir; $settings->_contentDir = $__basedir;
} }
if(empty($settings->_cacheDir)) { if(empty($settings->_cacheDir)) {
$settings->_cacheDir = $__datadir."/cache/"; $settings->_cacheDir = $__datadir."/cache/";
} }
if(empty($settings->_backupDir)) { if(empty($settings->_backupDir)) {
$settings->_backupDir = $__datadir."/backup/"; $settings->_backupDir = $__datadir."/backup/";
} }
if(empty($settings->_luceneDir)) { if(empty($settings->_luceneDir)) {
$settings->_luceneDir = $__datadir."/lucene/"; $settings->_luceneDir = $__datadir."/lucene/";
} }
if(empty($settings->_stagingDir)) { if(empty($settings->_stagingDir)) {
$settings->_stagingDir = $__datadir."/lucene/"; $settings->_stagingDir = $__datadir."/lucene/";
} }
if($settings->_dbDriver == 'sqlite' && empty($settings->_dbDatabase)) { if($settings->_dbDriver == 'sqlite' && empty($settings->_dbDatabase)) {
$settings->_dbDatabase = $__datadir."/content.db"; $settings->_dbDatabase = $__datadir."/content.db";
} }
ini_set('include_path', $settings->_rootDir.'pear'. PATH_SEPARATOR .ini_get('include_path')); ini_set('include_path', $settings->_rootDir.'pear'. PATH_SEPARATOR .ini_get('include_path'));

View File

@ -1045,12 +1045,12 @@ class SeedDMS_JwtToken { /* {{{ */
class SeedDMS_FolderTree { /* {{{ */ class SeedDMS_FolderTree { /* {{{ */
public function __construct($folder, $callback) { /* {{{ */ public function __construct($folder, $callback) { /* {{{ */
$iter = new \SeedDMS\RecursiveFolderIterator($folder); $iter = new \SeedDMS\RecursiveFolderIterator($folder);
$iter2 = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::SELF_FIRST); $iter2 = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::SELF_FIRST);
foreach($iter2 as $ff) { foreach($iter2 as $ff) {
call_user_func($callback, $ff, $iter2->getDepth()); call_user_func($callback, $ff, $iter2->getDepth());
// echo $ff->getID().': '.$ff->getFolderPathPlain().'-'.$ff->getName()."<br />"; // echo $ff->getID().': '.$ff->getFolderPathPlain().'-'.$ff->getName()."<br />";
} }
} /* }}} */ } /* }}} */
} /* }}} */ } /* }}} */