diff --git a/inc/inc.ClassController.php b/inc/inc.ClassController.php index a149e91c0..608e91fba 100644 --- a/inc/inc.ClassController.php +++ b/inc/inc.ClassController.php @@ -30,7 +30,7 @@ class Controller { * @return object an object of a class implementing the view */ static function factory($class, $params=array()) { /* {{{ */ - global $settings, $session, $dms, $user, $EXT_CONF; + global $settings, $session, $EXT_CONF; if(!$class) { return null; } @@ -52,8 +52,6 @@ class Controller { require($filename); $controller = new $classname($params); /* Set some configuration parameters */ - $controller->setParam('dms', $dms); - $controller->setParam('user', $user); $controller->setParam('postVars', $_POST); $controller->setParam('getVars', $_GET); $controller->setParam('requestVars', $_REQUEST); diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index c0b6a4f0d..630958934 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -31,7 +31,7 @@ include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassController.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('adddocument')) { diff --git a/op/op.AddSubFolder.php b/op/op.AddSubFolder.php index 83a83de6f..d9576d97f 100644 --- a/op/op.AddSubFolder.php +++ b/op/op.AddSubFolder.php @@ -31,7 +31,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('addsubfolder')) { diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 7f9a6da89..0fa50486a 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -638,7 +638,7 @@ switch($command) { $indexconf = null; } - $controller = Controller::factory('AddDocument'); + $controller = Controller::factory('AddDocument', array('dms'=>$dms, 'user'=>$user)); $controller->setParam('documentsource', 'upload'); $controller->setParam('folder', $folder); $controller->setParam('index', $index); diff --git a/op/op.AttributeMgr.php b/op/op.AttributeMgr.php index d800722a5..9b15139f1 100644 --- a/op/op.AttributeMgr.php +++ b/op/op.AttributeMgr.php @@ -28,7 +28,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (!$user->isAdmin()) { UI::exitError(getMLText("admin_tools"),getMLText("access_denied")); } diff --git a/op/op.DocumentAccess.php b/op/op.DocumentAccess.php index fbc37f1e1..eddf47ef1 100644 --- a/op/op.DocumentAccess.php +++ b/op/op.DocumentAccess.php @@ -30,7 +30,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); diff --git a/op/op.Download.php b/op/op.Download.php index 0c1bf4db1..7b5b09a0f 100644 --- a/op/op.Download.php +++ b/op/op.Download.php @@ -31,7 +31,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (isset($_GET["version"])) { /* {{{ */ @@ -114,7 +114,8 @@ elseif (isset($_GET["file"])) { /* {{{ */ sendFile($dms->contentDir . $file->getPath()); -} elseif (isset($_GET["arkname"])) { +} /* }}} */ +elseif (isset($_GET["arkname"])) { /* {{{ */ $filename = basename($_GET["arkname"]); // backup download @@ -141,7 +142,8 @@ elseif (isset($_GET["file"])) { /* {{{ */ sendFile($settings->_contentDir .$filename ); -} elseif (isset($_GET["logname"])) { +} /* }}} */ +elseif (isset($_GET["logname"])) { /* {{{ */ $filename = basename($_GET["logname"]); // log download @@ -167,7 +169,8 @@ elseif (isset($_GET["file"])) { /* {{{ */ sendFile($settings->_contentDir .$filename ); -} elseif (isset($_GET["vfile"])) { +} /* }}} */ +elseif (isset($_GET["vfile"])) { /* {{{ */ // versioning info download @@ -191,7 +194,8 @@ elseif (isset($_GET["file"])) { /* {{{ */ sendFile($dms->contentDir . $document->getDir() .$settings->_versioningFileName); -} elseif (isset($_GET["dumpname"])) { +} /* }}} */ +elseif (isset($_GET["dumpname"])) { /* {{{ */ $filename = basename($_GET["dumpname"]); // dump file download @@ -251,7 +255,8 @@ elseif (isset($_GET["file"])) { /* {{{ */ sendFile($filename); -} elseif (isset($_GET["approvelogid"])) { +} /* }}} */ +elseif (isset($_GET["approvelogid"])) { /* {{{ */ if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } @@ -285,7 +290,7 @@ elseif (isset($_GET["file"])) { /* {{{ */ header("Cache-Control: must-revalidate"); sendFile($filename); -} +} /* }}} */ add_log_line(); exit(); diff --git a/op/op.EditDocument.php b/op/op.EditDocument.php index 505827e61..afc4471b7 100644 --- a/op/op.EditDocument.php +++ b/op/op.EditDocument.php @@ -30,7 +30,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); diff --git a/op/op.EditDocumentFile.php b/op/op.EditDocumentFile.php index 2f93436f6..780e51f76 100644 --- a/op/op.EditDocumentFile.php +++ b/op/op.EditDocumentFile.php @@ -31,7 +31,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('editdocumentfile')) { diff --git a/op/op.EditFolder.php b/op/op.EditFolder.php index c6ac9dee0..77242635c 100644 --- a/op/op.EditFolder.php +++ b/op/op.EditFolder.php @@ -30,7 +30,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) { UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id")); diff --git a/op/op.Login.php b/op/op.Login.php index 3b1967afe..b558e8af9 100644 --- a/op/op.Login.php +++ b/op/op.Login.php @@ -39,7 +39,7 @@ function _printMessage($heading, $message) { /* {{{ */ } /* }}} */ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (isset($_REQUEST["sesstheme"]) && strlen($_REQUEST["sesstheme"])>0 && is_numeric(array_search($_REQUEST["sesstheme"],UI::getStyles())) ) { $theme = $_REQUEST["sesstheme"]; diff --git a/op/op.Logout.php b/op/op.Logout.php index ce63730d7..e4075cf62 100644 --- a/op/op.Logout.php +++ b/op/op.Logout.php @@ -28,7 +28,7 @@ include("../inc/inc.DBInit.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); // Delete session from database if(isset($_COOKIE['mydms_session'])) { diff --git a/op/op.RemoveDocument.php b/op/op.RemoveDocument.php index be3f53b5e..df5359a73 100644 --- a/op/op.RemoveDocument.php +++ b/op/op.RemoveDocument.php @@ -29,7 +29,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('removedocument')) { diff --git a/op/op.RemoveFolder.php b/op/op.RemoveFolder.php index 34758e135..0ba444b8d 100644 --- a/op/op.RemoveFolder.php +++ b/op/op.RemoveFolder.php @@ -29,7 +29,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('removefolder')) { diff --git a/op/op.TransferDocument.php b/op/op.TransferDocument.php index 1491a45a5..0bc50493e 100644 --- a/op/op.TransferDocument.php +++ b/op/op.TransferDocument.php @@ -29,7 +29,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); if (!$user->isAdmin()) { UI::exitError(getMLText("document"),getMLText("access_denied")); diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index 8c6fb4c39..eeba7227d 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -29,7 +29,7 @@ include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassController.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); /* Check if the form data comes from a trusted request */ if(!checkFormKey('updatedocument')) { diff --git a/op/op.ViewOnline.php b/op/op.ViewOnline.php index 13b0c2c90..34ba3e108 100644 --- a/op/op.ViewOnline.php +++ b/op/op.ViewOnline.php @@ -29,7 +29,7 @@ include("../inc/inc.ClassController.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$controller = Controller::factory($tmp[1]); +$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user)); $documentid = $_GET["documentid"]; if (!isset($documentid) || !is_numeric($documentid) || intval($documentid)<1) { diff --git a/out/out.ExtensionMgr.php b/out/out.ExtensionMgr.php index da2e5c728..0f8ddb823 100644 --- a/out/out.ExtensionMgr.php +++ b/out/out.ExtensionMgr.php @@ -37,6 +37,8 @@ $v = new SeedDMS_Version; if($view) { $view->setParam('httproot', $settings->_httpRoot); $view->setParam('version', $v); + $view->setParam('partitionsize', 200000); + $view->setParam('maxuploadsize', 2000000); $view($_GET); exit; } diff --git a/utils/adddoc.php b/utils/adddoc.php index d26b891bb..3357fb3e1 100644 --- a/utils/adddoc.php +++ b/utils/adddoc.php @@ -282,7 +282,7 @@ if($settings->_enableFullSearch) { $indexconf = null; } -$controller = Controller::factory('AddDocument'); +$controller = Controller::factory('AddDocument', array('dms'=>$dms, 'user'=>$user)); $controller->setParam('documentsource', 'script'); $controller->setParam('folder', $folder); $controller->setParam('index', $index); diff --git a/webdav/webdav.php b/webdav/webdav.php index bf331f3d6..916bf9291 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -955,6 +955,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server } $controller = Controller::factory('AddDocument'); + $controller->setParam('dms', $this->dms); + $controller->setParam('user', $this->user); $controller->setParam('documentsource', 'webdav'); $controller->setParam('folder', $objdest); $controller->setParam('index', $index);