diff options
author | Joas Schilling <coding@schilljs.com> | 2022-07-01 14:07:52 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-07-01 14:07:52 +0200 |
commit | 473a7865108b787e4db90df3dfa19d13ad1323df (patch) | |
tree | 1dcc7d75cad92c57204a011db44f2da7e8aadcf4 /apps | |
parent | c88a30a523e9e599dcfe0d4b41b744fb98c72d1e (diff) | |
download | nextcloud-server-473a7865108b787e4db90df3dfa19d13ad1323df.tar.gz nextcloud-server-473a7865108b787e4db90df3dfa19d13ad1323df.zip |
Inject userId directly
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Settings/AvailabilitySettings.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index 2bafdfab9d7..d2b75ba4866 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -29,27 +29,26 @@ use OCA\DAV\AppInfo\Application; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; -use OCP\IUserSession; use OCP\Settings\ISettings; class AvailabilitySettings implements ISettings { - protected IUserSession $userSession; protected IConfig $config; protected IInitialState $initialState; + protected ?string $userId; - public function __construct(IUserSession $userSession, - IConfig $config, - IInitialState $initialState) { - $this->userSession = $userSession; + public function __construct(IConfig $config, + IInitialState $initialState, + ?string $userId) { $this->config = $config; $this->initialState = $initialState; + $this->userId = $userId; } public function getForm(): TemplateResponse { $this->initialState->provideInitialState( 'user_status_automation', $this->config->getUserValue( - $this->userSession->getUser()->getUID(), + $this->userId, 'dav', 'user_status_automation', 'no' |