Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r--lib/appconfig.php157
1 files changed, 157 insertions, 0 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php
index 52a6812..7d37ecf 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -110,6 +110,41 @@ class AppConfig {
private $_sameTab = "sameTab";
/**
+ * The config key for the chat display setting
+ *
+ * @var string
+ */
+ private $_customizationChat = "customizationChat";
+
+ /**
+ * The config key for display the header more compact setting
+ *
+ * @var string
+ */
+ private $_customizationCompactHeader = "customizationCompactHeader";
+
+ /**
+ * The config key for the feedback display setting
+ *
+ * @var string
+ */
+ private $_customizationFeedback = "customizationFeedback";
+
+ /**
+ * The config key for the help display setting
+ *
+ * @var string
+ */
+ private $_customizationHelp = "customizationHelp";
+
+ /**
+ * The config key for the no tabs setting
+ *
+ * @var string
+ */
+ private $_customizationToolbarNoTabs = "customizationToolbarNoTabs";
+
+ /**
* The config key for the setting limit groups
*
* @var string
@@ -431,6 +466,106 @@ class AppConfig {
}
/**
+ * Save chat display setting
+ *
+ * @param bool $value - display chat
+ */
+ public function SetCustomizationChat($value) {
+ $this->logger->info("Set chat display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationChat, json_encode($value));
+ }
+
+ /**
+ * Get chat display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationChat() {
+ return $this->config->getAppValue($this->appName, $this->_customizationChat, "true") === "true";
+ }
+
+ /**
+ * Save compact header setting
+ *
+ * @param bool $value - display compact header
+ */
+ public function SetCustomizationCompactHeader($value) {
+ $this->logger->info("Set compact header display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationCompactHeader, json_encode($value));
+ }
+
+ /**
+ * Get compact header setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationCompactHeader() {
+ return $this->config->getAppValue($this->appName, $this->_customizationCompactHeader, "true") === "true";
+ }
+
+ /**
+ * Save feedback display setting
+ *
+ * @param bool $value - display feedback
+ */
+ public function SetCustomizationFeedback($value) {
+ $this->logger->info("Set feedback display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationFeedback, json_encode($value));
+ }
+
+ /**
+ * Get feedback display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationFeedback() {
+ return $this->config->getAppValue($this->appName, $this->_customizationFeedback, "true") === "true";
+ }
+
+ /**
+ * Save help display setting
+ *
+ * @param bool $value - display help
+ */
+ public function SetCustomizationHelp($value) {
+ $this->logger->info("Set help display: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationHelp, json_encode($value));
+ }
+
+ /**
+ * Get help display setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationHelp() {
+ return $this->config->getAppValue($this->appName, $this->_customizationHelp, "true") === "true";
+ }
+
+ /**
+ * Save without tabs setting
+ *
+ * @param bool $value - without tabs
+ */
+ public function SetCustomizationToolbarNoTabs($value) {
+ $this->logger->info("Set without tabs: " . json_encode($value), array("app" => $this->appName));
+
+ $this->config->setAppValue($this->appName, $this->_customizationToolbarNoTabs, json_encode($value));
+ }
+
+ /**
+ * Get without tabs setting
+ *
+ * @return bool
+ */
+ public function GetCustomizationToolbarNoTabs() {
+ return $this->config->getAppValue($this->appName, $this->_customizationToolbarNoTabs, "true") === "true";
+ }
+
+ /**
* Save the list of groups
*
* @param array $groups - the list of groups
@@ -539,6 +674,28 @@ class AppConfig {
}
/**
+ * Checking encryption enabled
+ *
+ * @return string|bool
+ */
+ public function checkEncryptionModule() {
+ if (!\OC::$server->getAppManager()->isInstalled("encryption")) {
+ return false;
+ }
+ if (!\OC::$server->getEncryptionManager()->isEnabled()) {
+ return false;
+ }
+
+ $crypt = new \OCA\Encryption\Crypto\Crypt(\OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getL10N("encryption"));
+ $util = new \OCA\Encryption\Util(new \OC\Files\View(), $crypt, \OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getUserManager());
+ if ($util->isMasterKeyEnabled()) {
+ return "master";
+ }
+
+ return true;
+ }
+
+ /**
* Get supported formats
*
* @return array