mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(files_sharing): ensure share folder exists in the settings
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
764b582a87
commit
f3857f705d
1 changed files with 7 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ declare(strict_types=1);
|
|||
namespace OCA\Files_Sharing\Settings;
|
||||
|
||||
use OCA\Files_Sharing\AppInfo\Application;
|
||||
use OCA\Files_Sharing\Helper;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Services\IInitialState;
|
||||
use OCP\IConfig;
|
||||
|
|
@ -25,16 +26,18 @@ class Personal implements ISettings {
|
|||
|
||||
public function getForm(): TemplateResponse {
|
||||
$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
|
||||
$shareFolderSystemConfig = $this->config->getSystemValue('share_folder', '/');
|
||||
$defaultShareFolder = $this->config->getSystemValue('share_folder', '/');
|
||||
$userShareFolder = Helper::getShareFolder(userId: $this->userId);
|
||||
$acceptDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
|
||||
$enforceAccept = $this->config->getSystemValueBool('sharing.force_share_accept', false);
|
||||
$allowCustomDirectory = $this->config->getSystemValueBool('sharing.allow_custom_share_folder', true);
|
||||
$shareFolderDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'share_folder', $shareFolderSystemConfig);
|
||||
|
||||
$this->initialState->provideInitialState('accept_default', $acceptDefault);
|
||||
$this->initialState->provideInitialState('enforce_accept', $enforceAccept);
|
||||
$this->initialState->provideInitialState('allow_custom_share_folder', $allowCustomDirectory);
|
||||
$this->initialState->provideInitialState('share_folder', $shareFolderDefault);
|
||||
$this->initialState->provideInitialState('default_share_folder', $shareFolderSystemConfig);
|
||||
$this->initialState->provideInitialState('default_share_folder', $defaultShareFolder);
|
||||
$this->initialState->provideInitialState('share_folder', $userShareFolder);
|
||||
|
||||
return new TemplateResponse('files_sharing', 'Settings/personal');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue