Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>2021-07-25 18:57:11 +0300
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-09-06 17:39:11 +0300
commit961f8958c0df8e60ca9fda88d5f46526534eecd9 (patch)
tree6bd65beefbd7012fd211fc3f491b8b567b8a822f /lib
parent33a0b75c83a1c56fa84b98d3a07a26b5c4932b65 (diff)
Let users choose a share_folder
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php11
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);