2011-07-21 06:53:35 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Reading and writing the configuration from and to an xml file
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2011-07-21 06:53:35 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2011 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class for reading and writing the configuration file
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2011-07-21 06:53:35 +00:00
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2011 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
class Settings { /* {{{ */
|
|
|
|
// Config File Path
|
|
|
|
var $_configFilePath = null;
|
2021-08-04 12:19:11 +00:00
|
|
|
var $_configFileDir = '';
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2021-06-23 14:27:09 +00:00
|
|
|
// Fields not shown in gui
|
|
|
|
var $_hiddenConfFields = '';
|
2011-07-21 06:53:35 +00:00
|
|
|
// Name of site
|
2013-02-14 11:10:53 +00:00
|
|
|
var $_siteName = "SeedDMS";
|
2011-07-21 06:53:35 +00:00
|
|
|
// Message to display at the bottom of every page.
|
2013-02-14 11:10:53 +00:00
|
|
|
var $_footNote = "SeedDMS free document management \"system - www.seeddms.org";
|
2011-07-21 06:53:35 +00:00
|
|
|
// if true the disclaimer message the lang.inc files will be print on the bottom of the page
|
|
|
|
var $_printDisclaimer = true;
|
|
|
|
// Default page on login
|
|
|
|
var $_siteDefaultPage = "";
|
|
|
|
// ID of guest-user used when logged in as guest
|
|
|
|
var $_guestID = 2;
|
|
|
|
// ID of root-folder
|
|
|
|
var $_rootFolderID = 1;
|
2020-12-18 07:06:01 +00:00
|
|
|
// use home folder as root-folder
|
|
|
|
var $_useHomeAsRootFolder = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// If you want anybody to login as guest, set the following line to true
|
|
|
|
var $_enableGuestLogin = false;
|
2016-01-29 15:48:21 +00:00
|
|
|
// If you even want guest to be logged in automatically, set the following to true
|
|
|
|
var $_enableGuestAutoLogin = false;
|
2016-07-06 20:25:43 +00:00
|
|
|
// Set to true for 2-factor Authentication
|
|
|
|
var $_enable2FactorAuthentication = false;
|
2011-10-10 08:39:31 +00:00
|
|
|
// Allow users to reset their password
|
|
|
|
var $_enablePasswordForgotten = false;
|
2012-08-28 06:34:21 +00:00
|
|
|
// Minimum password strength (0 - x, 0 means no check)
|
|
|
|
var $_passwordStrength = 0;
|
|
|
|
// Password strength algorithm (simple, advanced)
|
|
|
|
var $_passwordStrengthAlgorithm = 'advanced';
|
|
|
|
// Number of days when a password expires and must be reset
|
|
|
|
var $_passwordExpiration = 10;
|
|
|
|
// Number of different passwords before a password can be reused
|
|
|
|
var $_passwordHistory = 10;
|
|
|
|
// Number of failed logins before account is disabled
|
|
|
|
var $_loginFailure = 0;
|
2015-07-14 19:23:33 +00:00
|
|
|
// User id that is automatically logged if nobody is logged in
|
|
|
|
var $_autoLoginUser = 0;
|
2012-12-19 10:05:34 +00:00
|
|
|
// maximum amount of bytes a user may consume, 0 = unlimited
|
|
|
|
var $_quota = 0;
|
2013-05-31 09:59:12 +00:00
|
|
|
// comma separated list of undeleteable user ids
|
2021-06-26 09:57:02 +00:00
|
|
|
var $_undelUserIds = array();
|
2011-07-21 06:53:35 +00:00
|
|
|
// Restricted access: only allow users to log in if they have an entry in
|
|
|
|
// the local database (irrespective of successful authentication with LDAP).
|
|
|
|
var $_restricted = true;
|
2012-08-29 20:42:13 +00:00
|
|
|
// abitray string used for creation of unique identifiers (e.g. the form
|
|
|
|
// key created by createFormKey())
|
|
|
|
var $_encryptionKey = '';
|
2013-01-24 08:33:51 +00:00
|
|
|
// lifetime of cookie in seconds or 0 for end of session
|
|
|
|
var $_cookieLifetime = '';
|
2017-01-18 19:58:03 +00:00
|
|
|
// default access mode for documents
|
|
|
|
var $_defaultAccessDocs = '';
|
2020-06-17 09:19:02 +00:00
|
|
|
// api key for restapi
|
|
|
|
var $_apiKey = '';
|
|
|
|
// api user id for restapi
|
|
|
|
var $_apiUserId = 0;
|
|
|
|
// api allowed origins for restapi
|
|
|
|
var $_apiOrigin = '';
|
2020-09-07 14:20:37 +00:00
|
|
|
// allow inline editing of document/folder names
|
|
|
|
var $_inlineEditing = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// Strict form checking
|
|
|
|
var $_strictFormCheck = false;
|
2019-12-19 08:03:59 +00:00
|
|
|
// list of form fields which are visible by default but can be explixitly
|
|
|
|
// turn off (comment, keywords, categories, sequence, expiration, owner
|
|
|
|
var $_noDocumentFormFields = array();
|
2021-09-22 07:53:53 +00:00
|
|
|
// list of form fields which are visible by default but can be explixitly
|
|
|
|
// turn off (comment, keywords, categories, sequence, expiration, owner
|
|
|
|
var $_noFolderFormFields = array();
|
2013-02-14 11:10:53 +00:00
|
|
|
// Path to where SeedDMS is located
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_rootDir = null;
|
2013-02-14 11:10:53 +00:00
|
|
|
// Path to SeedDMS_Core
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_coreDir = null;
|
2013-02-14 11:10:53 +00:00
|
|
|
// Path to SeedDMS_Lucene
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_luceneClassDir = null;
|
|
|
|
// The relative path in the URL, after the domain part.
|
2013-02-14 11:10:53 +00:00
|
|
|
var $_httpRoot = "/seeddms/";
|
2011-07-21 06:53:35 +00:00
|
|
|
// Where the uploaded files are stored (best to choose a directory that
|
|
|
|
// is not accessible through your web-server)
|
|
|
|
var $_contentDir = null;
|
2012-12-14 07:48:20 +00:00
|
|
|
// Where the preview files are saved
|
|
|
|
var $_cacheDir = null;
|
2011-07-21 06:53:35 +00:00
|
|
|
// Where the partitions of an uploaded file by the jumploader is saved
|
|
|
|
var $_stagingDir = null;
|
|
|
|
// Where the lucene fulltext index is saved
|
|
|
|
var $_luceneDir = null;
|
2012-12-14 07:48:20 +00:00
|
|
|
// Where the drop folders are located
|
|
|
|
var $_dropFolderDir = null;
|
2015-07-28 05:29:08 +00:00
|
|
|
// Where the backup directory is located
|
|
|
|
var $_backupDir = null;
|
2015-05-29 18:42:37 +00:00
|
|
|
// Where the library folder is located
|
|
|
|
var $_libraryFolder = 1;
|
2015-04-17 18:10:36 +00:00
|
|
|
// Where the checked out files are located
|
|
|
|
var $_checkOutDir = null;
|
2015-04-22 15:21:57 +00:00
|
|
|
// Create checkout dir if it doesn't exists
|
|
|
|
var $_createCheckOutDir = false;
|
2018-03-14 17:43:01 +00:00
|
|
|
// Where the repository for extensions is located
|
|
|
|
var $_repositoryUrl = null;
|
2020-02-21 09:01:09 +00:00
|
|
|
// URL of proxy
|
|
|
|
var $_proxyUrl = null;
|
|
|
|
// User of proxy
|
|
|
|
var $_proxyUser = null;
|
|
|
|
// Password of proxy
|
|
|
|
var $_proxyPassword = null;
|
2016-05-23 11:15:50 +00:00
|
|
|
// enable removal of file from dropfolder after success import
|
|
|
|
var $_removeFromDropFolder = false;
|
2012-08-28 06:34:21 +00:00
|
|
|
// Where the stop word file is located
|
|
|
|
var $_stopWordsFile = null;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable lucene fulltext search
|
|
|
|
var $_enableFullSearch = true;
|
2016-08-02 15:08:54 +00:00
|
|
|
// max size of documents for direct indexing
|
|
|
|
var $_maxSizeForFullText = 0;
|
2015-08-10 19:41:51 +00:00
|
|
|
// fulltext search engine
|
|
|
|
var $_fullSearchEngine = 'lucene';
|
2016-02-01 18:57:08 +00:00
|
|
|
// default search method
|
|
|
|
var $_defaultSearchMethod = 'database'; // or 'fulltext'
|
2016-10-04 14:54:16 +00:00
|
|
|
// jump straight to the document if it is the only hit of a search
|
|
|
|
var $_showSingleSearchHit = true;
|
2011-07-21 06:53:35 +00:00
|
|
|
// contentOffsetDirTo
|
|
|
|
var $_contentOffsetDir = "1048576";
|
|
|
|
// Maximum number of sub-directories per parent directory
|
|
|
|
var $_maxDirID = 32700;
|
2016-11-17 10:31:58 +00:00
|
|
|
// default available languages (list of languages shown in language selector)
|
|
|
|
var $_availablelanguages = array();
|
2011-07-21 06:53:35 +00:00
|
|
|
// default language (name of a subfolder in folder "languages")
|
2015-08-07 07:11:00 +00:00
|
|
|
var $_language = "en_GB";
|
2020-12-01 17:25:22 +00:00
|
|
|
// default date format
|
|
|
|
var $_dateformat = "Y-m-d";
|
|
|
|
// default date/time format
|
|
|
|
var $_datetimformat = "Y-m-d H:i:s";
|
2011-07-21 06:53:35 +00:00
|
|
|
// users are notified about document-changes that took place within the last $_updateNotifyTime seconds
|
|
|
|
var $_updateNotifyTime = 86400;
|
|
|
|
// files with one of the following endings can be viewed online
|
|
|
|
var $_viewOnlineFileTypes = array();
|
2016-03-09 06:45:37 +00:00
|
|
|
// files with one of the following endings can be edited online
|
|
|
|
var $_editOnlineFileTypes = array();
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable converting of files
|
|
|
|
var $_enableConverting = false;
|
|
|
|
// default style
|
2013-02-14 11:54:16 +00:00
|
|
|
var $_theme = "bootstrap";
|
2020-11-09 14:14:09 +00:00
|
|
|
// override user settings of theme
|
|
|
|
var $_overrideTheme = false;
|
2019-10-28 11:06:41 +00:00
|
|
|
// experimental one page mode for ViewFolder page
|
|
|
|
var $_onePageMode = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable automatic email notification
|
|
|
|
var $_enableEmail = true;
|
|
|
|
// enable/disable group and user view for all users
|
|
|
|
var $_enableUsersView = true;
|
|
|
|
// enable/disable listing administrator as reviewer/approver
|
|
|
|
var $_enableAdminRevApp = false;
|
2013-02-27 08:09:00 +00:00
|
|
|
// enable/disable listing owner as reviewer/approver
|
|
|
|
var $_enableOwnerRevApp = false;
|
|
|
|
// enable/disable listing logged in user as reviewer/approver
|
|
|
|
var $_enableSelfRevApp = false;
|
2017-01-16 12:00:22 +00:00
|
|
|
// enable/disable update of a review/approval by the reviewer/approver
|
|
|
|
var $_enableUpdateRevApp = false;
|
2021-07-01 10:14:55 +00:00
|
|
|
// enable/disable removal of a review/approval by the admiistrator
|
|
|
|
var $_enableRemoveRevApp = false;
|
2018-01-16 17:15:05 +00:00
|
|
|
// enable/disable listing logged in user as recipient
|
|
|
|
var $_enableSelfReceipt = false;
|
2017-01-17 13:20:33 +00:00
|
|
|
// enable/disable update of a receipt by the recipient
|
|
|
|
var $_enableUpdateReceipt = false;
|
2016-10-27 12:11:18 +00:00
|
|
|
// enable/disable listing administrator as recipient
|
|
|
|
var $_enableAdminReceipt = false;
|
2016-10-27 10:17:04 +00:00
|
|
|
// enable/disable listing owner as recipient
|
|
|
|
var $_enableOwnerReceipt = false;
|
2018-01-16 17:15:05 +00:00
|
|
|
// enable/disable filter for receipt by the recipient
|
|
|
|
var $_enableFilterReceipt = false;
|
2012-10-05 19:47:37 +00:00
|
|
|
// enable/disable default notification for owner
|
|
|
|
var $_enableOwnerNotification = false;
|
|
|
|
// enable/disable deleting of versions for regular users
|
|
|
|
var $_enableVersionDeletion = false;
|
|
|
|
// enable/disable to overwrite the status of a version for regular users
|
|
|
|
var $_enableVersionModification = false;
|
2013-01-28 10:40:04 +00:00
|
|
|
// enable/disable duplicate names of a document in a folder
|
|
|
|
var $_enableDuplicateDocNames = true;
|
2019-07-01 08:50:40 +00:00
|
|
|
// enable/disable duplicate names of a subfolder in a folder
|
|
|
|
var $_enableDuplicateSubFolderNames = true;
|
2020-11-26 08:14:03 +00:00
|
|
|
// allow/disallow to cancel a checkout
|
|
|
|
var $_enableCancelCheckout = true;
|
2015-06-23 05:44:47 +00:00
|
|
|
// override mimetype set by browser when uploading a file
|
|
|
|
var $_overrideMimeType = false;
|
2016-03-04 08:25:18 +00:00
|
|
|
// advanced access control lists
|
|
|
|
var $_advancedAcl = false;
|
2012-10-05 19:47:37 +00:00
|
|
|
// enable/disable notification when added as a reviewer/approver
|
|
|
|
var $_enableNotificationAppRev = true;
|
2015-03-11 17:11:41 +00:00
|
|
|
// enable/disable notification of users/group who need to take action for
|
|
|
|
// next transition. This is not like enableNotificationAppRev where a
|
|
|
|
// notification is added to the document. If this is turned on, the
|
|
|
|
// notification will be send in any case.
|
|
|
|
var $_enableNotificationWorkflow = false;
|
2015-01-29 16:28:40 +00:00
|
|
|
// preset expiration date
|
|
|
|
var $_presetExpirationDate = "";
|
2015-06-02 08:02:46 +00:00
|
|
|
// initial document status
|
2015-06-02 15:26:41 +00:00
|
|
|
var $_initialDocumentStatus = 2; //S_RELEASED;
|
2011-07-21 06:53:35 +00:00
|
|
|
// the name of the versioning info file created by the backup tool
|
|
|
|
var $_versioningFileName = "versioning_info.txt";
|
2013-01-24 08:33:51 +00:00
|
|
|
// the mode of workflow
|
|
|
|
var $_workflowMode = "traditional";
|
2015-04-20 11:44:45 +00:00
|
|
|
// enable/disable acknowledge workflow
|
2018-04-03 07:32:36 +00:00
|
|
|
var $_enableReceiptWorkflow = true;
|
2019-04-09 08:51:51 +00:00
|
|
|
// enable/disable reject of reception
|
|
|
|
var $_enableReceiptReject = false;
|
2015-04-20 11:44:45 +00:00
|
|
|
// enable/disable revision workflow
|
|
|
|
var $_enableRevisionWorkflow = true;
|
2018-03-13 16:51:44 +00:00
|
|
|
// enable/disable revision on vote reject
|
2019-10-18 05:24:58 +00:00
|
|
|
var $_enableRevisionOneVoteReject = true;
|
2018-02-26 07:08:57 +00:00
|
|
|
// Allow to set just a reviewer in tradional workflow
|
|
|
|
var $_allowReviewerOnly = true;
|
2019-02-01 07:59:43 +00:00
|
|
|
// Allow to change reviewer/approver after review/approval has started
|
|
|
|
var $_allowChangeRevAppInProcess = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable log system
|
|
|
|
var $_logFileEnable = true;
|
|
|
|
// the log file rotation
|
|
|
|
var $_logFileRotation = "d";
|
2017-04-27 04:50:12 +00:00
|
|
|
// Enable file upload by fine-uploader (was 'jumploader')
|
2011-10-25 13:34:56 +00:00
|
|
|
var $_enableLargeFileUpload = false;
|
2017-03-15 15:39:05 +00:00
|
|
|
// size of partitions for file uploaded by fine-loader
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_partitionSize = 2000000;
|
2017-03-15 15:39:05 +00:00
|
|
|
// max size of files uploaded by fine-uploader, set to 0 for unlimited
|
|
|
|
var $_maxUploadSize = 0;
|
2019-01-18 12:08:21 +00:00
|
|
|
// enable/disables xsendfile
|
|
|
|
var $_enableXsendfile = true;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable users images
|
|
|
|
var $_enableUserImage = false;
|
2018-04-12 04:41:51 +00:00
|
|
|
// enable/disable replacing documents by webdav
|
|
|
|
var $_enableWebdavReplaceDoc = true;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable calendar
|
|
|
|
var $_enableCalendar = true;
|
|
|
|
// calendar default view ("w" for week,"m" for month,"y" for year)
|
|
|
|
var $_calendarDefaultView = "y";
|
|
|
|
// first day of the week (0=sunday, 1=monday, 6=saturday)
|
|
|
|
var $_firstDayOfWeek = 0;
|
2021-09-09 09:42:38 +00:00
|
|
|
// enable/disable download of extensions
|
|
|
|
var $_enableExtensionDownload = true;
|
|
|
|
// enable/disable import of extensions
|
|
|
|
var $_enableExtensionImport = true;
|
|
|
|
// enable/disable import of extensions from repository
|
|
|
|
var $_enableExtensionImportFromRepository = true;
|
2014-07-11 06:41:25 +00:00
|
|
|
// enable/disable display of the clipboard
|
|
|
|
var $_enableClipboard = true;
|
2015-07-09 05:58:34 +00:00
|
|
|
// enable/disable list of tasks in main menu
|
|
|
|
var $_enableMenuTasks = true;
|
2018-03-26 08:00:20 +00:00
|
|
|
// select which tasks show up in main menu
|
|
|
|
var $_tasksInMenu = array();
|
2017-07-31 18:30:59 +00:00
|
|
|
// enable/disable list of files in drop folder
|
|
|
|
var $_enableDropFolderList = false;
|
2017-04-11 06:33:33 +00:00
|
|
|
// enable/disable display of the session list
|
2017-04-11 15:36:40 +00:00
|
|
|
var $_enableSessionList = false;
|
2014-07-11 06:41:25 +00:00
|
|
|
// enable/disable display of the drop zone for file upload
|
|
|
|
var $_enableDropUpload = true;
|
2017-04-27 04:50:12 +00:00
|
|
|
// Enable multiple file upload
|
|
|
|
var $_enableMultiUpload = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// enable/disable display of the folder tree
|
|
|
|
var $_enableFolderTree = true;
|
2013-04-10 13:41:38 +00:00
|
|
|
// count documents and folders for folderview recursively
|
|
|
|
var $_enableRecursiveCount = false;
|
|
|
|
// maximum number of documents or folders when counted recursively
|
|
|
|
var $_maxRecursiveCount = 10000;
|
2016-02-01 18:57:08 +00:00
|
|
|
// enable/disable help
|
|
|
|
var $_enableHelp = true;
|
2013-01-28 10:40:04 +00:00
|
|
|
// enable/disable language selection menu
|
|
|
|
var $_enableLanguageSelector = true;
|
2014-02-01 15:06:12 +00:00
|
|
|
// enable/disable theme selector
|
|
|
|
var $_enableThemeSelector = true;
|
2011-07-21 06:53:35 +00:00
|
|
|
// expandFolderTree
|
|
|
|
var $_expandFolderTree = 1;
|
|
|
|
// enable/disable editing of users own profile
|
|
|
|
var $_disableSelfEdit = false;
|
2012-08-28 06:34:21 +00:00
|
|
|
// Sort order of users in lists('fullname' or '' (login))
|
|
|
|
var $_sortUsersInList = '';
|
2014-02-01 14:23:56 +00:00
|
|
|
// Sort method for forders and documents ('n' (name) or '')
|
|
|
|
var $_sortFoldersDefault = '';
|
2018-02-07 07:43:46 +00:00
|
|
|
// Where to insert new documents ('start' or 'end')
|
|
|
|
var $_defaultDocPosition = 'end';
|
2021-09-28 09:13:05 +00:00
|
|
|
// Where to insert new folders ('start' or 'end')
|
|
|
|
var $_defaultFolderPosition = 'end';
|
2016-08-02 15:08:54 +00:00
|
|
|
// Set valid IP for admin logins
|
2011-07-21 06:53:35 +00:00
|
|
|
// if enabled admin can login only by specified IP addres
|
|
|
|
var $_adminIP = "";
|
|
|
|
// Max Execution Time
|
|
|
|
var $_maxExecutionTime = null;
|
2015-08-05 19:11:21 +00:00
|
|
|
// command timeout
|
|
|
|
var $_cmdTimeout = 5;
|
2020-02-27 16:58:31 +00:00
|
|
|
// debug mode
|
|
|
|
var $_enableDebugMode = false;
|
2014-03-18 09:03:39 +00:00
|
|
|
// Preview image width in lists
|
|
|
|
var $_previewWidthList = 40;
|
2017-09-20 07:20:56 +00:00
|
|
|
// Preview image width in menu lists
|
|
|
|
var $_previewWidthMenuList = 40;
|
2014-03-18 09:03:39 +00:00
|
|
|
// Preview image width on document details page
|
|
|
|
var $_previewWidthDetail = 100;
|
2017-09-20 07:20:56 +00:00
|
|
|
// Preview image width in drop folder list
|
|
|
|
var $_previewWidthDropFolderList = 100;
|
2016-11-07 08:25:06 +00:00
|
|
|
// show full preview on document details page
|
|
|
|
var $_showFullPreview = false;
|
|
|
|
// convert to pdf for preview on document details page
|
|
|
|
var $_convertToPdf = false;
|
2017-12-14 08:39:05 +00:00
|
|
|
// maximum number of documents/folders on ViewFolder page
|
|
|
|
var $_maxItemsPerPage = 0;
|
|
|
|
// number of documents/folders fetched when scrolling to bottom of ViewFolder page
|
|
|
|
var $_incItemsPerPage = 0;
|
2014-04-08 08:40:20 +00:00
|
|
|
// Show form to submit missing translations at end of page
|
|
|
|
var $_showMissingTranslations = false;
|
2013-02-04 09:19:50 +00:00
|
|
|
// Extra Path to additional software, will be added to include path
|
|
|
|
var $_extraPath = null;
|
2015-06-30 05:52:07 +00:00
|
|
|
// do not check version of database
|
|
|
|
var $_doNotCheckDBVersion = false;
|
2011-07-21 06:53:35 +00:00
|
|
|
// DB-Driver used by adodb (see adodb-readme)
|
|
|
|
var $_dbDriver = "mysql";
|
|
|
|
// DB-Server
|
|
|
|
var $_dbHostname = "localhost";
|
|
|
|
// database where the tables for mydms are stored (optional - see adodb-readme)
|
|
|
|
var $_dbDatabase = null;
|
|
|
|
// username for database-access
|
|
|
|
var $_dbUser = null;
|
|
|
|
// password for database-access
|
|
|
|
var $_dbPass = null;
|
|
|
|
// SMTP : server
|
|
|
|
var $_smtpServer = null;
|
|
|
|
// SMTP : port
|
|
|
|
var $_smtpPort = null;
|
|
|
|
// SMTP : send from
|
|
|
|
var $_smtpSendFrom = null;
|
2013-09-13 12:54:37 +00:00
|
|
|
// SMTP : user
|
|
|
|
var $_smtpUser = null;
|
|
|
|
// SMTP : password
|
|
|
|
var $_smtpPassword = null;
|
2016-08-10 15:48:23 +00:00
|
|
|
// LDAP Host, URIs are supported, e.g.: ldaps://ldap.host.com
|
|
|
|
var $_ldapHost = "";
|
|
|
|
// Port of ldap server, optional.
|
|
|
|
var $_ldapPort = 389;
|
|
|
|
// Base dn for searching users, if set the user will be search below base dn
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_ldapBaseDN = "";
|
2016-08-10 15:48:23 +00:00
|
|
|
// Use this dn for an initial bind for searching the user
|
2013-07-31 20:00:51 +00:00
|
|
|
var $_ldapBindDN = "";
|
2016-08-10 15:48:23 +00:00
|
|
|
// Use this password for an initial bind for searching the user
|
2013-07-31 20:00:51 +00:00
|
|
|
var $_ldapBindPw = "";
|
2016-08-10 15:48:23 +00:00
|
|
|
// Used only by AD <username>@_ldapAccountDomainName will be used for a bind
|
|
|
|
// when the user is validated
|
2011-07-21 06:53:35 +00:00
|
|
|
var $_ldapAccountDomainName = "";
|
2016-08-10 15:48:23 +00:00
|
|
|
// Type of Ldap server: 0 = ldap; 1 = AD
|
|
|
|
var $_ldapType = 1;
|
|
|
|
// Additional filter when searching for the user. If not set, the user will be searched
|
|
|
|
// below basedn and the search term 'uid=<username>' or 'sAMAccountName=<username>'
|
|
|
|
// if set the search will be (&(cn=<username>)<filter>)
|
2016-01-19 14:30:54 +00:00
|
|
|
var $_ldapFilter = "";
|
2012-02-14 12:53:47 +00:00
|
|
|
var $_converters = array(); // list of commands used to convert files to text for Indexer
|
2013-05-02 20:30:42 +00:00
|
|
|
var $_extensions = array(); // configuration for extensions
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @param string $configFilePath path to config file
|
|
|
|
*/
|
2016-03-22 13:55:48 +00:00
|
|
|
function __construct($configFilePath='') { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
if($configFilePath=='') {
|
|
|
|
$configFilePath = $this->searchConfigFilePath();
|
|
|
|
|
|
|
|
// set $_configFilePath
|
|
|
|
$this->_configFilePath = $configFilePath;
|
|
|
|
} else {
|
|
|
|
$this->_configFilePath = $configFilePath;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load config file
|
2013-02-14 11:10:53 +00:00
|
|
|
if (!defined("SEEDDMS_INSTALL")) {
|
2011-07-21 06:53:35 +00:00
|
|
|
if(!file_exists($configFilePath)) {
|
2020-01-28 08:36:48 +00:00
|
|
|
echo "You do not seem to have a valid configuration. Run the <a href=\"install/install.php\">install tool</a> first.";
|
2011-07-21 06:53:35 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
2021-08-04 12:19:11 +00:00
|
|
|
$this->_configFileDir = dirname($this->_configFilePath);
|
|
|
|
|
2018-11-27 11:17:51 +00:00
|
|
|
if(!$this->load($configFilePath)) {
|
|
|
|
echo "Your configuration contains errors.";
|
|
|
|
exit;
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
if (!is_null($this->_maxExecutionTime))
|
|
|
|
ini_set("max_execution_time", $this->_maxExecutionTime);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if a variable has the string 'true', 'on', 'yes' or 'y'
|
|
|
|
* and returns true.
|
|
|
|
*
|
|
|
|
* @param string $var value
|
|
|
|
* @return true/false
|
|
|
|
*/
|
|
|
|
function boolVal($var) { /* {{{ */
|
|
|
|
$var = strtolower(strval($var));
|
|
|
|
switch ($var) {
|
|
|
|
case 'true':
|
|
|
|
case 'on':
|
|
|
|
case 'yes':
|
|
|
|
case 'y':
|
|
|
|
$out = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$out = false;
|
|
|
|
}
|
|
|
|
return $out;
|
|
|
|
} /* }}} */
|
|
|
|
|
2018-03-26 08:00:20 +00:00
|
|
|
/**
|
|
|
|
* Check if a variable is a string and returns an array
|
|
|
|
*
|
|
|
|
* @param array $var value
|
|
|
|
* @return true/false
|
|
|
|
*/
|
|
|
|
function arrayVal($var) { /* {{{ */
|
|
|
|
if((string) $var)
|
|
|
|
return explode(';', $var);
|
|
|
|
return array();
|
|
|
|
} /* }}} */
|
|
|
|
|
2018-04-19 11:41:50 +00:00
|
|
|
/**
|
|
|
|
* Return ';' seperated string from array
|
|
|
|
*
|
|
|
|
* @param array $value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function arrayToString($value) { /* {{{ */
|
|
|
|
return implode(";", $value);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return array from ';' seperated string
|
|
|
|
*
|
|
|
|
* @param string $value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function stringToArray($value) { /* {{{ */
|
|
|
|
return explode(";", $Value);
|
|
|
|
} /* }}} */
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
/**
|
|
|
|
* set $_viewOnlineFileTypes
|
|
|
|
*
|
|
|
|
* @param string $stringValue string value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function setViewOnlineFileTypesFromString($stringValue) { /* {{{ */
|
|
|
|
$this->_viewOnlineFileTypes = explode(";", $stringValue);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get $_viewOnlineFileTypes in a string value
|
|
|
|
*
|
|
|
|
* @return string value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function getViewOnlineFileTypesToString() { /* {{{ */
|
|
|
|
return implode(";", $this->_viewOnlineFileTypes);
|
|
|
|
} /* }}} */
|
|
|
|
|
2016-03-09 06:45:37 +00:00
|
|
|
/**
|
|
|
|
* set $_editOnlineFileTypes
|
|
|
|
*
|
|
|
|
* @param string $stringValue string value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function setEditOnlineFileTypesFromString($stringValue) { /* {{{ */
|
|
|
|
$this->_editOnlineFileTypes = explode(";", $stringValue);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get $_editOnlineFileTypes in a string value
|
|
|
|
*
|
|
|
|
* @return string value
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function getEditOnlineFileTypesToString() { /* {{{ */
|
|
|
|
return implode(";", $this->_editOnlineFileTypes);
|
|
|
|
} /* }}} */
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
/**
|
|
|
|
* Load config file
|
|
|
|
*
|
|
|
|
* @param string $configFilePath config file path
|
|
|
|
*
|
|
|
|
* @return true/false
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
public function load($configFilePath) { /* {{{ */
|
2012-12-14 07:48:20 +00:00
|
|
|
$contents = file_get_contents($configFilePath);
|
|
|
|
if(!$contents) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
$xml = simplexml_load_string($contents);
|
|
|
|
if(!$xml) {
|
|
|
|
return false;
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/site/display
|
|
|
|
$node = $xml->xpath('/configuration/site/display');
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_siteName = strval($tab["siteName"]);
|
|
|
|
$this->_footNote = strval($tab["footNote"]);
|
|
|
|
$this->_printDisclaimer = Settings::boolVal($tab["printDisclaimer"]);
|
|
|
|
$this->_language = strval($tab["language"]);
|
2020-12-01 17:25:22 +00:00
|
|
|
$this->_dateformat = strval($tab["dateformat"]);
|
|
|
|
$this->_datetimeformat = strval($tab["datetimeformat"]);
|
2016-11-17 10:31:58 +00:00
|
|
|
if(trim(strval($tab["availablelanguages"])))
|
|
|
|
$this->_availablelanguages = explode(',',strval($tab["availablelanguages"]));
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_theme = strval($tab["theme"]);
|
2020-11-09 14:14:09 +00:00
|
|
|
$this->_overrideTheme = Settings::boolVal($tab["overrideTheme"]);
|
2019-10-28 11:06:41 +00:00
|
|
|
$this->_onePageMode = Settings::boolVal($tab["onePageMode"]);
|
2014-03-20 07:17:46 +00:00
|
|
|
if(isset($tab["previewWidthList"]))
|
|
|
|
$this->_previewWidthList = intval($tab["previewWidthList"]);
|
2017-09-20 07:20:56 +00:00
|
|
|
if(isset($tab["previewWidthMenuList"]))
|
|
|
|
$this->_previewWidthMenuList = intval($tab["previewWidthMenuList"]);
|
2014-03-20 07:17:46 +00:00
|
|
|
if(isset($tab["previewWidthDetail"]))
|
|
|
|
$this->_previewWidthDetail = intval($tab["previewWidthDetail"]);
|
2017-09-20 07:20:56 +00:00
|
|
|
if(isset($tab["previewWidthDropFolderList"]))
|
|
|
|
$this->_previewWidthDropFolderList = intval($tab["previewWidthDropFolderList"]);
|
2016-11-07 08:25:06 +00:00
|
|
|
$this->_showFullPreview = Settings::boolVal($tab["showFullPreview"]);
|
|
|
|
$this->_convertToPdf = Settings::boolVal($tab["convertToPdf"]);
|
2017-12-14 08:39:05 +00:00
|
|
|
if(isset($tab["maxItemsPerPage"]))
|
|
|
|
$this->_maxItemsPerPage = intval($tab["maxItemsPerPage"]);
|
|
|
|
if(isset($tab["incItemsPerPage"]))
|
|
|
|
$this->_incItemsPerPage = intval($tab["incItemsPerPage"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/site/edition
|
|
|
|
$node = $xml->xpath('/configuration/site/edition');
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_strictFormCheck = Settings::boolVal($tab["strictFormCheck"]);
|
2020-09-07 14:20:37 +00:00
|
|
|
$this->_inlineEditing = Settings::boolVal($tab["inlineEditing"]);
|
2019-12-19 08:03:59 +00:00
|
|
|
if(trim(strval($tab["noDocumentFormFields"])))
|
|
|
|
$this->_noDocumentFormFields = explode(',',strval($tab["noDocumentFormFields"]));
|
2021-09-22 07:53:53 +00:00
|
|
|
if(trim(strval($tab["noFolderFormFields"])))
|
|
|
|
$this->_noFolderFormFields = explode(',',strval($tab["noFolderFormFields"]));
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setViewOnlineFileTypesFromString(strval($tab["viewOnlineFileTypes"]));
|
2016-03-09 06:45:37 +00:00
|
|
|
$this->setEditOnlineFileTypesFromString(strval($tab["editOnlineFileTypes"]));
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_enableConverting = Settings::boolVal($tab["enableConverting"]);
|
|
|
|
$this->_enableEmail = Settings::boolVal($tab["enableEmail"]);
|
|
|
|
$this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]);
|
2017-04-11 06:33:33 +00:00
|
|
|
$this->_enableSessionList = Settings::boolVal($tab["enableSessionList"]);
|
2014-03-20 07:17:46 +00:00
|
|
|
$this->_enableClipboard = Settings::boolVal($tab["enableClipboard"]);
|
2015-07-09 05:58:34 +00:00
|
|
|
$this->_enableMenuTasks = Settings::boolVal($tab["enableMenuTasks"]);
|
2018-03-26 08:00:20 +00:00
|
|
|
$this->_tasksInMenu = Settings::arrayVal($tab["tasksInMenu"]);
|
2017-07-31 18:30:59 +00:00
|
|
|
$this->_enableDropFolderList = Settings::boolVal($tab["enableDropFolderList"]);
|
2014-07-11 06:41:25 +00:00
|
|
|
$this->_enableDropUpload = Settings::boolVal($tab["enableDropUpload"]);
|
2017-04-27 04:50:12 +00:00
|
|
|
$this->_enableMultiUpload = Settings::boolVal($tab["enableMultiUpload"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
|
2013-04-10 13:41:38 +00:00
|
|
|
$this->_enableRecursiveCount = Settings::boolVal($tab["enableRecursiveCount"]);
|
|
|
|
$this->_maxRecursiveCount = intval($tab["maxRecursiveCount"]);
|
2016-02-01 18:57:08 +00:00
|
|
|
$this->_enableHelp = Settings::boolVal($tab["enableHelp"]);
|
2013-01-28 10:40:04 +00:00
|
|
|
$this->_enableLanguageSelector = Settings::boolVal($tab["enableLanguageSelector"]);
|
2014-02-01 15:06:12 +00:00
|
|
|
$this->_enableThemeSelector = Settings::boolVal($tab["enableThemeSelector"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_enableFullSearch = Settings::boolVal($tab["enableFullSearch"]);
|
2016-08-02 15:08:54 +00:00
|
|
|
$this->_maxSizeForFullText = intval($tab["maxSizeForFullText"]);
|
2015-08-10 19:41:51 +00:00
|
|
|
$this->_fullSearchEngine = strval($tab["fullSearchEngine"]);
|
2016-02-01 18:57:08 +00:00
|
|
|
$this->_defaultSearchMethod = strval($tab["defaultSearchMethod"]);
|
2016-10-04 14:54:16 +00:00
|
|
|
$this->_showSingleSearchHit = Settings::boolVal($tab["showSingleSearchHit"]);
|
2012-08-28 06:34:21 +00:00
|
|
|
$this->_stopWordsFile = strval($tab["stopWordsFile"]);
|
|
|
|
$this->_sortUsersInList = strval($tab["sortUsersInList"]);
|
2014-02-01 14:23:56 +00:00
|
|
|
$this->_sortFoldersDefault = strval($tab["sortFoldersDefault"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_expandFolderTree = intval($tab["expandFolderTree"]);
|
2015-05-29 18:42:37 +00:00
|
|
|
$this->_libraryFolder = intval($tab["libraryFolder"]);
|
2018-02-07 07:43:46 +00:00
|
|
|
$this->_defaultDocPosition = strval($tab["defaultDocPosition"]);
|
2021-09-28 09:13:05 +00:00
|
|
|
$this->_defaultFolderPosition = strval($tab["defaultFolderPosition"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2021-09-09 09:42:38 +00:00
|
|
|
// XML Path: /configuration/site/webdav
|
2018-04-12 04:41:51 +00:00
|
|
|
$node = $xml->xpath('/configuration/site/webdav');
|
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableWebdavReplaceDoc = Settings::boolVal($tab["enableWebdavReplaceDoc"]);
|
|
|
|
}
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// XML Path: /configuration/site/calendar
|
|
|
|
$node = $xml->xpath('/configuration/site/calendar');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableCalendar = Settings::boolVal($tab["enableCalendar"]);
|
|
|
|
$this->_calendarDefaultView = strval($tab["calendarDefaultView"]);
|
|
|
|
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]);
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2021-09-09 09:42:38 +00:00
|
|
|
// XML Path: /configuration/site/extensionmgr
|
|
|
|
$node = $xml->xpath('/configuration/site/extensionmgr');
|
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableExtensionDownload = Settings::boolVal($tab["enableExtensionDownload"]);
|
|
|
|
$this->_enableExtensionImport = Settings::boolVal($tab["enableExtensionImport"]);
|
|
|
|
$this->_enableExtensionImportFromRepository = Settings::boolVal($tab["enableExtensionImportFromRepository"]);
|
|
|
|
}
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// XML Path: /configuration/system/server
|
|
|
|
$node = $xml->xpath('/configuration/system/server');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_rootDir = strval($tab["rootDir"]);
|
|
|
|
$this->_httpRoot = strval($tab["httpRoot"]);
|
|
|
|
$this->_contentDir = strval($tab["contentDir"]);
|
|
|
|
if($this->_contentDir && substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
|
|
|
|
$this->_contentDir .= DIRECTORY_SEPARATOR;
|
|
|
|
$this->_cacheDir = strval($tab["cacheDir"]);
|
|
|
|
$this->_stagingDir = strval($tab["stagingDir"]);
|
|
|
|
$this->_luceneDir = strval($tab["luceneDir"]);
|
|
|
|
$this->_dropFolderDir = strval($tab["dropFolderDir"]);
|
|
|
|
$this->_backupDir = strval($tab["backupDir"]);
|
2018-04-12 13:57:21 +00:00
|
|
|
$this->_checkOutDir = strval($tab["checkOutDir"]);
|
|
|
|
$this->_createCheckOutDir = Settings::boolVal($tab["createCheckOutDir"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_repositoryUrl = strval($tab["repositoryUrl"]);
|
2020-03-02 08:15:25 +00:00
|
|
|
$this->_proxyUrl = strval($tab["proxyUrl"]);
|
|
|
|
$this->_proxyUser = strval($tab["proxyUser"]);
|
|
|
|
$this->_proxyPassword = strval($tab["proxyPassword"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]);
|
|
|
|
$this->_logFileRotation = strval($tab["logFileRotation"]);
|
|
|
|
$this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]);
|
|
|
|
$this->_partitionSize = strval($tab["partitionSize"]);
|
|
|
|
$this->_maxUploadSize = strval($tab["maxUploadSize"]);
|
2019-01-18 12:08:21 +00:00
|
|
|
$this->_enableXsendfile = Settings::boolVal($tab["enableXsendfile"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2018-04-12 13:57:21 +00:00
|
|
|
// XML Path: /configuration/system/authentication
|
|
|
|
$node = $xml->xpath('/configuration/system/authentication');
|
2018-04-12 04:46:35 +00:00
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]);
|
|
|
|
$this->_enableGuestAutoLogin = Settings::boolVal($tab["enableGuestAutoLogin"]);
|
2018-04-12 13:57:21 +00:00
|
|
|
$this->_enable2FactorAuthentication = Settings::boolVal($tab["enable2FactorAuthentication"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]);
|
|
|
|
$this->_passwordStrength = intval($tab["passwordStrength"]);
|
|
|
|
$this->_passwordStrengthAlgorithm = strval($tab["passwordStrengthAlgorithm"]);
|
|
|
|
$this->_passwordExpiration = intval($tab["passwordExpiration"]);
|
|
|
|
$this->_passwordHistory = intval($tab["passwordHistory"]);
|
|
|
|
$this->_loginFailure = intval($tab["loginFailure"]);
|
|
|
|
$this->_autoLoginUser = intval($tab["autoLoginUser"]);
|
|
|
|
$this->_quota = intval($tab["quota"]);
|
2021-06-26 09:57:02 +00:00
|
|
|
if(trim(strval($tab["undelUserIds"])))
|
|
|
|
$this->_undelUserIds = explode(',',strval($tab["undelUserIds"]));
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_encryptionKey = strval($tab["encryptionKey"]);
|
|
|
|
$this->_cookieLifetime = intval($tab["cookieLifetime"]);
|
|
|
|
$this->_defaultAccessDocs = intval($tab["defaultAccessDocs"]);
|
|
|
|
$this->_restricted = Settings::boolVal($tab["restricted"]);
|
|
|
|
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
|
|
|
|
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/system/authentication/connectors/connector
|
|
|
|
// attributs mandatories : type enable
|
|
|
|
$node = $xml->xpath('/configuration/system/authentication/connectors/connector');
|
|
|
|
$this->_usersConnectors = array();
|
|
|
|
foreach($node as $connectorNode)
|
|
|
|
{
|
|
|
|
$typeConn = strval($connectorNode["type"]);
|
|
|
|
$params = array();
|
|
|
|
foreach($connectorNode->attributes() as $attKey => $attValue)
|
|
|
|
{
|
|
|
|
if ($attKey=="enable")
|
|
|
|
$params[$attKey] = Settings::boolVal($attValue);
|
|
|
|
else
|
|
|
|
$params[$attKey] = strval($attValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_usersConnectors[$typeConn] = $params;
|
|
|
|
|
|
|
|
// manage old settings parameters
|
|
|
|
if ($params['enable'] && ($typeConn == "ldap"))
|
|
|
|
{
|
|
|
|
$this->_ldapHost = strVal($connectorNode["host"]);
|
|
|
|
$this->_ldapPort = intVal($connectorNode["port"]);
|
|
|
|
$this->_ldapBaseDN = strVal($connectorNode["baseDN"]);
|
2013-07-31 20:00:51 +00:00
|
|
|
$this->_ldapBindDN = strVal($connectorNode["bindDN"]);
|
|
|
|
$this->_ldapBindPw = strVal($connectorNode["bindPw"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_ldapType = 0;
|
2016-01-19 14:30:54 +00:00
|
|
|
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
}
|
|
|
|
else if ($params['enable'] && ($typeConn == "AD"))
|
|
|
|
{
|
|
|
|
$this->_ldapHost = strVal($connectorNode["host"]);
|
|
|
|
$this->_ldapPort = intVal($connectorNode["port"]);
|
|
|
|
$this->_ldapBaseDN = strVal($connectorNode["baseDN"]);
|
2013-07-31 20:00:51 +00:00
|
|
|
$this->_ldapBindDN = strVal($connectorNode["bindDN"]);
|
|
|
|
$this->_ldapBindPw = strVal($connectorNode["bindPw"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_ldapType = 1;
|
2016-01-19 14:30:54 +00:00
|
|
|
$this->_ldapFilter = strVal($connectorNode["filter"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->_ldapAccountDomainName = strVal($connectorNode["accountDomainName"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// XML Path: /configuration/system/database
|
|
|
|
$node = $xml->xpath('/configuration/system/database');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_dbDriver = strval($tab["dbDriver"]);
|
|
|
|
$this->_dbHostname = strval($tab["dbHostname"]);
|
|
|
|
$this->_dbDatabase = strval($tab["dbDatabase"]);
|
|
|
|
$this->_dbUser = strval($tab["dbUser"]);
|
|
|
|
$this->_dbPass = strval($tab["dbPass"]);
|
|
|
|
$this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckDBVersion"]);
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/system/smtp
|
|
|
|
$node = $xml->xpath('/configuration/system/smtp');
|
|
|
|
if (!empty($node))
|
|
|
|
{
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
// smtpServer
|
|
|
|
if (isset($tab["smtpServer"]))
|
|
|
|
$this->_smtpServer = strval($tab["smtpServer"]);
|
|
|
|
else
|
|
|
|
$this->_smtpServer = ini_get("SMTP");
|
|
|
|
// smtpPort
|
|
|
|
if (isset($tab["smtpPort"]))
|
|
|
|
$this->_smtpPort = strval($tab["smtpPort"]);
|
|
|
|
else
|
|
|
|
$this->_smtpPort = ini_get("smtp_port");
|
|
|
|
// smtpSendFrom
|
|
|
|
if (isset($tab["smtpSendFrom"]))
|
|
|
|
$this->_smtpSendFrom = strval($tab["smtpSendFrom"]);
|
|
|
|
else
|
|
|
|
$this->_smtpSendFrom = ini_get("sendmail_from");
|
2013-09-13 12:54:37 +00:00
|
|
|
// smtpUser
|
|
|
|
$this->_smtpUser = strval($tab["smtpUser"]);
|
|
|
|
$this->_smtpPassword = strval($tab["smtpPassword"]);
|
2011-07-21 06:53:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/display
|
|
|
|
$node = $xml->xpath('/configuration/advanced/display');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_siteDefaultPage = strval($tab["siteDefaultPage"]);
|
|
|
|
$this->_rootFolderID = intval($tab["rootFolderID"]);
|
2020-12-18 07:06:01 +00:00
|
|
|
$this->_useHomeAsRootFolder = Settings::boolval($tab["useHomeAsRootFolder"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]);
|
2021-06-24 20:32:04 +00:00
|
|
|
$this->_hiddenConfFields = explode(';', strval($tab["hiddenConfFields"]));
|
2018-04-12 04:46:35 +00:00
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/authentication
|
|
|
|
$node = $xml->xpath('/configuration/advanced/authentication');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_guestID = intval($tab["guestID"]);
|
|
|
|
$this->_adminIP = strval($tab["adminIP"]);
|
2020-06-17 09:19:02 +00:00
|
|
|
$this->_apiKey = strval($tab["apiKey"]);
|
|
|
|
$this->_apiUserId = intval($tab["apiUserId"]);
|
|
|
|
$this->_apiOrigin = strval($tab["apiOrigin"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/edition
|
|
|
|
$node = $xml->xpath('/configuration/advanced/edition');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableAdminRevApp = Settings::boolval($tab["enableAdminRevApp"]);
|
|
|
|
$this->_enableOwnerRevApp = Settings::boolval($tab["enableOwnerRevApp"]);
|
|
|
|
$this->_enableSelfRevApp = Settings::boolval($tab["enableSelfRevApp"]);
|
|
|
|
$this->_enableUpdateRevApp = Settings::boolval($tab["enableUpdateRevApp"]);
|
2021-07-01 10:14:55 +00:00
|
|
|
$this->_enableRemoveRevApp = Settings::boolval($tab["enableRemoveRevApp"]);
|
2018-04-12 13:57:21 +00:00
|
|
|
$this->_enableSelfReceipt = Settings::boolval($tab["enableSelfReceipt"]);
|
|
|
|
$this->_enableAdminReceipt = Settings::boolval($tab["enableAdminReceipt"]);
|
|
|
|
$this->_enableOwnerReceipt = Settings::boolval($tab["enableOwnerReceipt"]);
|
|
|
|
$this->_enableUpdateReceipt = Settings::boolval($tab["enableUpdateReceipt"]);
|
|
|
|
$this->_enableFilterReceipt = Settings::boolval($tab["enableFilterReceipt"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_presetExpirationDate = strval($tab["presetExpirationDate"]);
|
2018-04-12 13:57:21 +00:00
|
|
|
$this->_initialDocumentStatus = intval($tab["initialDocumentStatus"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_versioningFileName = strval($tab["versioningFileName"]);
|
|
|
|
$this->_workflowMode = strval($tab["workflowMode"]);
|
2019-04-09 08:51:51 +00:00
|
|
|
$this->_enableReceiptWorkflow = Settings::boolval($tab["enableReceiptWorkflow"]);
|
|
|
|
$this->_enableReceiptReject = Settings::boolval($tab["enableReceiptReject"]);
|
|
|
|
$this->_enableRevisionWorkflow = Settings::boolval($tab["enableRevisionWorkflow"]);
|
2019-10-18 05:24:58 +00:00
|
|
|
$this->_enableRevisionOneVoteReject = Settings::boolval($tab["enableRevisionOneVoteReject"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_allowReviewerOnly = Settings::boolval($tab["allowReviewerOnly"]);
|
2019-02-01 07:59:43 +00:00
|
|
|
$this->_allowChangeRevAppInProcess = Settings::boolval($tab["allowChangeRevAppInProcess"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_enableVersionDeletion = Settings::boolval($tab["enableVersionDeletion"]);
|
|
|
|
$this->_enableVersionModification = Settings::boolval($tab["enableVersionModification"]);
|
|
|
|
$this->_enableDuplicateDocNames = Settings::boolval($tab["enableDuplicateDocNames"]);
|
2019-07-01 08:50:40 +00:00
|
|
|
$this->_enableDuplicateSubFolderNames = Settings::boolval($tab["enableDuplicateSubFolderNames"]);
|
2020-11-26 08:14:03 +00:00
|
|
|
$this->_enableCancelCheckout = Settings::boolval($tab["enableCancelCheckout"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]);
|
2018-04-12 13:57:21 +00:00
|
|
|
$this->_advancedAcl = Settings::boolval($tab["advancedAcl"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
$this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]);
|
|
|
|
}
|
2012-10-05 19:47:37 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/notification
|
|
|
|
$node = $xml->xpath('/configuration/advanced/notification');
|
2012-10-19 11:41:55 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_enableNotificationAppRev = Settings::boolval($tab["enableNotificationAppRev"]);
|
|
|
|
$this->_enableOwnerNotification = Settings::boolval($tab["enableOwnerNotification"]);
|
2015-03-11 17:11:41 +00:00
|
|
|
$this->_enableNotificationWorkflow = Settings::boolval($tab["enableNotificationWorkflow"]);
|
2012-10-19 11:41:55 +00:00
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/server
|
|
|
|
$node = $xml->xpath('/configuration/advanced/server');
|
2018-04-12 04:46:35 +00:00
|
|
|
if($node) {
|
|
|
|
$tab = $node[0]->attributes();
|
|
|
|
$this->_coreDir = strval($tab["coreDir"]);
|
|
|
|
$this->_luceneClassDir = strval($tab["luceneClassDir"]);
|
|
|
|
$this->_extraPath = strval($tab["extraPath"]);
|
|
|
|
$this->_contentOffsetDir = strval($tab["contentOffsetDir"]);
|
|
|
|
$this->_maxDirID = intval($tab["maxDirID"]);
|
|
|
|
$this->_updateNotifyTime = intval($tab["updateNotifyTime"]);
|
|
|
|
$this->_cmdTimeout = intval($tab["cmdTimeout"]);
|
|
|
|
if (isset($tab["maxExecutionTime"]))
|
|
|
|
$this->_maxExecutionTime = intval($tab["maxExecutionTime"]);
|
|
|
|
else
|
|
|
|
$this->_maxExecutionTime = ini_get("max_execution_time");
|
2020-02-27 16:58:31 +00:00
|
|
|
$this->_enableDebugMode = Settings::boolval($tab["enableDebugMode"]);
|
2018-04-12 04:46:35 +00:00
|
|
|
}
|
2012-02-14 12:53:47 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/system/advanced/converters
|
2015-06-24 19:25:53 +00:00
|
|
|
$convertergroups = $xml->xpath('/configuration/advanced/converters');
|
|
|
|
$this->_converters = array();
|
|
|
|
foreach($convertergroups as $convertergroup) {
|
|
|
|
$tabgroup = $convertergroup->attributes();
|
|
|
|
if(strval($tabgroup['target']))
|
|
|
|
$target = strval($tabgroup['target']);
|
|
|
|
else
|
|
|
|
$target = 'fulltext';
|
|
|
|
foreach($convertergroup as $converter) {
|
|
|
|
$tab = $converter->attributes();
|
|
|
|
$this->_converters[$target][trim(strval($tab['mimeType']))] = trim(strval($converter));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-02 20:30:42 +00:00
|
|
|
// XML Path: /configuration/extensions
|
|
|
|
$extensions = $xml->xpath('/configuration/extensions/extension');
|
|
|
|
$this->_extensions = array();
|
|
|
|
foreach($extensions as $extension) {
|
2015-03-30 15:40:54 +00:00
|
|
|
$tmp = $extension->attributes();
|
|
|
|
$extname = strval($tmp['name']);
|
2019-12-20 16:18:08 +00:00
|
|
|
if(isset($tmp['disable']))
|
|
|
|
$disabled = strval($tmp['disable']);
|
2020-01-14 07:31:43 +00:00
|
|
|
else
|
|
|
|
$disabled = 0;
|
2019-12-20 16:18:08 +00:00
|
|
|
$this->_extensions[$extname]['__disable__'] = $disabled=='1' || $disabled == 'true' ? true : false;
|
2013-05-02 20:30:42 +00:00
|
|
|
foreach($extension->children() as $parameter) {
|
2015-03-30 15:40:54 +00:00
|
|
|
$tmp2 = $parameter->attributes();
|
2020-01-14 07:31:43 +00:00
|
|
|
/* Do not read a parameter with the same name. Just a pre caution */
|
|
|
|
if(strval($tmp2['name']) != '__disable__')
|
|
|
|
$this->_extensions[$extname][strval($tmp2['name'])] = strval($parameter);
|
2013-05-02 20:30:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-14 07:48:20 +00:00
|
|
|
return true;
|
2011-07-21 06:53:35 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set value for one attribut.
|
|
|
|
* Create attribut if not exists.
|
|
|
|
*
|
|
|
|
* @param SimpleXMLElement $node node
|
|
|
|
* @param string $attributName attribut name
|
|
|
|
* @param string $attributValue attribut value
|
|
|
|
*
|
|
|
|
* @return true/false
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
protected function setXMLAttributValue($node, $attributName, $attributValue) { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
if (is_bool($attributValue)) {
|
|
|
|
if ($attributValue)
|
|
|
|
$attributValue = "true";
|
|
|
|
else
|
|
|
|
$attributValue = "false";
|
2018-03-26 08:00:20 +00:00
|
|
|
} elseif(is_array($attributValue)) {
|
|
|
|
$attributValue = implode(';', $attributValue);
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
if (isset($node[$attributName])) {
|
|
|
|
$node[$attributName] = $attributValue;
|
|
|
|
} else {
|
|
|
|
$node->addAttribute($attributName, $attributValue);
|
|
|
|
}
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get XML node, create it if not exists
|
|
|
|
*
|
|
|
|
* @param SimpleXMLElement $rootNode root node
|
|
|
|
* @param string $parentNodeName parent node name
|
|
|
|
* @param string $name name of node
|
|
|
|
*
|
|
|
|
* @return SimpleXMLElement
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
protected function getXMLNode($rootNode, $parentNodeName, $name) { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
$node = $rootNode->xpath($parentNodeName . '/' . $name);
|
|
|
|
|
|
|
|
if (empty($node)) {
|
2012-10-19 11:41:55 +00:00
|
|
|
$node = $rootNode->xpath($parentNodeName);
|
2011-07-21 06:53:35 +00:00
|
|
|
$node = $node[0]->addChild($name);
|
|
|
|
} else {
|
|
|
|
$node = $node[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $node;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Save config file
|
|
|
|
*
|
|
|
|
* @param string $configFilePath config file path
|
|
|
|
*
|
|
|
|
* @return true/false
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
public function save($configFilePath=NULL) { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
if (is_null($configFilePath))
|
|
|
|
$configFilePath = $this->_configFilePath;
|
|
|
|
|
|
|
|
// Load
|
|
|
|
$xml = simplexml_load_string(file_get_contents($configFilePath));
|
|
|
|
$this->getXMLNode($xml, '/', 'configuration');
|
|
|
|
|
|
|
|
// XML Path: /configuration/site/display
|
|
|
|
$this->getXMLNode($xml, '/configuration', 'site');
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/site', 'display');
|
|
|
|
$this->setXMLAttributValue($node, "siteName", $this->_siteName);
|
|
|
|
$this->setXMLAttributValue($node, "footNote", $this->_footNote);
|
|
|
|
$this->setXMLAttributValue($node, "printDisclaimer", $this->_printDisclaimer);
|
|
|
|
$this->setXMLAttributValue($node, "language", $this->_language);
|
2020-12-01 17:25:22 +00:00
|
|
|
$this->setXMLAttributValue($node, "dateformat", $this->_dateformat);
|
|
|
|
$this->setXMLAttributValue($node, "datetimeformat", $this->_datetimeformat);
|
2016-11-17 10:31:58 +00:00
|
|
|
$this->setXMLAttributValue($node, "availablelanguages", implode(',', $this->_availablelanguages));
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "theme", $this->_theme);
|
2020-11-09 14:14:09 +00:00
|
|
|
$this->setXMLAttributValue($node, "overrideTheme", $this->_overrideTheme);
|
2019-10-28 11:06:41 +00:00
|
|
|
$this->setXMLAttributValue($node, "onePageMode", $this->_onePageMode);
|
2014-03-18 09:03:39 +00:00
|
|
|
$this->setXMLAttributValue($node, "previewWidthList", $this->_previewWidthList);
|
2017-09-20 07:20:56 +00:00
|
|
|
$this->setXMLAttributValue($node, "previewWidthMenuList", $this->_previewWidthMenuList);
|
2014-03-18 09:03:39 +00:00
|
|
|
$this->setXMLAttributValue($node, "previewWidthDetail", $this->_previewWidthDetail);
|
2017-09-20 07:20:56 +00:00
|
|
|
$this->setXMLAttributValue($node, "previewWidthDropFolderList", $this->_previewWidthDropFolderList);
|
2016-11-07 08:25:06 +00:00
|
|
|
$this->setXMLAttributValue($node, "showFullPreview", $this->_showFullPreview);
|
|
|
|
$this->setXMLAttributValue($node, "convertToPdf", $this->_convertToPdf);
|
2017-12-14 08:39:05 +00:00
|
|
|
$this->setXMLAttributValue($node, "maxItemsPerPage", $this->_maxItemsPerPage);
|
|
|
|
$this->setXMLAttributValue($node, "incItemsPerPage", $this->_incItemsPerPage);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/site/edition
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/site', 'edition');
|
|
|
|
$this->setXMLAttributValue($node, "strictFormCheck", $this->_strictFormCheck);
|
2020-09-07 14:20:37 +00:00
|
|
|
$this->setXMLAttributValue($node, "inlineEditing", $this->_inlineEditing);
|
2019-12-19 08:03:59 +00:00
|
|
|
$this->setXMLAttributValue($node, "noDocumentFormFields", implode(',', $this->_noDocumentFormFields));
|
2021-09-22 07:53:53 +00:00
|
|
|
$this->setXMLAttributValue($node, "noFolderFormFields", implode(',', $this->_noFolderFormFields));
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "viewOnlineFileTypes", $this->getViewOnlineFileTypesToString());
|
2016-03-09 06:45:37 +00:00
|
|
|
$this->setXMLAttributValue($node, "editOnlineFileTypes", $this->getEditOnlineFileTypesToString());
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableConverting", $this->_enableConverting);
|
|
|
|
$this->setXMLAttributValue($node, "enableEmail", $this->_enableEmail);
|
|
|
|
$this->setXMLAttributValue($node, "enableUsersView", $this->_enableUsersView);
|
2017-04-11 15:36:40 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableSessionList", $this->_enableSessionList);
|
2014-07-11 06:41:25 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableClipboard", $this->_enableClipboard);
|
2015-07-09 05:58:34 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableMenuTasks", $this->_enableMenuTasks);
|
2018-03-26 08:00:20 +00:00
|
|
|
$this->setXMLAttributValue($node, "tasksInMenu", $this->_tasksInMenu);
|
2017-07-31 18:30:59 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableDropFolderList", $this->_enableDropFolderList);
|
2014-07-11 06:41:25 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableDropUpload", $this->_enableDropUpload);
|
2017-04-27 04:50:12 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableMultiUpload", $this->_enableMultiUpload);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
|
2013-04-10 13:41:38 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableRecursiveCount", $this->_enableRecursiveCount);
|
|
|
|
$this->setXMLAttributValue($node, "maxRecursiveCount", $this->_maxRecursiveCount);
|
2016-02-01 18:57:08 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableHelp", $this->_enableHelp);
|
2013-01-28 10:40:04 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableLanguageSelector", $this->_enableLanguageSelector);
|
2014-02-01 15:06:12 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableThemeSelector", $this->_enableThemeSelector);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableFullSearch", $this->_enableFullSearch);
|
2016-08-02 15:08:54 +00:00
|
|
|
$this->setXMLAttributValue($node, "maxSizeForFullText", $this->_maxSizeForFullText);
|
2015-08-10 19:41:51 +00:00
|
|
|
$this->setXMLAttributValue($node, "fullSearchEngine", $this->_fullSearchEngine);
|
2016-02-01 18:57:08 +00:00
|
|
|
$this->setXMLAttributValue($node, "defaultSearchMethod", $this->_defaultSearchMethod);
|
2016-10-04 14:54:16 +00:00
|
|
|
$this->setXMLAttributValue($node, "showSingleSearchHit", $this->_showSingleSearchHit);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
|
2012-08-28 06:34:21 +00:00
|
|
|
$this->setXMLAttributValue($node, "stopWordsFile", $this->_stopWordsFile);
|
|
|
|
$this->setXMLAttributValue($node, "sortUsersInList", $this->_sortUsersInList);
|
2014-02-01 14:23:56 +00:00
|
|
|
$this->setXMLAttributValue($node, "sortFoldersDefault", $this->_sortFoldersDefault);
|
2015-05-29 18:42:37 +00:00
|
|
|
$this->setXMLAttributValue($node, "libraryFolder", $this->_libraryFolder);
|
2018-02-07 07:43:46 +00:00
|
|
|
$this->setXMLAttributValue($node, "defaultDocPosition", $this->_defaultDocPosition);
|
2021-09-28 09:13:05 +00:00
|
|
|
$this->setXMLAttributValue($node, "defaultFolderPosition", $this->_defaultFolderPosition);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2021-09-09 09:42:38 +00:00
|
|
|
// XML Path: /configuration/site/webdav
|
2018-04-12 04:41:51 +00:00
|
|
|
$node = $this->getXMLNode($xml, '/configuration/site', 'webdav');
|
|
|
|
$this->setXMLAttributValue($node, "enableWebdavReplaceDoc", $this->_enableWebdavReplaceDoc);
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// XML Path: /configuration/site/calendar
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/site', 'calendar');
|
|
|
|
$this->setXMLAttributValue($node, "enableCalendar", $this->_enableCalendar);
|
|
|
|
$this->setXMLAttributValue($node, "calendarDefaultView", $this->_calendarDefaultView);
|
|
|
|
$this->setXMLAttributValue($node, "firstDayOfWeek", $this->_firstDayOfWeek);
|
|
|
|
|
2021-09-09 09:42:38 +00:00
|
|
|
// XML Path: /configuration/site/extensionmgr
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/site', 'extensionmgr');
|
|
|
|
$this->setXMLAttributValue($node, "enableExtensionDownload", $this->_enableExtensionDownload);
|
|
|
|
$this->setXMLAttributValue($node, "enableExtensionImport", $this->_enableExtensionImport);
|
|
|
|
$this->setXMLAttributValue($node, "enableExtensionImportFromRepository", $this->_enableExtensionImportFromRepository);
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// XML Path: /configuration/system/server
|
|
|
|
$this->getXMLNode($xml, '/configuration', 'system');
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/system', 'server');
|
|
|
|
$this->setXMLAttributValue($node, "rootDir", $this->_rootDir);
|
|
|
|
$this->setXMLAttributValue($node, "httpRoot", $this->_httpRoot);
|
|
|
|
$this->setXMLAttributValue($node, "contentDir", $this->_contentDir);
|
2012-12-14 07:48:20 +00:00
|
|
|
$this->setXMLAttributValue($node, "cacheDir", $this->_cacheDir);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "stagingDir", $this->_stagingDir);
|
|
|
|
$this->setXMLAttributValue($node, "luceneDir", $this->_luceneDir);
|
2012-12-14 07:48:20 +00:00
|
|
|
$this->setXMLAttributValue($node, "dropFolderDir", $this->_dropFolderDir);
|
2015-07-28 05:29:08 +00:00
|
|
|
$this->setXMLAttributValue($node, "backupDir", $this->_backupDir);
|
2015-04-17 18:10:36 +00:00
|
|
|
$this->setXMLAttributValue($node, "checkOutDir", $this->_checkOutDir);
|
2015-04-22 15:21:57 +00:00
|
|
|
$this->setXMLAttributValue($node, "createCheckOutDir", $this->_createCheckOutDir);
|
2018-03-14 17:43:01 +00:00
|
|
|
$this->setXMLAttributValue($node, "repositoryUrl", $this->_repositoryUrl);
|
2020-03-02 08:15:25 +00:00
|
|
|
$this->setXMLAttributValue($node, "proxyUrl", $this->_proxyUrl);
|
|
|
|
$this->setXMLAttributValue($node, "proxyUser", $this->_proxyUser);
|
|
|
|
$this->setXMLAttributValue($node, "proxyPassword", $this->_proxyPassword);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "logFileEnable", $this->_logFileEnable);
|
|
|
|
$this->setXMLAttributValue($node, "logFileRotation", $this->_logFileRotation);
|
2011-10-25 13:34:56 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableLargeFileUpload", $this->_enableLargeFileUpload);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "partitionSize", $this->_partitionSize);
|
2017-03-15 15:39:05 +00:00
|
|
|
$this->setXMLAttributValue($node, "maxUploadSize", $this->_maxUploadSize);
|
2019-01-18 12:08:21 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableXsendfile", $this->_enableXsendfile);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/system/authentication
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/system', 'authentication');
|
|
|
|
$this->setXMLAttributValue($node, "enableGuestLogin", $this->_enableGuestLogin);
|
2016-01-29 15:48:21 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableGuestAutoLogin", $this->_enableGuestAutoLogin);
|
2016-07-06 20:25:43 +00:00
|
|
|
$this->setXMLAttributValue($node, "enable2FactorAuthentication", $this->_enable2FactorAuthentication);
|
2011-10-10 08:39:31 +00:00
|
|
|
$this->setXMLAttributValue($node, "enablePasswordForgotten", $this->_enablePasswordForgotten);
|
2012-08-28 06:34:21 +00:00
|
|
|
$this->setXMLAttributValue($node, "passwordStrength", $this->_passwordStrength);
|
|
|
|
$this->setXMLAttributValue($node, "passwordStrengthAlgorithm", $this->_passwordStrengthAlgorithm);
|
|
|
|
$this->setXMLAttributValue($node, "passwordExpiration", $this->_passwordExpiration);
|
|
|
|
$this->setXMLAttributValue($node, "passwordHistory", $this->_passwordHistory);
|
|
|
|
$this->setXMLAttributValue($node, "loginFailure", $this->_loginFailure);
|
2015-07-14 19:23:33 +00:00
|
|
|
$this->setXMLAttributValue($node, "autoLoginUser", $this->_autoLoginUser);
|
2012-12-19 10:05:34 +00:00
|
|
|
$this->setXMLAttributValue($node, "quota", $this->_quota);
|
2021-06-26 09:57:02 +00:00
|
|
|
$this->setXMLAttributValue($node, "undelUserIds", implode(',', $this->_undelUserIds));
|
2012-08-29 20:42:13 +00:00
|
|
|
$this->setXMLAttributValue($node, "encryptionKey", $this->_encryptionKey);
|
2013-01-24 08:33:51 +00:00
|
|
|
$this->setXMLAttributValue($node, "cookieLifetime", $this->_cookieLifetime);
|
2017-01-18 19:58:03 +00:00
|
|
|
$this->setXMLAttributValue($node, "defaultAccessDocs", $this->_defaultAccessDocs);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "restricted", $this->_restricted);
|
|
|
|
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
|
|
|
|
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
|
|
|
|
|
|
|
|
// XML Path: /configuration/system/authentication/connectors
|
|
|
|
foreach($this->_usersConnectors as $keyConn => $paramConn)
|
|
|
|
{
|
|
|
|
// search XML node
|
|
|
|
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="'. $keyConn .'"]');
|
|
|
|
|
|
|
|
// Just the first is configured
|
|
|
|
if (isset($node))
|
|
|
|
{
|
|
|
|
if (count($node)>0)
|
|
|
|
{
|
|
|
|
$node = $node[0];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$nodeParent = $xml->xpath('/configuration/system/authentication/connectors');
|
|
|
|
$node = $nodeParent[0]->addChild("connector");
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach($paramConn as $key => $value)
|
|
|
|
{
|
|
|
|
$this->setXMLAttributValue($node, $key, $value);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // isset($node)
|
|
|
|
|
|
|
|
} // foreach
|
|
|
|
|
|
|
|
// XML Path: /configuration/system/authentication/connectors
|
|
|
|
// manage old settings parameters
|
|
|
|
if (isset($this->_ldapHost) && (strlen($this->_ldapHost)>0))
|
|
|
|
{
|
|
|
|
if ($this->_ldapType == 1)
|
|
|
|
{
|
|
|
|
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="AD"]');
|
|
|
|
$node = $node[0];
|
|
|
|
$this->setXMLAttributValue($node, "accountDomainName", $this->_ldapAccountDomainName);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$node = $xml->xpath('/configuration/system/authentication/connectors/connector[@type="ldap"]');
|
|
|
|
$node = $node[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->setXMLAttributValue($node, "host", $this->_ldapHost);
|
|
|
|
$this->setXMLAttributValue($node, "port", $this->_ldapPort);
|
|
|
|
$this->setXMLAttributValue($node, "baseDN", $this->_ldapBaseDN);
|
|
|
|
}
|
|
|
|
|
|
|
|
// XML Path: /configuration/system/database
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/system', 'database');
|
|
|
|
$this->setXMLAttributValue($node, "dbDriver", $this->_dbDriver);
|
|
|
|
$this->setXMLAttributValue($node, "dbHostname", $this->_dbHostname);
|
|
|
|
$this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase);
|
|
|
|
$this->setXMLAttributValue($node, "dbUser", $this->_dbUser);
|
|
|
|
$this->setXMLAttributValue($node, "dbPass", $this->_dbPass);
|
2021-08-05 06:40:49 +00:00
|
|
|
$this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/system/smtp
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/system', 'smtp');
|
|
|
|
$this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer);
|
|
|
|
$this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort);
|
|
|
|
$this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom);
|
2013-09-13 12:54:37 +00:00
|
|
|
$this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser);
|
|
|
|
$this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/display
|
2016-04-21 13:33:57 +00:00
|
|
|
$advnode = $this->getXMLNode($xml, '/configuration', 'advanced');
|
2011-07-21 06:53:35 +00:00
|
|
|
$node = $this->getXMLNode($xml, '/configuration/advanced', 'display');
|
|
|
|
$this->setXMLAttributValue($node, "siteDefaultPage", $this->_siteDefaultPage);
|
|
|
|
$this->setXMLAttributValue($node, "rootFolderID", $this->_rootFolderID);
|
2020-12-18 07:06:01 +00:00
|
|
|
$this->setXMLAttributValue($node, "useHomeAsRootFolder", $this->_useHomeAsRootFolder);
|
2014-04-08 08:40:20 +00:00
|
|
|
$this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations);
|
2021-06-24 20:32:04 +00:00
|
|
|
// $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/authentication
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication');
|
|
|
|
$this->setXMLAttributValue($node, "guestID", $this->_guestID);
|
|
|
|
$this->setXMLAttributValue($node, "adminIP", $this->_adminIP);
|
2020-06-17 09:19:02 +00:00
|
|
|
$this->setXMLAttributValue($node, "apiKey", $this->_apiKey);
|
|
|
|
$this->setXMLAttributValue($node, "apiUserId", $this->_apiUserId);
|
|
|
|
$this->setXMLAttributValue($node, "apiOrigin", $this->_apiOrigin);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/edition
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/advanced', 'edition');
|
|
|
|
$this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp);
|
2013-02-27 08:09:00 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp);
|
|
|
|
$this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp);
|
2017-01-16 12:00:22 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableUpdateRevApp", $this->_enableUpdateRevApp);
|
2021-07-01 10:14:55 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableRemoveRevApp", $this->_enableRemoveRevApp);
|
2018-01-16 17:15:05 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableSelfReceipt", $this->_enableSelfReceipt);
|
2016-10-27 12:11:18 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableAdminReceipt", $this->_enableAdminReceipt);
|
2016-10-27 10:17:04 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableOwnerReceipt", $this->_enableOwnerReceipt);
|
2017-01-17 13:20:33 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableUpdateReceipt", $this->_enableUpdateReceipt);
|
2018-01-16 17:15:05 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableFilterReceipt", $this->_enableFilterReceipt);
|
2015-01-29 16:28:40 +00:00
|
|
|
$this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate);
|
2015-06-02 08:02:46 +00:00
|
|
|
$this->setXMLAttributValue($node, "initialDocumentStatus", $this->_initialDocumentStatus);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName);
|
2013-01-24 08:33:51 +00:00
|
|
|
$this->setXMLAttributValue($node, "workflowMode", $this->_workflowMode);
|
2018-04-03 07:32:36 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableReceiptWorkflow", $this->_enableReceiptWorkflow);
|
2019-04-09 08:51:51 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableReceiptReject", $this->_enableReceiptReject);
|
2015-04-20 11:44:45 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableRevisionWorkflow", $this->_enableRevisionWorkflow);
|
2019-10-18 05:24:58 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableRevisionOneVoteReject", $this->_enableRevisionOneVoteReject);
|
2018-02-26 07:08:57 +00:00
|
|
|
$this->setXMLAttributValue($node, "allowReviewerOnly", $this->_allowReviewerOnly);
|
2019-02-01 07:59:43 +00:00
|
|
|
$this->setXMLAttributValue($node, "allowChangeRevAppInProcess", $this->_allowChangeRevAppInProcess);
|
2012-10-05 19:47:37 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableVersionDeletion", $this->_enableVersionDeletion);
|
|
|
|
$this->setXMLAttributValue($node, "enableVersionModification", $this->_enableVersionModification);
|
2013-01-28 10:40:04 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableDuplicateDocNames", $this->_enableDuplicateDocNames);
|
2019-07-01 08:50:40 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames);
|
2020-11-26 08:14:03 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableCancelCheckout", $this->_enableCancelCheckout);
|
2015-06-23 05:44:47 +00:00
|
|
|
$this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType);
|
2016-03-04 08:25:18 +00:00
|
|
|
$this->setXMLAttributValue($node, "advancedAcl", $this->_advancedAcl);
|
2016-05-23 11:15:50 +00:00
|
|
|
$this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder);
|
2012-10-05 19:47:37 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/notification
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/advanced', 'notification');
|
|
|
|
$this->setXMLAttributValue($node, "enableNotificationAppRev", $this->_enableNotificationAppRev);
|
|
|
|
$this->setXMLAttributValue($node, "enableOwnerNotification", $this->_enableOwnerNotification);
|
2015-03-11 17:11:41 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableNotificationWorkflow", $this->_enableNotificationWorkflow);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// XML Path: /configuration/advanced/server
|
|
|
|
$node = $this->getXMLNode($xml, '/configuration/advanced', 'server');
|
|
|
|
$this->setXMLAttributValue($node, "coreDir", $this->_coreDir);
|
|
|
|
$this->setXMLAttributValue($node, "luceneClassDir", $this->_luceneClassDir);
|
2013-02-04 09:19:50 +00:00
|
|
|
$this->setXMLAttributValue($node, "extraPath", $this->_extraPath);
|
2011-07-21 06:53:35 +00:00
|
|
|
$this->setXMLAttributValue($node, "contentOffsetDir", $this->_contentOffsetDir);
|
|
|
|
$this->setXMLAttributValue($node, "maxDirID", $this->_maxDirID);
|
|
|
|
$this->setXMLAttributValue($node, "updateNotifyTime", $this->_updateNotifyTime);
|
|
|
|
$this->setXMLAttributValue($node, "maxExecutionTime", $this->_maxExecutionTime);
|
2015-08-05 19:11:21 +00:00
|
|
|
$this->setXMLAttributValue($node, "cmdTimeout", $this->_cmdTimeout);
|
2020-02-27 16:58:31 +00:00
|
|
|
$this->setXMLAttributValue($node, "enableDebugMode", $this->_enableDebugMode);
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2016-04-21 13:33:57 +00:00
|
|
|
/* Check if there is still a converters list with a target attribute */
|
|
|
|
$node = $xml->xpath('/configuration/advanced/converters[count(@*)=0]');
|
|
|
|
if (count($node)>0) {
|
|
|
|
$this->setXMLAttributValue($node[0], 'target', 'fulltext');
|
|
|
|
}
|
|
|
|
|
2015-06-24 19:25:53 +00:00
|
|
|
// XML Path: /configuration/advanced/converters
|
|
|
|
foreach($this->_converters as $type=>$converters) {
|
|
|
|
foreach($this->_converters[$type] as $mimeType => $cmd) {
|
|
|
|
// search XML node
|
|
|
|
$node = $xml->xpath('/configuration/advanced/converters[@target="'.$type.'"]/converter[@mimeType="'. $mimeType .'"]');
|
|
|
|
|
|
|
|
if (count($node)>0) {
|
|
|
|
if(trim($cmd)) {
|
|
|
|
$node = $node[0];
|
|
|
|
$node[0] = $cmd;
|
|
|
|
$this->setXMLAttributValue($node, 'mimeType', $mimeType);
|
|
|
|
} else {
|
|
|
|
$node = $node[0];
|
|
|
|
unset($node[0]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(trim($cmd)) {
|
|
|
|
$nodeParent = $xml->xpath('/configuration/advanced/converters[@target="'.$type.'"]');
|
2016-04-21 13:33:57 +00:00
|
|
|
if(count($nodeParent) == 0) {
|
|
|
|
$nodeParent = array($advnode->addChild("converters"));
|
|
|
|
$this->setXMLAttributValue($nodeParent[0], 'target', $type);
|
|
|
|
}
|
2015-06-24 19:25:53 +00:00
|
|
|
$node = $nodeParent[0]->addChild("converter");
|
|
|
|
$node[0] = $cmd;
|
|
|
|
$this->setXMLAttributValue($node, 'mimeType', $mimeType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // foreach
|
|
|
|
} // foreach
|
2012-02-14 12:53:47 +00:00
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2013-05-02 20:30:42 +00:00
|
|
|
// XML Path: /configuration/extensions
|
|
|
|
$extnodes = $xml->xpath('/configuration/extensions');
|
|
|
|
if(!$extnodes) {
|
|
|
|
$nodeParent = $xml->xpath('/configuration');
|
|
|
|
$extnodes = $nodeParent[0]->addChild("extensions");
|
|
|
|
} else {
|
|
|
|
unset($xml->extensions);
|
|
|
|
$extnodes = $xml->addChild("extensions");
|
|
|
|
}
|
|
|
|
foreach($this->_extensions as $name => $extension)
|
2017-04-20 07:54:12 +00:00
|
|
|
{
|
2013-05-02 20:30:42 +00:00
|
|
|
// search XML node
|
|
|
|
$extnode = $extnodes->addChild('extension');
|
2019-10-23 07:08:53 +00:00
|
|
|
$this->setXMLAttributValue($extnode, 'name', $name);
|
2019-12-20 16:18:08 +00:00
|
|
|
$this->setXMLAttributValue($extnode, 'disable', $extension['__disable__'] ? 'true' : 'false');
|
2019-10-23 07:08:53 +00:00
|
|
|
/* New code saves all parameters of the extension which have been set
|
|
|
|
* in configuration form.
|
|
|
|
*/
|
|
|
|
foreach($extension as $fieldname=>$confvalue) {
|
2020-01-14 07:31:43 +00:00
|
|
|
if($fieldname != '___disable__' && $confvalue) {
|
2019-10-23 07:08:53 +00:00
|
|
|
$parameter = $extnode->addChild('parameter');
|
|
|
|
$parameter[0] = isset($extension[$fieldname]) ? (is_array($extension[$fieldname]) ? implode(',', $extension[$fieldname]) : $extension[$fieldname]) : '';
|
|
|
|
$this->setXMLAttributValue($parameter, 'name', $fieldname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Old code saves those parameters listed in the configuration
|
|
|
|
* of the extension.
|
|
|
|
*/
|
|
|
|
/*
|
2013-05-02 20:30:42 +00:00
|
|
|
foreach($GLOBALS['EXT_CONF'][$name]['config'] as $fieldname=>$conf) {
|
|
|
|
$parameter = $extnode->addChild('parameter');
|
2017-01-23 06:52:19 +00:00
|
|
|
$parameter[0] = isset($extension[$fieldname]) ? (is_array($extension[$fieldname]) ? implode(',', $extension[$fieldname]) : $extension[$fieldname]) : '';
|
2013-05-02 20:30:42 +00:00
|
|
|
$this->setXMLAttributValue($parameter, 'name', $fieldname);
|
|
|
|
}
|
2019-10-23 07:08:53 +00:00
|
|
|
*/
|
2013-05-02 20:30:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // foreach
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// Save
|
|
|
|
return $xml->asXML($configFilePath);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* search and return Config File Path
|
|
|
|
* @return NULL|string Config File Path
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
protected function searchConfigFilePath() { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
$configFilePath = null;
|
|
|
|
|
2016-10-25 07:56:49 +00:00
|
|
|
if($configDir = Settings::getConfigDir()) {
|
2012-04-16 19:37:46 +00:00
|
|
|
if (file_exists($configDir."/settings.xml"))
|
|
|
|
return $configDir."/settings.xml";
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
return $configFilePath;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns absolute path for configuration files respecting links
|
|
|
|
*
|
2014-01-10 06:53:35 +00:00
|
|
|
* This function checks all parent directories of the current script
|
|
|
|
* for a configuration directory named 'conf'. It doesn't check
|
|
|
|
* if that directory contains a configuration file.
|
|
|
|
* If none was found a final try will be made checking /etc/seeddms
|
2011-07-21 06:53:35 +00:00
|
|
|
* @return NULL|string config directory
|
|
|
|
*/
|
2016-10-25 07:56:49 +00:00
|
|
|
static function getConfigDir() { /* {{{ */
|
2021-08-04 12:19:11 +00:00
|
|
|
if(defined("SEEDDMS_CONFIG_FILE"))
|
|
|
|
return dirname(SEEDDMS_CONFIG_FILE);
|
|
|
|
elseif(getenv("SEEDDMS_CONFIG_FILE"))
|
|
|
|
return dirname(getenv("SEEDDMS_CONFIG_FILE"));
|
2011-07-21 06:53:35 +00:00
|
|
|
$_tmp = dirname($_SERVER['SCRIPT_FILENAME']);
|
2015-03-10 20:23:33 +00:00
|
|
|
$_arr = preg_split('/\//', rtrim(str_replace('\\', '/', $_tmp)));
|
2012-04-16 19:37:46 +00:00
|
|
|
$configDir = null;
|
2014-01-10 06:53:35 +00:00
|
|
|
/* new code starts here */
|
|
|
|
while($_arr && !$configDir) {
|
|
|
|
if(file_exists(implode('/', $_arr)."/conf/"))
|
|
|
|
$configDir = implode('/', $_arr)."/conf/";
|
|
|
|
else
|
|
|
|
array_pop($_arr);
|
|
|
|
}
|
|
|
|
if(!$configDir) {
|
|
|
|
if(file_exists('/etc/seeddms'))
|
|
|
|
$configDir = '/etc/seeddms';
|
|
|
|
}
|
|
|
|
return $configDir;
|
|
|
|
/* new code ends here */
|
|
|
|
|
2012-04-16 19:37:46 +00:00
|
|
|
if(file_exists(implode('/', $_arr)."/conf/"))
|
|
|
|
$configDir = implode('/', $_arr)."/conf/";
|
|
|
|
else {
|
|
|
|
array_pop($_arr);
|
|
|
|
if(file_exists(implode('/', $_arr)."/conf/")) {
|
|
|
|
$configDir = implode('/', $_arr)."/conf/";
|
|
|
|
} else {
|
2013-02-14 11:10:53 +00:00
|
|
|
if(file_exists('/etc/seeddms'))
|
|
|
|
$configDir = '/etc/seeddms';
|
2012-04-16 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
return $configDir;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get URL from current page
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
protected function curPageURL() { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
$pageURL = 'http';
|
|
|
|
|
|
|
|
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
|
|
|
|
$pageURL .= "s";
|
|
|
|
}
|
|
|
|
|
|
|
|
$pageURL .= "://";
|
|
|
|
|
|
|
|
if ($_SERVER["SERVER_PORT"] != "80") {
|
|
|
|
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
|
|
|
} else {
|
|
|
|
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $pageURL;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Searches a file in the include_path
|
|
|
|
*
|
|
|
|
* @param string $file name of file to search
|
|
|
|
* @return string path where file was found
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
protected function findInIncPath($file) { /* {{{ */
|
2013-10-21 10:14:37 +00:00
|
|
|
$incarr = explode(PATH_SEPARATOR, ini_get('include_path'));
|
2011-07-21 06:53:35 +00:00
|
|
|
$found = '';
|
|
|
|
foreach($incarr as $path) {
|
2013-10-21 10:14:37 +00:00
|
|
|
if(file_exists($path.DIRECTORY_SEPARATOR.$file)) {
|
2011-07-21 06:53:35 +00:00
|
|
|
$found = $path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $found;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check parameters
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
public function check($minversion) { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
// suggestion rootdir
|
|
|
|
if (file_exists("../inc/inc.Settings.php"))
|
|
|
|
$rootDir = realpath ("../inc/inc.Settings.php");
|
|
|
|
else if (file_exists("inc/inc.Settings.php"))
|
|
|
|
$rootDir = realpath ("inc/inc.Settings.php");
|
|
|
|
else {
|
|
|
|
echo "Fatal error : inc/inc.Settings.php not found";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
$rootDir = str_replace ("\\", "/" , $rootDir);
|
|
|
|
$rootDir = str_replace ("inc/inc.Settings.php", "" , $rootDir);
|
|
|
|
|
|
|
|
// result
|
|
|
|
$result = array();
|
|
|
|
|
|
|
|
// $this->_rootDir
|
|
|
|
if (!file_exists($this->_rootDir ."inc/inc.Settings.php")) {
|
|
|
|
$result["rootDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_rootDir,
|
|
|
|
"suggestionvalue" => $rootDir
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
// $this->_coreDir
|
2021-07-23 10:07:30 +00:00
|
|
|
/*
|
2011-07-21 06:53:35 +00:00
|
|
|
if($this->_coreDir) {
|
|
|
|
if (!file_exists($this->_coreDir ."Core.php")) {
|
|
|
|
$result["coreDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_coreDir,
|
|
|
|
"suggestionvalue" => $rootDir
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
2013-02-14 11:10:53 +00:00
|
|
|
$found = Settings::findInIncPath('SeedDMS/Core.php');
|
2011-07-21 06:53:35 +00:00
|
|
|
if(!$found) {
|
|
|
|
$result["coreDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_coreDir,
|
|
|
|
"suggestionvalue" => $rootDir
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2021-07-23 10:07:30 +00:00
|
|
|
*/
|
2011-07-21 06:53:35 +00:00
|
|
|
// $this->_httpRoot
|
|
|
|
$tmp = $this->curPageURL();
|
|
|
|
$tmp = str_replace ("install.php", "" , $tmp);
|
|
|
|
if (strpos($tmp, $this->_httpRoot) === false) {
|
|
|
|
$result["httpRoot"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_httpRoot,
|
|
|
|
"suggestionvalue" => $tmp
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// $this->_contentDir
|
|
|
|
if (!file_exists($this->_contentDir)) {
|
|
|
|
if (file_exists($rootDir.'data/')) {
|
|
|
|
$result["contentDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_contentDir,
|
|
|
|
"suggestionvalue" => $rootDir . 'data/'
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$result["contentDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_contentDir,
|
|
|
|
"suggestion" => "createdirectory"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$errorMsgPerms = null;
|
|
|
|
|
|
|
|
// perms
|
2012-01-17 08:31:45 +00:00
|
|
|
if (!@mkdir($this->_contentDir.'/_CHECK_TEST_')) {
|
2011-07-21 06:53:35 +00:00
|
|
|
$errorMsgPerms .= "Create folder - ";
|
2012-01-17 08:31:45 +00:00
|
|
|
} else {
|
|
|
|
if (is_bool(file_put_contents($this->_contentDir.'/_CHECK_TEST_/_CHECK_TEST_', ""))) {
|
|
|
|
$errorMsgPerms .= "Create file - ";
|
|
|
|
} else {
|
|
|
|
if (!unlink ($this->_contentDir.'/_CHECK_TEST_/_CHECK_TEST_')) {
|
|
|
|
$errorMsgPerms .= "Delete file - ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!rmdir($this->_contentDir.'/_CHECK_TEST_')) {
|
|
|
|
$errorMsgPerms .= "Delete folder";
|
|
|
|
}
|
2011-07-21 06:53:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_null($errorMsgPerms)) {
|
|
|
|
$result["contentDir"] = array(
|
|
|
|
"status" => "perms",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_contentDir,
|
|
|
|
"systemerror" => $errorMsgPerms
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// $this->_stagingDir
|
|
|
|
if (!file_exists($this->_stagingDir)) {
|
|
|
|
$result["stagingDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_stagingDir,
|
|
|
|
"suggestionvalue" => $this->_contentDir . 'staging/'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// $this->_luceneDir
|
|
|
|
if (!file_exists($this->_luceneDir)) {
|
|
|
|
$result["luceneDir"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_luceneDir,
|
|
|
|
"suggestionvalue" => $this->_contentDir . 'lucene/'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$bCheckDB = true;
|
2013-02-04 09:19:50 +00:00
|
|
|
// $this->_ADOdbPath
|
|
|
|
/* not needed anymore after switch to PDO
|
2011-07-21 06:53:35 +00:00
|
|
|
if($this->_ADOdbPath) {
|
2012-08-28 06:34:21 +00:00
|
|
|
if (!file_exists($this->_ADOdbPath."/adodb/adodb.inc.php")) {
|
2011-07-21 06:53:35 +00:00
|
|
|
$bCheckDB = false;
|
|
|
|
if (file_exists($rootDir."adodb/adodb.inc.php")) {
|
|
|
|
$result["ADOdbPath"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_ADOdbPath,
|
|
|
|
"suggestionvalue" => $rootDir
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$result["ADOdbPath"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_ADOdbPath,
|
|
|
|
"suggestion" => "installADOdb"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$found = Settings::findInIncPath('adodb/adodb.inc.php');
|
|
|
|
if(!$found) {
|
|
|
|
$bCheckDB = false;
|
|
|
|
$result["ADOdbPath"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"currentvalue" => $this->_ADOdbPath,
|
|
|
|
"suggestion" => "installADOdb"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2013-02-04 09:19:50 +00:00
|
|
|
*/
|
2011-07-21 06:53:35 +00:00
|
|
|
|
|
|
|
// database
|
|
|
|
if ($bCheckDB) {
|
|
|
|
try {
|
2013-02-04 09:19:50 +00:00
|
|
|
$dsn = "";
|
|
|
|
switch($this->_dbDriver) {
|
|
|
|
case 'mysql':
|
|
|
|
case 'mysqli':
|
|
|
|
case 'mysqlnd':
|
2017-02-28 06:39:39 +00:00
|
|
|
case 'pgsql':
|
2014-11-13 12:29:32 +00:00
|
|
|
$tmp = explode(":", $this->_dbHostname);
|
|
|
|
$dsn = $this->_dbDriver.":dbname=".$this->_dbDatabase.";host=".$tmp[0];
|
|
|
|
if(!empty($tmp[1]))
|
|
|
|
$dsn .= ";port=".$tmp[1];
|
2013-02-04 09:19:50 +00:00
|
|
|
break;
|
|
|
|
case 'sqlite':
|
|
|
|
$dsn = $this->_dbDriver.":".$this->_dbDatabase;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$result["dbDriver"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2013-02-04 09:19:50 +00:00
|
|
|
"currentvalue" => $this->_dbDriver,
|
2017-02-28 06:39:39 +00:00
|
|
|
"suggestionvalue" => "mysql|sqlite|pgsql"
|
2013-02-04 09:19:50 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
if($dsn) {
|
|
|
|
$connTmp = new PDO($dsn, $this->_dbUser, $this->_dbPass);
|
|
|
|
/* Check if there wasn't a previous error while searching for
|
2013-02-14 11:10:53 +00:00
|
|
|
* SeedDMS_Core.
|
2013-02-04 09:19:50 +00:00
|
|
|
*/
|
|
|
|
if(!isset($result["coreDir"])) {
|
2013-02-14 11:10:53 +00:00
|
|
|
/* Instanciate SeedDMS_Core to check version */
|
2013-02-04 09:19:50 +00:00
|
|
|
if(!empty($this->_coreDir))
|
|
|
|
require_once($this->_coreDir.'/Core.php');
|
|
|
|
else
|
2021-07-23 10:07:30 +00:00
|
|
|
require_once($this->_rootDir.'../pear/SeedDMS/Core.php');
|
2013-02-14 11:10:53 +00:00
|
|
|
$tmpcore = new SeedDMS_Core_DMS(null, $this->_contentDir);
|
|
|
|
$db = new SeedDMS_Core_DatabaseAccess($this->_dbDriver, $this->_dbHostname, $this->_dbUser, $this->_dbPass, $this->_dbDatabase);
|
2013-02-04 09:19:50 +00:00
|
|
|
if(!$db->connect()) {
|
|
|
|
$result["dbDatabase"] = array(
|
|
|
|
"status" => "error",
|
|
|
|
"type" => "error",
|
|
|
|
"currentvalue" => '[host, user, database] -> [' . $this->_dbHostname . ',' . $this->_dbUser . ',' . $this->_dbDatabase .']',
|
|
|
|
"systemerror" => $connTmp->ErrorMsg()
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
/*
|
2013-02-14 11:10:53 +00:00
|
|
|
$dms = new SeedDMS_Core_DMS($db, $this->_contentDir.$this->_contentOffsetDir);
|
2013-02-04 09:19:50 +00:00
|
|
|
|
|
|
|
if(!$dms->checkVersion()) {
|
|
|
|
$result["dbVersion"] = array(
|
2011-10-26 07:30:51 +00:00
|
|
|
"status" => "error",
|
|
|
|
"type" => "error",
|
2013-02-04 09:19:50 +00:00
|
|
|
"currentvalue" => $dms->version,
|
|
|
|
"suggestion" => 'updateDatabase'
|
2011-10-26 07:30:51 +00:00
|
|
|
);
|
|
|
|
}
|
2013-02-04 09:19:50 +00:00
|
|
|
*/
|
2011-10-26 07:30:51 +00:00
|
|
|
}
|
2013-02-04 09:19:50 +00:00
|
|
|
$connTmp = null;
|
2011-07-21 06:53:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch(Exception $e) {
|
|
|
|
$result["dbDatabase"] = array(
|
|
|
|
"status" => "error",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2013-02-04 09:19:50 +00:00
|
|
|
"currentvalue" => '[host, user, database] -> [' . $this->_dbHostname . ',' . $this->_dbUser . ',' . $this->_dbDatabase .']',
|
2011-07-21 06:53:35 +00:00
|
|
|
"systemerror" => $e->getMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check system configuration
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*
|
|
|
|
*/
|
2019-12-20 16:18:08 +00:00
|
|
|
public function checkSystem() { /* {{{ */
|
2011-07-21 06:53:35 +00:00
|
|
|
// result
|
|
|
|
$result = array();
|
|
|
|
|
|
|
|
// Check Apache configuration
|
|
|
|
if (function_exists("apache_get_version")) {
|
|
|
|
$loaded_extensions = apache_get_modules();
|
|
|
|
if (!in_array("mod_rewrite", $loaded_extensions)) {
|
|
|
|
$result["apache_mod_rewrite"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"suggestion" => "activate_module"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-13 13:10:09 +00:00
|
|
|
// Check PHP version
|
2021-07-23 10:07:30 +00:00
|
|
|
if (version_compare(PHP_VERSION, '7.2.5') < 0) {
|
2013-08-13 13:10:09 +00:00
|
|
|
$result["php_version"] = array(
|
|
|
|
"status" => "versiontolow",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "upgrade_php"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// Check PHP configuration
|
|
|
|
$loaded_extensions = get_loaded_extensions();
|
2021-07-23 10:07:30 +00:00
|
|
|
// xml
|
|
|
|
if (!in_array("xml", $loaded_extensions)) {
|
|
|
|
$result["php_xml"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// gd2
|
|
|
|
if (!in_array("gd", $loaded_extensions)) {
|
|
|
|
$result["php_gd2"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// mbstring
|
|
|
|
if (!in_array("mbstring", $loaded_extensions)) {
|
|
|
|
$result["php_mbstring"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2011-07-21 06:53:35 +00:00
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-07-23 10:07:30 +00:00
|
|
|
// json
|
|
|
|
if (!in_array("json", $loaded_extensions)) {
|
|
|
|
$result["php_json"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// zip
|
|
|
|
if (!in_array("zip", $loaded_extensions)) {
|
|
|
|
$result["php_zip"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// fileinfo
|
|
|
|
if (!in_array("fileinfo", $loaded_extensions)) {
|
|
|
|
$result["php_fileinfo"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// sqlite3
|
|
|
|
if (!in_array("sqlite3", $loaded_extensions)) {
|
|
|
|
$result["php_sqlite3"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
// database
|
2013-02-04 09:19:50 +00:00
|
|
|
if (!in_array('pdo_'.$this->_dbDriver, $loaded_extensions)) {
|
2011-07-21 06:53:35 +00:00
|
|
|
$result["php_dbDriver"] = array(
|
|
|
|
"status" => "notfound",
|
2011-10-26 07:30:51 +00:00
|
|
|
"type" => "error",
|
2013-02-04 09:19:50 +00:00
|
|
|
"currentvalue" => 'pdo_'.$this->_dbDriver,
|
2011-07-21 06:53:35 +00:00
|
|
|
"suggestion" => "activate_php_extension"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2011-10-26 07:30:51 +00:00
|
|
|
// Check for Log.php
|
2019-06-24 10:36:55 +00:00
|
|
|
// Do not check for Log anymore, because it is in the vendor directory
|
|
|
|
/*
|
2011-10-26 07:30:51 +00:00
|
|
|
if (!Settings::findInIncPath('Log.php')) {
|
|
|
|
$result["pear_log"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "error",
|
|
|
|
"suggestion" => "install_pear_package_log"
|
|
|
|
);
|
|
|
|
}
|
2019-06-24 10:36:55 +00:00
|
|
|
*/
|
2011-10-26 07:30:51 +00:00
|
|
|
|
|
|
|
// Check for HTTP/WebDAV/Server.php
|
2021-07-23 10:07:30 +00:00
|
|
|
/*
|
2011-10-26 07:30:51 +00:00
|
|
|
if (!Settings::findInIncPath('HTTP/WebDAV/Server.php')) {
|
|
|
|
$result["pear_webdav"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "warning",
|
|
|
|
"suggestion" => "install_pear_package_webdav"
|
|
|
|
);
|
|
|
|
}
|
2021-07-23 10:07:30 +00:00
|
|
|
*/
|
2011-07-21 06:53:35 +00:00
|
|
|
|
2011-10-26 07:30:51 +00:00
|
|
|
// Check for Zend/Search/Lucene.php
|
2021-07-23 10:07:30 +00:00
|
|
|
/*
|
2011-10-26 07:30:51 +00:00
|
|
|
if (!Settings::findInIncPath('Zend/Search/Lucene.php')) {
|
|
|
|
$result["zendframework"] = array(
|
|
|
|
"status" => "notfound",
|
|
|
|
"type" => "warning",
|
|
|
|
"suggestion" => "install_zendframework"
|
|
|
|
);
|
|
|
|
}
|
2021-07-23 10:07:30 +00:00
|
|
|
*/
|
2011-07-21 06:53:35 +00:00
|
|
|
return $result;
|
|
|
|
} /* }}} */
|
|
|
|
|
2019-12-20 16:18:08 +00:00
|
|
|
/**
|
|
|
|
* Check if extension is disabled
|
|
|
|
*
|
|
|
|
* @param string $extname name of extension
|
|
|
|
* @return true if extension is disabled
|
|
|
|
*/
|
|
|
|
public function extensionIsDisabled($extname) { /* {{{ */
|
|
|
|
if(array_key_exists($extname, $this->_extensions))
|
|
|
|
return $this->_extensions[$extname]['__disable__'];
|
|
|
|
|
|
|
|
return false;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set extension enabled
|
|
|
|
*
|
|
|
|
* @param string $extname name of extension
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public function enableExtension($extname) { /* {{{ */
|
|
|
|
if(!array_key_exists($extname, $this->_extensions))
|
|
|
|
$this->_extensions[$extname] = array();
|
|
|
|
$this->_extensions[$extname]['__disable__'] = false;
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set extension enabled
|
|
|
|
*
|
|
|
|
* @param string $extname name of extension
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public function disableExtension($extname) { /* {{{ */
|
|
|
|
if(!array_key_exists($extname, $this->_extensions))
|
|
|
|
$this->_extensions[$extname] = array();
|
|
|
|
$this->_extensions[$extname]['__disable__'] = true;
|
|
|
|
} /* }}} */
|
|
|
|
|
2011-07-21 06:53:35 +00:00
|
|
|
} /* }}} */
|
|
|
|
|