diff options
-rw-r--r-- | apps/files_external/js/settings.js | 4 | ||||
-rw-r--r-- | apps/files_external/lib/storageconfig.php | 1 | ||||
-rw-r--r-- | apps/files_external/migration/storagemigrator.php | 6 | ||||
-rw-r--r-- | apps/files_external/tests/js/settingsSpec.js | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 26df203091e..96b56d221c5 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -23,7 +23,7 @@ var MOUNT_OPTIONS_DROPDOWN_TEMPLATE = ' <label for="mountOptionsPreviews">{{t "files_external" "Enable previews"}}</label>' + ' </div>' + ' <div class="optionRow">' + - ' <input id="mountOptionsSharing" name="enable_sharing" type="checkbox" value="true" checked="checked"/>' + + ' <input id="mountOptionsSharing" name="enable_sharing" type="checkbox" value="true"/>' + ' <label for="mountOptionsSharing">{{t "files_external" "Enable sharing"}}</label>' + ' </div>' + ' <div class="optionRow">' + @@ -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 6f44b25a2e6..42c515f4671 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 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(); diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js index 6f5bb2a8e3e..2a7afd6c2fa 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 }); }); |