diff options
author | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2019-09-11 12:45:37 +0300 |
---|---|---|
committer | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2019-09-11 12:45:37 +0300 |
commit | 5e2386f5d12265685f9b2deae35961f5537278c4 (patch) | |
tree | 6227ce733fef7b566d82e0dd6b4bb0a6e20b6cf2 /controller/settingscontroller.php | |
parent | 60e1bbd597dbaa53f69112f9eedc74623ca00d7d (diff) | |
parent | eb25b05a73603e00b81cc61791df6006f704f701 (diff) |
Merge remote-tracking branch 'remotes/origin/develop' into feature/watermark
# Conflicts:
# controller/editorcontroller.php
# css/settings.css
# js/settings.js
# l10n/de.js
# l10n/de.json
# l10n/de_DE.js
# l10n/de_DE.json
# l10n/es.js
# l10n/es.json
# l10n/pt_BR.js
# l10n/pt_BR.json
# l10n/ru.js
# l10n/ru.json
# l10n/sv.js
# l10n/sv.json
# templates/settings.php
Diffstat (limited to 'controller/settingscontroller.php')
-rw-r--r-- | controller/settingscontroller.php | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 5be905c..cc95930 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -13,7 +13,7 @@ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * - * You can contact Ascensio System SIA at 17-2 Elijas street, Riga, Latvia, EU, LV-1021. + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions of the Program * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3. @@ -114,10 +114,11 @@ class SettingsController extends Controller { */ public function index() { $data = [ - "documentserver" => $this->config->GetDocumentServerUrl(), + "documentserver" => $this->config->GetDocumentServerUrl(true), "documentserverInternal" => $this->config->GetDocumentServerInternalUrl(true), "storageUrl" => $this->config->GetStorageUrl(), - "secret" => $this->config->GetDocumentServerSecret(), + "secret" => $this->config->GetDocumentServerSecret(true), + "demo" => $this->config->GetDemoData(), "currentServer" => $this->urlGenerator->getAbsoluteURL("/"), "formats" => $this->config->FormatsSetting(), "sameTab" => $this->config->GetSameTab(), @@ -141,31 +142,39 @@ class SettingsController extends Controller { * @param string $documentserverInternal - document service address available from Nextcloud * @param string $storageUrl - Nextcloud address available from document server * @param string $secret - secret key for signature + * @param bool $demo - use demo server * * @return array */ public function SaveAddress($documentserver, $documentserverInternal, $storageUrl, - $secret + $secret, + $demo ) { - $this->config->SetDocumentServerUrl($documentserver); - $this->config->SetDocumentServerInternalUrl($documentserverInternal); + if (!$this->config->SelectDemo($demo === true)) { + $error = $this->trans->t("The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server."); + } + if ($demo !== true) { + $this->config->SetDocumentServerUrl($documentserver); + $this->config->SetDocumentServerInternalUrl($documentserverInternal); + $this->config->SetDocumentServerSecret($secret); + } $this->config->SetStorageUrl($storageUrl); - $this->config->SetDocumentServerSecret($secret); - $documentserver = $this->config->GetDocumentServerUrl(); - $error = NULL; - if (!empty($documentserver)) { - $error = $this->checkDocServiceUrl(); - $this->config->SetSettingsError($error); + if (empty($error)) { + $documentserver = $this->config->GetDocumentServerUrl(); + if (!empty($documentserver)) { + $error = $this->checkDocServiceUrl(); + $this->config->SetSettingsError($error); + } } return [ - "documentserver" => $this->config->GetDocumentServerUrl(), + "documentserver" => $this->config->GetDocumentServerUrl(true), "documentserverInternal" => $this->config->GetDocumentServerInternalUrl(true), "storageUrl" => $this->config->GetStorageUrl(), - "secret" => $this->config->GetDocumentServerSecret(), + "secret" => $this->config->GetDocumentServerSecret(true), "error" => $error ]; } |