2012-02-14 12:53:02 +00:00
|
|
|
<?php
|
|
|
|
// MyDMS. Document Management System
|
|
|
|
// Copyright (C) 2002-2005 Markus Westphal
|
|
|
|
// Copyright (C) 2006-2008 Malcolm Cowe
|
|
|
|
// Copyright (C) 2010 Matteo Lucarelli
|
2016-08-09 05:34:30 +00:00
|
|
|
// Copyright (C) 2010-2016 Uwe Steinmann
|
2012-02-14 12:53:02 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
include("../inc/inc.Settings.php");
|
|
|
|
include("../inc/inc.LogInit.php");
|
|
|
|
include("../inc/inc.Utils.php");
|
|
|
|
include("../inc/inc.Language.php");
|
2014-12-08 13:47:32 +00:00
|
|
|
include("../inc/inc.Init.php");
|
|
|
|
include("../inc/inc.Extension.php");
|
|
|
|
include("../inc/inc.DBInit.php");
|
2012-02-14 12:53:02 +00:00
|
|
|
include("../inc/inc.ClassUI.php");
|
|
|
|
include("../inc/inc.Authentication.php");
|
|
|
|
|
|
|
|
|
|
|
|
function getBoolValue($post_name)
|
|
|
|
{
|
|
|
|
$out = false;
|
|
|
|
if (isset($_POST[$post_name]))
|
|
|
|
if ($_POST[$post_name]=="on")
|
|
|
|
$out = true;
|
|
|
|
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$user->isAdmin()) {
|
|
|
|
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
2011-03-14 16:38:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_POST["action"])) $action=$_POST["action"];
|
|
|
|
else if (isset($_GET["action"])) $action=$_GET["action"];
|
2012-02-14 12:53:02 +00:00
|
|
|
else $action=NULL;
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
if ($action == "saveSettings")
|
|
|
|
{
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// get values
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// SETTINGS - SITE - DISPLAY
|
|
|
|
$settings->_siteName = $_POST["siteName"];
|
|
|
|
$settings->_footNote = $_POST["footNote"];
|
|
|
|
$settings->_printDisclaimer = getBoolValue("printDisclaimer");
|
2016-12-12 17:14:54 +00:00
|
|
|
$settings->_language = $_POST["language"];
|
|
|
|
if(empty($_POST["availablelanguages"]))
|
|
|
|
$settings->_availablelanguages = array();
|
|
|
|
else
|
|
|
|
$settings->_availablelanguages = $_POST["availablelanguages"];
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_theme = $_POST["theme"];
|
2019-10-28 11:06:41 +00:00
|
|
|
$settings->_onePageMode = $_POST["onePageMode"];
|
2014-03-18 09:03:39 +00:00
|
|
|
$settings->_previewWidthList = $_POST["previewWidthList"];
|
2017-09-20 07:20:56 +00:00
|
|
|
$settings->_previewWidthMenuList = $_POST["previewWidthMenuList"];
|
|
|
|
$settings->_previewWidthDropFolderList = $_POST["previewWidthDropFolderList"];
|
2014-03-18 09:03:39 +00:00
|
|
|
$settings->_previewWidthDetail = $_POST["previewWidthDetail"];
|
2016-11-07 08:25:06 +00:00
|
|
|
$settings->_showFullPreview = getBoolValue("showFullPreview");
|
|
|
|
$settings->_convertToPdf = getBoolValue("convertToPdf");
|
2017-12-14 08:39:05 +00:00
|
|
|
$settings->_maxItemsPerPage = $_POST["maxItemsPerPage"];
|
|
|
|
$settings->_incItemsPerPage = $_POST["incItemsPerPage"];
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// SETTINGS - SITE - EDITION
|
|
|
|
$settings->_strictFormCheck = getBoolValue("strictFormCheck");
|
2019-12-19 08:03:59 +00:00
|
|
|
if(empty($_POST["noDocumentFormFields"]))
|
|
|
|
$settings->_noDocumentFormFields = array();
|
|
|
|
else
|
|
|
|
$settings->_noDocumentFormFields = $_POST["noDocumentFormFields"];
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->setViewOnlineFileTypesFromString($_POST["viewOnlineFileTypes"]);
|
2016-03-09 06:45:37 +00:00
|
|
|
$settings->setEditOnlineFileTypesFromString($_POST["editOnlineFileTypes"]);
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_enableConverting = getBoolValue("enableConverting");
|
|
|
|
$settings->_enableEmail =getBoolValue("enableEmail");
|
|
|
|
$settings->_enableUsersView = getBoolValue("enableUsersView");
|
|
|
|
$settings->_enableFullSearch = getBoolValue("enableFullSearch");
|
2016-08-02 15:08:54 +00:00
|
|
|
$settings->_maxSizeForFullText = intval($_POST["maxSizeForFullText"]);
|
|
|
|
$settings->_fullSearchEngine = $_POST["fullSearchEngine"];
|
|
|
|
$settings->_defaultSearchMethod = $_POST["defaultSearchMethod"];
|
2016-10-26 17:28:10 +00:00
|
|
|
$settings->_showSingleSearchHit = getBoolValue("showSingleSearchHit");
|
2017-04-11 06:33:33 +00:00
|
|
|
$settings->_enableSessionList = getBoolValue("enableSessionList");
|
2014-07-11 06:41:25 +00:00
|
|
|
$settings->_enableClipboard = getBoolValue("enableClipboard");
|
2017-05-12 16:09:53 +00:00
|
|
|
$settings->_enableMenuTasks = getBoolValue("enableMenuTasks");
|
2017-07-31 18:30:59 +00:00
|
|
|
$settings->_enableDropFolderList = getBoolValue("enableDropFolderList");
|
2014-07-11 06:41:25 +00:00
|
|
|
$settings->_enableDropUpload = getBoolValue("enableDropUpload");
|
2017-04-27 04:50:12 +00:00
|
|
|
$settings->_enableMultiUpload = getBoolValue("enableMultiUpload");
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_enableFolderTree = getBoolValue("enableFolderTree");
|
2013-04-10 13:48:40 +00:00
|
|
|
$settings->_enableRecursiveCount = getBoolValue("enableRecursiveCount");
|
|
|
|
$settings->_maxRecursiveCount = intval($_POST["maxRecursiveCount"]);
|
2013-01-28 10:40:04 +00:00
|
|
|
$settings->_enableLanguageSelector = getBoolValue("enableLanguageSelector");
|
2016-02-01 18:57:08 +00:00
|
|
|
$settings->_enableHelp = getBoolValue("enableHelp");
|
2014-02-01 15:06:12 +00:00
|
|
|
$settings->_enableThemeSelector = getBoolValue("enableThemeSelector");
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
|
2016-08-02 15:08:54 +00:00
|
|
|
$settings->_stopWordsFile = $_POST["stopWordsFile"];
|
|
|
|
$settings->_sortUsersInList = $_POST["sortUsersInList"];
|
|
|
|
$settings->_sortFoldersDefault = $_POST["sortFoldersDefault"];
|
2018-02-07 07:43:46 +00:00
|
|
|
$settings->_defaultDocPosition = $_POST["defaultDocPosition"];
|
2012-02-14 12:53:02 +00:00
|
|
|
|
2018-04-12 04:41:51 +00:00
|
|
|
// SETTINGS - SITE - WEBDAV
|
|
|
|
$settings->_enableWebdavReplaceDoc = getBoolValue("enableWebdavReplaceDoc");
|
|
|
|
|
2012-02-14 12:53:02 +00:00
|
|
|
// SETTINGS - SITE - CALENDAR
|
|
|
|
$settings->_enableCalendar = getBoolValue("enableCalendar");
|
|
|
|
$settings->_calendarDefaultView = $_POST["calendarDefaultView"];
|
|
|
|
$settings->_firstDayOfWeek = intval($_POST["firstDayOfWeek"]);
|
|
|
|
|
|
|
|
// SETTINGS - SYSTEM - SERVER
|
2017-11-21 07:34:38 +00:00
|
|
|
$settings->_rootDir = addDirSep($_POST["rootDir"]);
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_httpRoot = $_POST["httpRoot"];
|
2017-11-21 07:34:38 +00:00
|
|
|
$settings->_contentDir = addDirSep($_POST["contentDir"]);
|
|
|
|
$settings->_cacheDir = addDirSep($_POST["cacheDir"]);
|
|
|
|
$settings->_stagingDir = addDirSep($_POST["stagingDir"]);
|
|
|
|
$settings->_luceneDir = addDirSep($_POST["luceneDir"]);
|
|
|
|
$settings->_extraPath = addDirSep($_POST["extraPath"]);
|
|
|
|
$settings->_dropFolderDir = addDirSep($_POST["dropFolderDir"]);
|
2017-11-21 10:51:45 +00:00
|
|
|
$settings->_backupDir = addDirSep($_POST["backupDir"]);
|
2018-03-14 17:43:01 +00:00
|
|
|
$settings->_repositoryUrl = addDirSep($_POST["repositoryUrl"]);
|
2020-02-21 09:01:09 +00:00
|
|
|
$settings->_proxyUrl = addDirSep($_POST["proxyUrl"]);
|
|
|
|
$settings->_proxyUser = addDirSep($_POST["proxyUser"]);
|
|
|
|
$settings->_proxyPassword = addDirSep($_POST["proxyPassword"]);
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_logFileEnable = getBoolValue("logFileEnable");
|
|
|
|
$settings->_logFileRotation = $_POST["logFileRotation"];
|
|
|
|
$settings->_enableLargeFileUpload = getBoolValue("enableLargeFileUpload");
|
|
|
|
$settings->_partitionSize = $_POST["partitionSize"];
|
2017-03-15 15:39:05 +00:00
|
|
|
$settings->_maxUploadSize = $_POST["maxUploadSize"];
|
2019-01-18 12:07:39 +00:00
|
|
|
$settings->_enableXsendfile = getBoolValue("enableXsendfile");
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// SETTINGS - SYSTEM - AUTHENTICATION
|
|
|
|
$settings->_enableGuestLogin = getBoolValue("enableGuestLogin");
|
2016-01-29 15:48:21 +00:00
|
|
|
$settings->_enableGuestAutoLogin = getBoolValue("enableGuestAutoLogin");
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_restricted = getBoolValue("restricted");
|
|
|
|
$settings->_enableUserImage = getBoolValue("enableUserImage");
|
|
|
|
$settings->_disableSelfEdit = getBoolValue("disableSelfEdit");
|
|
|
|
$settings->_enablePasswordForgotten = getBoolValue("enablePasswordForgotten");
|
2012-08-28 06:34:21 +00:00
|
|
|
$settings->_passwordStrength = intval($_POST["passwordStrength"]);
|
|
|
|
$settings->_passwordStrengthAlgorithm = strval($_POST["passwordStrengthAlgorithm"]);
|
|
|
|
$settings->_passwordExpiration = intval($_POST["passwordExpiration"]);
|
|
|
|
$settings->_passwordHistory = intval($_POST["passwordHistory"]);
|
|
|
|
$settings->_loginFailure = intval($_POST["loginFailure"]);
|
2015-07-14 19:23:33 +00:00
|
|
|
$settings->_autoLoginUser = intval($_POST["autoLoginUser"]);
|
2012-12-19 10:05:34 +00:00
|
|
|
$settings->_quota = intval($_POST["quota"]);
|
2013-05-31 09:59:12 +00:00
|
|
|
$settings->_undelUserIds = strval($_POST["undelUserIds"]);
|
2012-08-29 20:37:22 +00:00
|
|
|
$settings->_encryptionKey = strval($_POST["encryptionKey"]);
|
2013-01-24 10:13:57 +00:00
|
|
|
$settings->_cookieLifetime = intval($_POST["cookieLifetime"]);
|
2017-01-18 19:58:03 +00:00
|
|
|
$settings->_defaultAccessDocs = intval($_POST["defaultAccessDocs"]);
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// TODO Connectors
|
|
|
|
|
|
|
|
// SETTINGS - SYSTEM - DATABASE
|
|
|
|
$settings->_dbDriver = $_POST["dbDriver"];
|
|
|
|
$settings->_dbHostname = $_POST["dbHostname"];
|
|
|
|
$settings->_dbDatabase = $_POST["dbDatabase"];
|
|
|
|
$settings->_dbUser = $_POST["dbUser"];
|
|
|
|
$settings->_dbPass = $_POST["dbPass"];
|
|
|
|
|
|
|
|
// SETTINGS - SYSTEM - SMTP
|
|
|
|
$settings->_smtpServer = $_POST["smtpServer"];
|
|
|
|
$settings->_smtpPort = $_POST["smtpPort"];
|
|
|
|
$settings->_smtpSendFrom = $_POST["smtpSendFrom"];
|
2013-09-13 12:54:37 +00:00
|
|
|
$settings->_smtpUser = $_POST["smtpUser"];
|
|
|
|
$settings->_smtpPassword = $_POST["smtpPassword"];
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// SETTINGS -ADVANCED - DISPLAY
|
|
|
|
$settings->_siteDefaultPage = $_POST["siteDefaultPage"];
|
|
|
|
$settings->_rootFolderID = intval($_POST["rootFolderID"]);
|
|
|
|
$settings->_titleDisplayHack = getBoolValue("titleDisplayHack");
|
2014-04-08 08:40:20 +00:00
|
|
|
$settings->_showMissingTranslations = getBoolValue("showMissingTranslations");
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// SETTINGS - ADVANCED - AUTHENTICATION
|
|
|
|
$settings->_guestID = intval($_POST["guestID"]);
|
|
|
|
$settings->_adminIP = $_POST["adminIP"];
|
|
|
|
|
|
|
|
// SETTINGS - ADVANCED - EDITION
|
|
|
|
$settings->_versioningFileName = $_POST["versioningFileName"];
|
2015-01-29 16:28:40 +00:00
|
|
|
$settings->_presetExpirationDate = $_POST["presetExpirationDate"];
|
2013-01-24 10:13:57 +00:00
|
|
|
$settings->_workflowMode = $_POST["workflowMode"];
|
2018-02-26 07:07:51 +00:00
|
|
|
$settings->_allowReviewerOnly = getBoolValue("allowReviewerOnly");
|
2012-02-14 12:53:02 +00:00
|
|
|
$settings->_enableAdminRevApp = getBoolValue("enableAdminRevApp");
|
2013-02-27 08:09:00 +00:00
|
|
|
$settings->_enableOwnerRevApp = getBoolValue("enableOwnerRevApp");
|
|
|
|
$settings->_enableSelfRevApp = getBoolValue("enableSelfRevApp");
|
2017-01-16 12:00:22 +00:00
|
|
|
$settings->_enableUpdateRevApp = getBoolValue("enableUpdateRevApp");
|
2012-10-05 19:48:42 +00:00
|
|
|
$settings->_enableVersionDeletion = getBoolValue("enableVersionDeletion");
|
|
|
|
$settings->_enableVersionModification = getBoolValue("enableVersionModification");
|
2013-01-28 10:40:04 +00:00
|
|
|
$settings->_enableDuplicateDocNames = getBoolValue("enableDuplicateDocNames");
|
2019-07-01 08:50:40 +00:00
|
|
|
$settings->_enableDuplicateSubFolderNames = getBoolValue("enableDuplicateSubFolderNames");
|
2015-06-23 05:44:47 +00:00
|
|
|
$settings->_overrideMimeType = getBoolValue("overrideMimeType");
|
2016-05-23 11:15:50 +00:00
|
|
|
$settings->_removeFromDropFolder = getBoolValue("removeFromDropFolder");
|
2012-10-05 19:48:42 +00:00
|
|
|
|
|
|
|
// SETTINGS - ADVANCED - NOTIFICATION
|
|
|
|
$settings->_enableOwnerNotification = getBoolValue("enableOwnerNotification");
|
|
|
|
$settings->_enableNotificationAppRev = getBoolValue("enableNotificationAppRev");
|
2015-03-11 17:11:41 +00:00
|
|
|
$settings->_enableNotificationWorkflow = getBoolValue("enableNotificationWorkflow");
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
// SETTINGS - ADVANCED - SERVER
|
|
|
|
$settings->_coreDir = $_POST["coreDir"];
|
|
|
|
$settings->_luceneClassDir = $_POST["luceneClassDir"];
|
|
|
|
$settings->_contentOffsetDir = intval($_POST["contentOffsetDir"]);
|
|
|
|
$settings->_maxDirID = intval($_POST["maxDirID"]);
|
|
|
|
$settings->_updateNotifyTime = intval($_POST["updateNotifyTime"]);
|
|
|
|
$settings->_maxExecutionTime = intval($_POST["maxExecutionTime"]);
|
2015-08-05 19:11:21 +00:00
|
|
|
$settings->_cmdTimeout = (intval($_POST["cmdTimeout"]) > 0) ?intval($_POST["cmdTimeout"]) : 1;
|
2012-02-14 12:53:02 +00:00
|
|
|
|
2017-11-21 16:34:24 +00:00
|
|
|
// SETTINGS - ADVANCED - INDEX CMD
|
|
|
|
if(isset($_POST["converters"]["fulltext"]))
|
|
|
|
$settings->_converters['fulltext'] = $_POST["converters"]["fulltext"];
|
|
|
|
else
|
|
|
|
$settings->_converters['fulltext'] = $_POST["converters"];
|
|
|
|
$newmimetype = preg_replace('#[^A-Za-z0-9_/+.*-]+#', '', $settings->_converters["fulltext"]["newmimetype"]);
|
|
|
|
if($newmimetype && trim($settings->_converters['fulltext']['newcmd']))
|
|
|
|
$settings->_converters['fulltext'][$newmimetype] = trim($settings->_converters['fulltext']['newcmd']);
|
|
|
|
unset($settings->_converters['fulltext']['newmimetype']);
|
|
|
|
unset($settings->_converters['fulltext']['newcmd']);
|
|
|
|
|
2017-11-21 17:12:58 +00:00
|
|
|
foreach(array('preview', 'pdf') as $target) {
|
|
|
|
if(isset($_POST["converters"][$target])) {
|
|
|
|
$settings->_converters[$target] = $_POST["converters"][$target];
|
|
|
|
$newmimetype = preg_replace('#[^A-Za-z0-9_/+.*-]+#', '', $settings->_converters[$target]["newmimetype"]);
|
|
|
|
if($newmimetype && trim($settings->_converters[$target]['newcmd']))
|
|
|
|
$settings->_converters[$target][$newmimetype] = trim($settings->_converters[$target]['newcmd']);
|
|
|
|
unset($settings->_converters[$target]['newmimetype']);
|
|
|
|
unset($settings->_converters[$target]['newcmd']);
|
|
|
|
}
|
|
|
|
}
|
2012-02-14 12:53:02 +00:00
|
|
|
|
2013-05-02 20:31:23 +00:00
|
|
|
// SETTINGS - EXTENSIONS
|
2015-11-24 17:13:15 +00:00
|
|
|
$settings->_extensions = isset($_POST["extensions"]) ? $_POST["extensions"] : array();
|
2013-05-02 20:31:23 +00:00
|
|
|
|
2012-02-14 12:53:02 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// save
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
if (!$settings->save())
|
|
|
|
UI::exitError(getMLText("admin_tools"),getMLText("settings_SaveError"));
|
|
|
|
|
|
|
|
add_log_line(".php&action=savesettings");
|
|
|
|
}
|
|
|
|
|
2013-05-23 14:11:17 +00:00
|
|
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_settings_saved')));
|
|
|
|
|
2011-03-14 16:38:40 +00:00
|
|
|
|
2015-03-11 17:24:14 +00:00
|
|
|
header("Location:../out/out.Settings.php?currenttab=".$_POST['currenttab']);
|
2012-02-14 12:53:02 +00:00
|
|
|
|
|
|
|
?>
|