diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-08-01 19:04:32 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-08-08 14:25:44 +0200 |
commit | 4b7fa4ac2e2562025672a389567ee659adff01ab (patch) | |
tree | 5776c9d09ad5c3fcda6cc8951bb6240108996db6 /lib | |
parent | e2e6f23b6722eaf9c0aa2bf94626c6b1674aff0a (diff) | |
download | nextcloud-server-4b7fa4ac2e2562025672a389567ee659adff01ab.tar.gz nextcloud-server-4b7fa4ac2e2562025672a389567ee659adff01ab.zip |
Add support for tokens in room shares
Tokens will be used to give access to a share to guests in public rooms.
Although the token itself is created in the provider of room shares and
no changes are needed for that, due to the code structure it is
necessary to explicitly call the provider from the manager when getting
a room share by token.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/Manager.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 7cfa83dbb4a..037ea53048a 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1248,6 +1248,15 @@ class Manager implements IManager { } } + if ($share === null && $this->shareProviderExists(\OCP\Share::SHARE_TYPE_ROOM)) { + try { + $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_ROOM); + $share = $provider->getShareByToken($token); + } catch (ProviderException $e) { + } catch (ShareNotFound $e) { + } + } + if ($share === null) { throw new ShareNotFound($this->l->t('The requested share does not exist anymore')); } |