summaryrefslogtreecommitdiffstats
path: root/apps/files_external/migration
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-23 15:16:13 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-24 13:58:21 +0100
commit4829a2d421902e0edede30a71c96a86c576a17b1 (patch)
tree4fe9dc440688ac6c2160850e7d8f0d46dc77daf4 /apps/files_external/migration
parentfae6643e6dd4bc308170e0ab45886f110f60a639 (diff)
downloadnextcloud-server-4829a2d421902e0edede30a71c96a86c576a17b1.tar.gz
nextcloud-server-4829a2d421902e0edede30a71c96a86c576a17b1.zip
Disable sharing by default for external storage mounts
This is for newly created mount points. Migrated mount points will have sharing enabled as before.
Diffstat (limited to 'apps/files_external/migration')
-rw-r--r--apps/files_external/migration/storagemigrator.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/migration/storagemigrator.php b/apps/files_external/migration/storagemigrator.php
index ba81810a4fd..832807feb93 100644
--- a/apps/files_external/migration/storagemigrator.php
+++ b/apps/files_external/migration/storagemigrator.php
@@ -100,6 +100,12 @@ class StorageMigrator {
$this->connection->beginTransaction();
try {
foreach ($existingStorage as $storage) {
+ $mountOptions = $storage->getMountOptions();
+ if (!empty($mountOptions) && !isset($mountOptions['enable_sharing'])) {
+ // existing mounts must have sharing enabled by default to avoid surprises
+ $mountOptions['enable_sharing'] = true;
+ $storage->setMountOptions($mountOptions);
+ }
$storageService->addStorage($storage);
}
$this->connection->commit();