diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-10-30 11:41:56 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-10-30 11:41:56 +0100 |
commit | 5a73a9b9ded91b15ca044d27ac2cf42fb483af93 (patch) | |
tree | d18dbff8b5f0638510527b16e184b56f612b0048 /lib | |
parent | e6952edaf450c6a74e38eac27d1de37b1934d6e3 (diff) | |
download | nextcloud-server-5a73a9b9ded91b15ca044d27ac2cf42fb483af93.tar.gz nextcloud-server-5a73a9b9ded91b15ca044d27ac2cf42fb483af93.zip |
Fix injection to get the user id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/RemotePlugin.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index 0eab02ab0fa..d877346b155 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -31,6 +31,7 @@ use OCP\Contacts\IManager; use OCP\Federation\ICloudIdManager; use OCP\IConfig; use OCP\IUserManager; +use OCP\IUserSession; use OCP\Share; class RemotePlugin implements ISearchPlugin { @@ -45,15 +46,17 @@ class RemotePlugin implements ISearchPlugin { /** @var IUserManager */ private $userManager; /** @var string */ - private $userId; + private $userId = ''; - public function __construct(IManager $contactsManager, ICloudIdManager $cloudIdManager, IConfig $config, IUserManager $userManager, $userId) { + public function __construct(IManager $contactsManager, ICloudIdManager $cloudIdManager, IConfig $config, IUserManager $userManager, IUserSession $userSession) { $this->contactsManager = $contactsManager; $this->cloudIdManager = $cloudIdManager; $this->config = $config; $this->userManager = $userManager; - $this->userId = $userId; - + $user = $userSession->getUser(); + if ($user !== null) { + $this->userId = $user->getUID(); + } $this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes'; } |