mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
add new methods setXXXValue which check if _POST data has value and it is not hidden
This commit is contained in:
parent
97414a0971
commit
7af5857df3
|
@ -56,175 +56,203 @@ else $action=NULL;
|
|||
// --------------------------------------------------------------------------
|
||||
if ($action == "saveSettings")
|
||||
{
|
||||
/**
|
||||
* First check if config var is actually set in POST request. Hidden conf
|
||||
* vars will not be included and may not override existing conf vars.
|
||||
*/
|
||||
function setStrValue($name) {
|
||||
global $_POST, $settings;
|
||||
if(isset($_POST[$name]) && !in_array($name, $settings->_hiddenConfFields))
|
||||
$settings->{"_".$name} = $_POST[$name];
|
||||
}
|
||||
function setBoolValue($name) {
|
||||
global $_POST, $settings;
|
||||
if(isset($_POST[$name]) && !in_array($name, $settings->_hiddenConfFields)) {
|
||||
if ($_POST[$name]=="on")
|
||||
$settings->{"_".$name} = true;
|
||||
else
|
||||
$settings->{"_".$name} = false;
|
||||
}
|
||||
}
|
||||
function setIntValue($name) {
|
||||
global $_POST, $settings;
|
||||
if(isset($_POST[$name]) && !in_array($name, $settings->_hiddenConfFields))
|
||||
$settings->{"_".$name} = intval($_POST[$name]);
|
||||
}
|
||||
function setDirValue($name) {
|
||||
global $_POST, $settings;
|
||||
if(isset($_POST[$name]) && !in_array($name, $settings->_hiddenConfFields))
|
||||
$settings->{"_".$name} = addDirSep($_POST[$name]);
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
// get values
|
||||
// -------------------------------------------------------------------------
|
||||
// SETTINGS - SITE - DISPLAY
|
||||
$settings->_siteName = $_POST["siteName"];
|
||||
$settings->_footNote = $_POST["footNote"];
|
||||
$settings->_printDisclaimer = getBoolValue("printDisclaimer");
|
||||
$settings->_language = $_POST["language"];
|
||||
$settings->_dateformat = $_POST["dateformat"];
|
||||
$settings->_datetimeformat = $_POST["datetimeformat"];
|
||||
setStrValue('siteName');
|
||||
setStrValue('footNote');
|
||||
setBoolValue('printDisclaimer');
|
||||
setStrValue('language');
|
||||
setStrValue('dateformat');
|
||||
setStrValue('datetimeformat');
|
||||
if(empty($_POST["availablelanguages"]))
|
||||
$settings->_availablelanguages = array();
|
||||
else
|
||||
$settings->_availablelanguages = $_POST["availablelanguages"];
|
||||
$settings->_theme = $_POST["theme"];
|
||||
$settings->_overrideTheme = getBoolValue("overrideTheme");
|
||||
$settings->_onePageMode = getBoolValue("onePageMode");
|
||||
$settings->_previewWidthList = $_POST["previewWidthList"];
|
||||
$settings->_previewWidthMenuList = $_POST["previewWidthMenuList"];
|
||||
$settings->_previewWidthDropFolderList = $_POST["previewWidthDropFolderList"];
|
||||
$settings->_previewWidthDetail = $_POST["previewWidthDetail"];
|
||||
$settings->_showFullPreview = getBoolValue("showFullPreview");
|
||||
$settings->_convertToPdf = getBoolValue("convertToPdf");
|
||||
$settings->_maxItemsPerPage = $_POST["maxItemsPerPage"];
|
||||
$settings->_incItemsPerPage = $_POST["incItemsPerPage"];
|
||||
setStrValue('theme');
|
||||
setBoolValue('overrideTheme');
|
||||
setBoolValue('onePageMode');
|
||||
setIntValue('previewWidthList');
|
||||
setIntValue('previewWidthMenuList');
|
||||
setIntValue('previewWidthDropFolderList');
|
||||
setIntValue('previewWidthDetail');
|
||||
setBoolValue('showFullPreview');
|
||||
setBoolValue('convertToPdf');
|
||||
setIntValue('maxItemsPerPage');
|
||||
setIntValue('incItemsPerPage');
|
||||
|
||||
// SETTINGS - SITE - EDITION
|
||||
$settings->_strictFormCheck = getBoolValue("strictFormCheck");
|
||||
$settings->_inlineEditing = getBoolValue("inlineEditing");
|
||||
setBoolValue('strictFormCheck');
|
||||
setBoolValue('inlineEditing');
|
||||
if(empty($_POST["noDocumentFormFields"]))
|
||||
$settings->_noDocumentFormFields = array();
|
||||
else
|
||||
$settings->_noDocumentFormFields = $_POST["noDocumentFormFields"];
|
||||
$settings->setViewOnlineFileTypesFromString($_POST["viewOnlineFileTypes"]);
|
||||
$settings->setEditOnlineFileTypesFromString($_POST["editOnlineFileTypes"]);
|
||||
$settings->_enableConverting = getBoolValue("enableConverting");
|
||||
$settings->_enableEmail =getBoolValue("enableEmail");
|
||||
$settings->_enableUsersView = getBoolValue("enableUsersView");
|
||||
$settings->_enableFullSearch = getBoolValue("enableFullSearch");
|
||||
$settings->_maxSizeForFullText = intval($_POST["maxSizeForFullText"]);
|
||||
$settings->_fullSearchEngine = $_POST["fullSearchEngine"];
|
||||
$settings->_defaultSearchMethod = $_POST["defaultSearchMethod"];
|
||||
$settings->_showSingleSearchHit = getBoolValue("showSingleSearchHit");
|
||||
$settings->_enableSessionList = getBoolValue("enableSessionList");
|
||||
$settings->_enableClipboard = getBoolValue("enableClipboard");
|
||||
$settings->_enableMenuTasks = getBoolValue("enableMenuTasks");
|
||||
$settings->_enableDropFolderList = getBoolValue("enableDropFolderList");
|
||||
$settings->_enableDropUpload = getBoolValue("enableDropUpload");
|
||||
$settings->_enableMultiUpload = getBoolValue("enableMultiUpload");
|
||||
$settings->_enableFolderTree = getBoolValue("enableFolderTree");
|
||||
$settings->_enableRecursiveCount = getBoolValue("enableRecursiveCount");
|
||||
$settings->_maxRecursiveCount = intval($_POST["maxRecursiveCount"]);
|
||||
$settings->_enableLanguageSelector = getBoolValue("enableLanguageSelector");
|
||||
$settings->_enableHelp = getBoolValue("enableHelp");
|
||||
$settings->_enableThemeSelector = getBoolValue("enableThemeSelector");
|
||||
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
|
||||
$settings->_stopWordsFile = $_POST["stopWordsFile"];
|
||||
$settings->_sortUsersInList = $_POST["sortUsersInList"];
|
||||
$settings->_sortFoldersDefault = $_POST["sortFoldersDefault"];
|
||||
$settings->_defaultDocPosition = $_POST["defaultDocPosition"];
|
||||
$settings->setViewOnlineFileTypesFromString($_POST["viewOnlineFileTypes"]);
|
||||
$settings->setEditOnlineFileTypesFromString($_POST["editOnlineFileTypes"]);
|
||||
setBoolValue('enableConverting');
|
||||
setBoolValue('enableEmail');
|
||||
setBoolValue('enableUsersView');
|
||||
setBoolValue('enableFullSearch');
|
||||
setIntValue('maxSizeForFullText');
|
||||
setStrValue('fullSearchEngine');
|
||||
setStrValue('defaultSearchMethod');
|
||||
setBoolValue("showSingleSearchHit");
|
||||
setBoolValue("enableSessionList");
|
||||
setBoolValue("enableClipboard");
|
||||
setBoolValue("enableMenuTasks");
|
||||
setBoolValue("enableDropFolderList");
|
||||
setBoolValue("enableDropUpload");
|
||||
setBoolValue("enableMultiUpload");
|
||||
setBoolValue("enableFolderTree");
|
||||
setBoolValue("enableRecursiveCount");
|
||||
setIntValue("maxRecursiveCount");
|
||||
setBoolValue("enableLanguageSelector");
|
||||
setBoolValue("enableHelp");
|
||||
setBoolValue("enableThemeSelector");
|
||||
setIntValue("expandFolderTree");
|
||||
setStrValue("stopWordsFile");
|
||||
setStrValue("sortUsersInList");
|
||||
setStrValue("sortFoldersDefault");
|
||||
setStrValue("defaultDocPosition");
|
||||
|
||||
// SETTINGS - SITE - WEBDAV
|
||||
$settings->_enableWebdavReplaceDoc = getBoolValue("enableWebdavReplaceDoc");
|
||||
setBoolValue("enableWebdavReplaceDoc");
|
||||
|
||||
// SETTINGS - SITE - CALENDAR
|
||||
$settings->_enableCalendar = getBoolValue("enableCalendar");
|
||||
$settings->_calendarDefaultView = $_POST["calendarDefaultView"];
|
||||
$settings->_firstDayOfWeek = intval($_POST["firstDayOfWeek"]);
|
||||
setBoolValue("enableCalendar");
|
||||
setStrValue("calendarDefaultView");
|
||||
setIntValue("firstDayOfWeek");
|
||||
|
||||
// SETTINGS - SYSTEM - SERVER
|
||||
$settings->_rootDir = addDirSep($_POST["rootDir"]);
|
||||
$settings->_httpRoot = $_POST["httpRoot"];
|
||||
$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"]);
|
||||
$settings->_backupDir = addDirSep($_POST["backupDir"]);
|
||||
$settings->_repositoryUrl = addDirSep($_POST["repositoryUrl"]);
|
||||
$settings->_proxyUrl = addDirSep($_POST["proxyUrl"]);
|
||||
$settings->_proxyUser = addDirSep($_POST["proxyUser"]);
|
||||
$settings->_proxyPassword = addDirSep($_POST["proxyPassword"]);
|
||||
$settings->_logFileEnable = getBoolValue("logFileEnable");
|
||||
$settings->_logFileRotation = $_POST["logFileRotation"];
|
||||
$settings->_enableLargeFileUpload = getBoolValue("enableLargeFileUpload");
|
||||
$settings->_partitionSize = $_POST["partitionSize"];
|
||||
$settings->_maxUploadSize = $_POST["maxUploadSize"];
|
||||
$settings->_enableXsendfile = getBoolValue("enableXsendfile");
|
||||
setDirValue("rootDir");
|
||||
setStrValue("httpRoot");
|
||||
setDirValue("contentDir");
|
||||
setDirValue("cacheDir");
|
||||
setDirValue("stagingDir");
|
||||
setDirValue("luceneDir");
|
||||
setDirValue("extraPath");
|
||||
setDirValue("dropFolderDir");
|
||||
setDirValue("backupDir");
|
||||
setDirValue("repositoryUrl");
|
||||
setDirValue("proxyUrl");
|
||||
setDirValue("proxyUser");
|
||||
setDirValue("proxyPassword");
|
||||
setBoolValue("logFileEnable");
|
||||
setStrValue("logFileRotation");
|
||||
setBoolValue("enableLargeFileUpload");
|
||||
setStrValue("partitionSize"); // TODO: check if valid value, e.g. 1M or 5K
|
||||
setStrValue("maxUploadSize"); // TODO: check if valid value, e.g. 1M or 5K
|
||||
setBoolValue("enableXsendfile");
|
||||
|
||||
// SETTINGS - SYSTEM - AUTHENTICATION
|
||||
$settings->_enableGuestLogin = getBoolValue("enableGuestLogin");
|
||||
$settings->_enableGuestAutoLogin = getBoolValue("enableGuestAutoLogin");
|
||||
$settings->_restricted = getBoolValue("restricted");
|
||||
$settings->_enableUserImage = getBoolValue("enableUserImage");
|
||||
$settings->_disableSelfEdit = getBoolValue("disableSelfEdit");
|
||||
$settings->_enablePasswordForgotten = getBoolValue("enablePasswordForgotten");
|
||||
$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"]);
|
||||
$settings->_autoLoginUser = intval($_POST["autoLoginUser"]);
|
||||
$settings->_quota = intval($_POST["quota"]);
|
||||
$settings->_undelUserIds = !empty($_POST["undelUserIds"]) ? (is_array($_POST["undelUserIds"]) ? implode(',', $_POST["undelUserIds"]) : strval($_POST["undelUserIds"])) : '';
|
||||
$settings->_encryptionKey = strval($_POST["encryptionKey"]);
|
||||
$settings->_cookieLifetime = intval($_POST["cookieLifetime"]);
|
||||
$settings->_defaultAccessDocs = intval($_POST["defaultAccessDocs"]);
|
||||
setBoolValue("enableGuestLogin");
|
||||
setBoolValue("enableGuestAutoLogin");
|
||||
setBoolValue("restricted");
|
||||
setBoolValue("enableUserImage");
|
||||
setBoolValue("disableSelfEdit");
|
||||
setBoolValue("enablePasswordForgotten");
|
||||
setIntValue("passwordStrength");
|
||||
setStrValue("passwordStrengthAlgorithm");
|
||||
setIntValue("passwordExpiration");
|
||||
setIntValue("passwordHistory");
|
||||
setIntValue("loginFailure");
|
||||
setIntValue("autoLoginUser");
|
||||
setIntValue("quota");
|
||||
$settings->_undelUserIds = !empty($_POST["undelUserIds"]) ? (is_array($_POST["undelUserIds"]) ? implode(',', $_POST["undelUserIds"]) : strval($_POST["undelUserIds"])) : '';
|
||||
setStrValue("encryptionKey");
|
||||
setIntValue("cookieLifetime");
|
||||
setIntValue("defaultAccessDocs");
|
||||
|
||||
// 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 - DATABASE
|
||||
setStrValue('dbDriver');
|
||||
setStrValue('dbHostname');
|
||||
setStrValue('dbDatabase');
|
||||
setStrValue('dbUser');
|
||||
setStrValue('dbPass');
|
||||
|
||||
// SETTINGS - SYSTEM - SMTP
|
||||
$settings->_smtpServer = $_POST["smtpServer"];
|
||||
$settings->_smtpPort = $_POST["smtpPort"];
|
||||
$settings->_smtpSendFrom = $_POST["smtpSendFrom"];
|
||||
$settings->_smtpUser = $_POST["smtpUser"];
|
||||
$settings->_smtpPassword = $_POST["smtpPassword"];
|
||||
setStrValue("smtpServer");
|
||||
setIntValue("smtpPort");
|
||||
setStrValue("smtpSendFrom");
|
||||
setStrValue("smtpUser");
|
||||
setStrValue("smtpPassword");
|
||||
|
||||
// SETTINGS -ADVANCED - DISPLAY
|
||||
$settings->_siteDefaultPage = $_POST["siteDefaultPage"];
|
||||
$settings->_rootFolderID = intval($_POST["rootFolderID"]);
|
||||
$settings->_useHomeAsRootFolder = getBoolValue("useHomeAsRootFolder");
|
||||
$settings->_titleDisplayHack = getBoolValue("titleDisplayHack");
|
||||
$settings->_showMissingTranslations = getBoolValue("showMissingTranslations");
|
||||
setStrValue("siteDefaultPage");
|
||||
setIntValue("rootFolderID");
|
||||
setBoolValue("useHomeAsRootFolder");
|
||||
setBoolValue("titleDisplayHack");
|
||||
setBoolValue("showMissingTranslations");
|
||||
|
||||
// SETTINGS - ADVANCED - AUTHENTICATION
|
||||
$settings->_guestID = intval($_POST["guestID"]);
|
||||
$settings->_adminIP = $_POST["adminIP"];
|
||||
$settings->_apiKey = strval($_POST["apiKey"]);
|
||||
$settings->_apiUserId = intval($_POST["apiUserId"]);
|
||||
$settings->_apiOrigin = strval($_POST["apiOrigin"]);
|
||||
setIntValue("guestID");
|
||||
setStrValue("adminIP");
|
||||
setStrValue("apiKey");
|
||||
setIntValue("apiUserId");
|
||||
setStrValue("apiOrigin");
|
||||
|
||||
// SETTINGS - ADVANCED - EDITION
|
||||
$settings->_versioningFileName = $_POST["versioningFileName"];
|
||||
$settings->_presetExpirationDate = $_POST["presetExpirationDate"];
|
||||
$settings->_workflowMode = $_POST["workflowMode"];
|
||||
$settings->_allowReviewerOnly = getBoolValue("allowReviewerOnly");
|
||||
$settings->_enableAdminRevApp = getBoolValue("enableAdminRevApp");
|
||||
$settings->_enableOwnerRevApp = getBoolValue("enableOwnerRevApp");
|
||||
$settings->_enableSelfRevApp = getBoolValue("enableSelfRevApp");
|
||||
$settings->_enableUpdateRevApp = getBoolValue("enableUpdateRevApp");
|
||||
$settings->_enableVersionDeletion = getBoolValue("enableVersionDeletion");
|
||||
$settings->_enableVersionModification = getBoolValue("enableVersionModification");
|
||||
$settings->_enableDuplicateDocNames = getBoolValue("enableDuplicateDocNames");
|
||||
$settings->_enableDuplicateSubFolderNames = getBoolValue("enableDuplicateSubFolderNames");
|
||||
$settings->_overrideMimeType = getBoolValue("overrideMimeType");
|
||||
$settings->_removeFromDropFolder = getBoolValue("removeFromDropFolder");
|
||||
setStrValue("versioningFileName");
|
||||
setStrValue("presetExpirationDate");
|
||||
setStrValue("workflowMode");
|
||||
setBoolValue("allowReviewerOnly");
|
||||
setBoolValue("enableAdminRevApp");
|
||||
setBoolValue("enableOwnerRevApp");
|
||||
setBoolValue("enableSelfRevApp");
|
||||
setBoolValue("enableUpdateRevApp");
|
||||
setBoolValue("enableVersionDeletion");
|
||||
setBoolValue("enableVersionModification");
|
||||
setBoolValue("enableDuplicateDocNames");
|
||||
setBoolValue("enableDuplicateSubFolderNames");
|
||||
setBoolValue("overrideMimeType");
|
||||
setBoolValue("removeFromDropFolder");
|
||||
|
||||
// SETTINGS - ADVANCED - NOTIFICATION
|
||||
$settings->_enableOwnerNotification = getBoolValue("enableOwnerNotification");
|
||||
$settings->_enableNotificationAppRev = getBoolValue("enableNotificationAppRev");
|
||||
$settings->_enableNotificationWorkflow = getBoolValue("enableNotificationWorkflow");
|
||||
setBoolValue("enableOwnerNotification");
|
||||
setBoolValue("enableNotificationAppRev");
|
||||
setBoolValue("enableNotificationWorkflow");
|
||||
|
||||
// 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"]);
|
||||
setStrValue("coreDir");
|
||||
setStrValue("luceneClassDir");
|
||||
setIntValue("contentOffsetDir");
|
||||
setIntValue("maxDirID");
|
||||
setIntValue("updateNotifyTime");
|
||||
setIntValue("maxExecutionTime");
|
||||
$settings->_cmdTimeout = (intval($_POST["cmdTimeout"]) > 0) ?intval($_POST["cmdTimeout"]) : 1;
|
||||
$settings->_enableDebugMode = getBoolValue("enableDebugMode");
|
||||
setBoolValue("enableDebugMode");
|
||||
|
||||
// SETTINGS - ADVANCED - INDEX CMD
|
||||
if(isset($_POST["converters"]["fulltext"]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user