mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
23f17e291e
|
@ -97,6 +97,8 @@ class Settings { /* {{{ */
|
||||||
var $_coreDir = null;
|
var $_coreDir = null;
|
||||||
// Path to SeedDMS_Lucene
|
// Path to SeedDMS_Lucene
|
||||||
var $_luceneClassDir = null;
|
var $_luceneClassDir = null;
|
||||||
|
// The base URL without _httpRoot
|
||||||
|
var $_baseUrl = "";
|
||||||
// The relative path in the URL, after the domain part.
|
// The relative path in the URL, after the domain part.
|
||||||
var $_httpRoot = "/seeddms/";
|
var $_httpRoot = "/seeddms/";
|
||||||
// Where the uploaded files are stored (best to choose a directory that
|
// Where the uploaded files are stored (best to choose a directory that
|
||||||
|
@ -615,6 +617,7 @@ class Settings { /* {{{ */
|
||||||
if($node) {
|
if($node) {
|
||||||
$tab = $node[0]->attributes();
|
$tab = $node[0]->attributes();
|
||||||
$this->_rootDir = strval($tab["rootDir"]);
|
$this->_rootDir = strval($tab["rootDir"]);
|
||||||
|
$this->_baseUrl = strval($tab["baseUrl"]);
|
||||||
$this->_httpRoot = strval($tab["httpRoot"]);
|
$this->_httpRoot = strval($tab["httpRoot"]);
|
||||||
$this->_contentDir = strval($tab["contentDir"]);
|
$this->_contentDir = strval($tab["contentDir"]);
|
||||||
if($this->_contentDir && substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
|
if($this->_contentDir && substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
|
||||||
|
@ -1003,6 +1006,7 @@ class Settings { /* {{{ */
|
||||||
$this->getXMLNode($xml, '/configuration', 'system');
|
$this->getXMLNode($xml, '/configuration', 'system');
|
||||||
$node = $this->getXMLNode($xml, '/configuration/system', 'server');
|
$node = $this->getXMLNode($xml, '/configuration/system', 'server');
|
||||||
$this->setXMLAttributValue($node, "rootDir", $this->_rootDir);
|
$this->setXMLAttributValue($node, "rootDir", $this->_rootDir);
|
||||||
|
$this->setXMLAttributValue($node, "baseUrl", $this->_baseUrl);
|
||||||
$this->setXMLAttributValue($node, "httpRoot", $this->_httpRoot);
|
$this->setXMLAttributValue($node, "httpRoot", $this->_httpRoot);
|
||||||
$this->setXMLAttributValue($node, "contentDir", $this->_contentDir);
|
$this->setXMLAttributValue($node, "contentDir", $this->_contentDir);
|
||||||
$this->setXMLAttributValue($node, "cacheDir", $this->_cacheDir);
|
$this->setXMLAttributValue($node, "cacheDir", $this->_cacheDir);
|
||||||
|
|
|
@ -807,7 +807,21 @@ function sendFile($filename) { /* {{{ */
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getBaseUrl() { /* {{{ */
|
function getBaseUrl() { /* {{{ */
|
||||||
return "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'];
|
global $settings;
|
||||||
|
|
||||||
|
if(!empty($settings->_baseUrl))
|
||||||
|
return $settings->_baseUrl;
|
||||||
|
|
||||||
|
if(isset($_SERVER['X-Forwarded-Host']))
|
||||||
|
$host = $_SERVER['X-Forwarded-Host'];
|
||||||
|
else
|
||||||
|
$host = $_SERVER['HTTP_HOST'];
|
||||||
|
if(isset($_SERVER['X-Forwarded-Proto']))
|
||||||
|
$ssl = $_SERVER['X-Forwarded-Proto'] == 'https';
|
||||||
|
else
|
||||||
|
$ssl = (isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0));
|
||||||
|
|
||||||
|
return "http".($ssl ? "s" : "")."://".$host;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getToken($length){ /* {{{ */
|
function getToken($length){ /* {{{ */
|
||||||
|
|
|
@ -169,6 +169,7 @@ if ($action == "saveSettings")
|
||||||
|
|
||||||
// SETTINGS - SYSTEM - SERVER
|
// SETTINGS - SYSTEM - SERVER
|
||||||
setDirValue("rootDir");
|
setDirValue("rootDir");
|
||||||
|
setStrValue("baseUrl");
|
||||||
setStrValue("httpRoot");
|
setStrValue("httpRoot");
|
||||||
setDirValue("contentDir");
|
setDirValue("contentDir");
|
||||||
setDirValue("cacheDir");
|
setDirValue("cacheDir");
|
||||||
|
|
|
@ -424,6 +424,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
-->
|
-->
|
||||||
<?php $this->showConfigHeadline('settings_Server'); ?>
|
<?php $this->showConfigHeadline('settings_Server'); ?>
|
||||||
<?php $this->showConfigText('settings_rootDir', 'rootDir'); ?>
|
<?php $this->showConfigText('settings_rootDir', 'rootDir'); ?>
|
||||||
|
<?php $this->showConfigText('settings_baseUrl', 'baseUrl'); ?>
|
||||||
<?php $this->showConfigText('settings_httpRoot', 'httpRoot'); ?>
|
<?php $this->showConfigText('settings_httpRoot', 'httpRoot'); ?>
|
||||||
<?php $this->showConfigText('settings_contentDir', 'contentDir'); ?>
|
<?php $this->showConfigText('settings_contentDir', 'contentDir'); ?>
|
||||||
<?php $this->showConfigText('settings_backupDir', 'backupDir'); ?>
|
<?php $this->showConfigText('settings_backupDir', 'backupDir'); ?>
|
||||||
|
|
|
@ -1407,14 +1407,14 @@ $(document).ready(function() { /* {{{ */
|
||||||
);
|
);
|
||||||
|
|
||||||
SeedDMSTask.add = function(task) {
|
SeedDMSTask.add = function(task) {
|
||||||
tasks.push(task);
|
return tasks.push(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
SeedDMSTask.run = function() {
|
SeedDMSTask.run = function() {
|
||||||
for(let task of tasks) {
|
for(let task of tasks) {
|
||||||
if(counter % task.interval == 0) {
|
if(counter % task.interval == 0) {
|
||||||
// console.log("Running task '" + task.name + "'");
|
// console.log("Running task '" + task.name + "'");
|
||||||
task.func();
|
task.func(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log(counter);
|
//console.log(counter);
|
||||||
|
|
|
@ -1463,14 +1463,14 @@ $(document).ready(function() { /* {{{ */
|
||||||
);
|
);
|
||||||
|
|
||||||
SeedDMSTask.add = function(task) {
|
SeedDMSTask.add = function(task) {
|
||||||
tasks.push(task);
|
return tasks.push(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
SeedDMSTask.run = function() {
|
SeedDMSTask.run = function() {
|
||||||
for(let task of tasks) {
|
for(let task of tasks) {
|
||||||
if(counter % task.interval == 0) {
|
if(counter % task.interval == 0) {
|
||||||
// console.log("Running task '" + task.name + "'");
|
// console.log("Running task '" + task.name + "'");
|
||||||
task.func();
|
task.func(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log(counter);
|
//console.log(counter);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user