diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 26df203091..96b56d221c 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -23,7 +23,7 @@ var MOUNT_OPTIONS_DROPDOWN_TEMPLATE = ' ' + ' ' + '
' + - ' ' + + ' ' + ' ' + '
' + '
' + @@ -888,7 +888,7 @@ MountConfigListView.prototype = _.extend({ $tr.find('input.mountOptions').val(JSON.stringify({ 'encrypt': true, 'previews': true, - 'enable_sharing': true, + 'enable_sharing': false, 'filesystem_check_changes': 1 })); } diff --git a/apps/files_external/lib/storageconfig.php b/apps/files_external/lib/storageconfig.php index 6f44b25a2e..42c515f467 100644 --- a/apps/files_external/lib/storageconfig.php +++ b/apps/files_external/lib/storageconfig.php @@ -126,6 +126,7 @@ class StorageConfig implements \JsonSerializable { */ public function __construct($id = null) { $this->id = $id; + $this->mountOptions['enable_sharing'] = false; } /** diff --git a/apps/files_external/migration/storagemigrator.php b/apps/files_external/migration/storagemigrator.php index ba81810a4f..832807feb9 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(); diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js index 6f5bb2a8e3..2a7afd6c2f 100644 --- a/apps/files_external/tests/js/settingsSpec.js +++ b/apps/files_external/tests/js/settingsSpec.js @@ -363,7 +363,7 @@ describe('OCA.External.Settings tests', function() { expect(JSON.parse($tr.find('input.mountOptions').val())).toEqual({ encrypt: true, previews: true, - enable_sharing: true, + enable_sharing: false, filesystem_check_changes: 0 }); });