new parameter xsendfile

This commit is contained in:
Uwe Steinmann 2019-01-18 13:08:21 +01:00
parent dcb0a746a0
commit bcfde858d8
2 changed files with 6 additions and 1 deletions

View File

@ -174,6 +174,8 @@ class Settings { /* {{{ */
var $_partitionSize = 2000000;
// max size of files uploaded by fine-uploader, set to 0 for unlimited
var $_maxUploadSize = 0;
// enable/disables xsendfile
var $_enableXsendfile = true;
// enable/disable users images
var $_enableUserImage = false;
// enable/disable replacing documents by webdav
@ -512,6 +514,7 @@ class Settings { /* {{{ */
$this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]);
$this->_partitionSize = strval($tab["partitionSize"]);
$this->_maxUploadSize = strval($tab["maxUploadSize"]);
$this->_enableXsendfile = Settings::boolVal($tab["enableXsendfile"]);
}
// XML Path: /configuration/system/authentication
@ -847,6 +850,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableLargeFileUpload", $this->_enableLargeFileUpload);
$this->setXMLAttributValue($node, "partitionSize", $this->_partitionSize);
$this->setXMLAttributValue($node, "maxUploadSize", $this->_maxUploadSize);
$this->setXMLAttributValue($node, "enableXsendfile", $this->_enableXsendfile);
// XML Path: /configuration/system/authentication
$node = $this->getXMLNode($xml, '/configuration/system', 'authentication');

View File

@ -563,7 +563,8 @@ function addDirSep($str) { /* {{{ */
* @param string $filename
*/
function sendFile($filename) { /* {{{ */
if(function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())) {
global $settings;
if($settings->_enableXsendfile && function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())) {
header("X-Sendfile: ".$filename);
} else {
/* Make sure output buffering is off */