]> source.dussan.org Git - nextcloud-server.git/commitdiff
find and show share-by mail links
authorBjoern Schiessle <bjoern@schiessle.org>
Wed, 26 Oct 2016 10:18:39 +0000 (12:18 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Tue, 1 Nov 2016 18:54:41 +0000 (19:54 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/sharebymail/lib/ShareByMailProvider.php
lib/private/Share20/Manager.php

index c0c21bdb16cbe96f9729d3d8520ef212f523c869..46697910bbc9272656c3fb47d75a2a69b2f3dc88 100644 (file)
@@ -32,6 +32,7 @@ use OCP\IUserManager;
 use OCP\Mail\IMailer;
 use OCP\Security\ISecureRandom;
 use OC\Share20\Share;
+use OCP\Share\Exceptions\ShareNotFound;
 use OCP\Share\IShare;
 use OCP\Share\IShareProvider;
 
index 899bd4ebfa1e46a90d8a71c3851004d4e40dcbf6..0c49d0b6490a3f078939da1947c150ab57eb38ce 100644 (file)
@@ -1049,6 +1049,16 @@ class Manager implements IManager {
                // If it is not a link share try to fetch a federated share by token
                if ($share === null) {
                        $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_REMOTE);
+                       try {
+                               $share = $provider->getShareByToken($token);
+                       } catch (ShareNotFound $e) {
+                               $share = null;
+                       }
+               }
+
+               // If it is not a link share try to fetch a federated share by token
+               if ($share === null && $this->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) {
+                       $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_EMAIL);
                        $share = $provider->getShareByToken($token);
                }