diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-12-06 11:18:59 +0100 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-12-15 09:15:31 +0100 |
commit | ea302975526ba8fcb5abcca76daa6038439d053e (patch) | |
tree | f00714de6e983897719b98cb3c56ed5476156823 /apps/files_external/templates | |
parent | a47da9722dfaec8d83e9c8543ed0c31138a909da (diff) | |
download | nextcloud-server-ea302975526ba8fcb5abcca76daa6038439d053e.tar.gz nextcloud-server-ea302975526ba8fcb5abcca76daa6038439d053e.zip |
Add option to disallow creation of local storages
Introduce a new config option to prevent web UI admins to create
or edit external storages of type "local".
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_external/templates')
-rw-r--r-- | apps/files_external/templates/settings.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 675cce5da6e..2b5b1a1bcd2 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -100,7 +100,10 @@ $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || <h2><?php p($l->t('No external storage configured or you don\'t have the permission to configure them')); ?></h2> </div> -<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> +<?php + $canCreateNewLocalStorage = \OC::$server->getConfig()->getSystemValue('files_external_allow_create_new_local', true); +?> +<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" data-can-create-local="<?php echo $canCreateNewLocalStorage?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> <h2 class="inlineblock" data-anchor-name="external-storage"><?php p($l->t('External storage')); ?></h2> <a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation'));?>" href="<?php p(link_to_docs('admin-external-storage')); ?>"></a> <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow users to mount their own external storage services.')); ?></p> @@ -155,7 +158,7 @@ $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || }); ?> <?php foreach ($sortedBackends as $backend): ?> - <?php if ($backend->getDeprecateTo()) { + <?php if ($backend->getDeprecateTo() || (!$canCreateNewLocalStorage && $backend->getIdentifier() == "local")) { continue; } // ignore deprecated backends?> <option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option> |