diff options
author | Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> | 2021-07-25 18:57:11 +0300 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-09-06 17:39:11 +0300 |
commit | 961f8958c0df8e60ca9fda88d5f46526534eecd9 (patch) | |
tree | 6bd65beefbd7012fd211fc3f491b8b567b8a822f /lib | |
parent | 33a0b75c83a1c56fa84b98d3a07a26b5c4932b65 (diff) |
Let users choose a share_folder
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/Manager.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 7047c32e339..da8de81208e 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -44,6 +44,7 @@ namespace OC\Share20; use OC\Cache\CappedMemoryCache; use OC\Files\Mount\MoveableMount; use OC\Share20\Exception\ProviderException; +use OCA\Files_Sharing\AppInfo\Application; use OCA\Files_Sharing\ISharedStorage; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; @@ -788,7 +789,15 @@ class Manager implements IManager { } // Generate the target - $target = $this->config->getSystemValue('share_folder', '/') . '/' . $share->getNode()->getName(); + $defaultShareFolder = $this->config->getSystemValue('share_folder', '/'); + $allowCustomShareFolder = $this->config->getSystemValueBool('sharing.allow_custom_share_folder', true); + if ($allowCustomShareFolder) { + $shareFolder = $this->config->getUserValue($share->getSharedWith(), Application::APP_ID, 'share_folder', $defaultShareFolder); + } else { + $shareFolder = $defaultShareFolder; + } + + $target = $shareFolder . '/' . $share->getNode()->getName(); $target = \OC\Files\Filesystem::normalizePath($target); $share->setTarget($target); |