find and show share-by mail links

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2016-10-26 12:18:39 +02:00
parent 561dd80d57
commit 1e930df91f
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
2 changed files with 11 additions and 0 deletions

View 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;

View 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);
}