aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller/SettingsController.php
diff options
context:
space:
mode:
authorHinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>2021-07-25 17:57:11 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-09-06 16:39:11 +0200
commit961f8958c0df8e60ca9fda88d5f46526534eecd9 (patch)
tree6bd65beefbd7012fd211fc3f491b8b567b8a822f /apps/files_sharing/lib/Controller/SettingsController.php
parent33a0b75c83a1c56fa84b98d3a07a26b5c4932b65 (diff)
downloadnextcloud-server-961f8958c0df8e60ca9fda88d5f46526534eecd9.tar.gz
nextcloud-server-961f8958c0df8e60ca9fda88d5f46526534eecd9.zip
Let users choose a share_folder
Diffstat (limited to 'apps/files_sharing/lib/Controller/SettingsController.php')
-rw-r--r--apps/files_sharing/lib/Controller/SettingsController.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/SettingsController.php b/apps/files_sharing/lib/Controller/SettingsController.php
index 8f542ecb071..00d627095b8 100644
--- a/apps/files_sharing/lib/Controller/SettingsController.php
+++ b/apps/files_sharing/lib/Controller/SettingsController.php
@@ -6,6 +6,7 @@ declare(strict_types=1);
* @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author Hinrich Mahler <nextcloud@mahlerhome.de>
*
* @license GNU AGPL version 3 or any later version
*
@@ -35,10 +36,13 @@ class SettingsController extends Controller {
/** @var IConfig */
private $config;
+
/** @var string */
private $userId;
- public function __construct(IRequest $request, IConfig $config, string $userId) {
+ public function __construct(IRequest $request,
+ IConfig $config,
+ string $userId) {
parent::__construct(Application::APP_ID, $request);
$this->config = $config;
@@ -52,4 +56,20 @@ class SettingsController extends Controller {
$this->config->setUserValue($this->userId, Application::APP_ID, 'default_accept', $accept ? 'yes' : 'no');
return new JSONResponse();
}
+
+ /**
+ * @NoAdminRequired
+ */
+ public function setUserShareFolder(string $shareFolder): JSONResponse {
+ $this->config->setUserValue($this->userId, Application::APP_ID, 'share_folder', $shareFolder);
+ return new JSONResponse();
+ }
+
+ /**
+ * @NoAdminRequired
+ */
+ public function resetUserShareFolder(): JSONResponse {
+ $this->config->deleteUserValue($this->userId, Application::APP_ID, 'share_folder');
+ return new JSONResponse();
+ }
}