Skip to content

Commit 147a60e

Browse files
pboguslawskinextcloud-command
authored andcommitted
feat(files): added parameter to disable web UI integration with local client
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 4eee160 commit 147a60e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

apps/files/lib/Controller/ViewController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/**
44
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
55
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
6+
* SPDX-FileCopyrightText: 2025 Informatyka Boguslawski sp. z o.o. sp.k.
67
* SPDX-License-Identifier: AGPL-3.0-only
78
*/
89
namespace OCA\Files\Controller;
@@ -197,6 +198,7 @@ public function index($dir = '', $view = '', $fileid = null) {
197198
$this->initialState->provideInitialState('templates_enabled', ($this->config->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton') !== '') || ($this->config->getSystemValueString('templatedirectory', \OC::$SERVERROOT . '/core/skeleton/Templates') !== ''));
198199
$this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false);
199200
$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());
201+
$this->initialState->provideInitialState('integration_local_client_enabled', ($this->config->getSystemValueBool('web_ui_integration_local_client.enabled', true)));
200202

201203
$isTwoFactorEnabled = false;
202204
foreach ($this->twoFactorRegistry->getProviderStates($user) as $providerId => $providerState) {

apps/files/src/actions/openLocallyAction.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-FileCopyrightText: 2025 Informatyka Boguslawski sp. z o.o. sp.k.
34
* SPDX-License-Identifier: AGPL-3.0-or-later
45
*/
56
import { encodePath } from '@nextcloud/paths'
@@ -12,6 +13,9 @@ import axios from '@nextcloud/axios'
1213
import LaptopSvg from '@mdi/svg/svg/laptop.svg?raw'
1314
import IconWeb from '@mdi/svg/svg/web.svg?raw'
1415
import { isPublicShare } from '@nextcloud/sharing/public'
16+
import { loadState } from '@nextcloud/initial-state'
17+
18+
const integrationLocalClientEnabled = loadState('files', 'integration_local_client_enabled', true)
1519

1620
export const action = new FileAction({
1721
id: 'edit-locally',
@@ -20,6 +24,11 @@ export const action = new FileAction({
2024

2125
// Only works on single files
2226
enabled(nodes: Node[]) {
27+
// Only works when enabled.
28+
if (!integrationLocalClientEnabled) {
29+
return false
30+
}
31+
2332
// Only works on single node
2433
if (nodes.length !== 1) {
2534
return false

config/config.sample.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/**
44
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
55
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
6+
* SPDX-FileCopyrightText: 2025 Informatyka Boguslawski sp. z o.o. sp.k.
67
* SPDX-License-Identifier: AGPL-3.0-only
78
*/
89

@@ -2740,4 +2741,11 @@
27402741
* Defaults to ``true``
27412742
*/
27422743
'enable_lazy_objects' => true,
2744+
2745+
/**
2746+
* Enables web UI integration with local client.
2747+
*
2748+
* Defaults to ``true``
2749+
*/
2750+
'web_ui_integration_local_client.enabled' => true,
27432751
];

0 commit comments

Comments
 (0)