diff options
3 files changed, 19 insertions, 1 deletions
diff --git a/apps/federatedfilesharing/lib/AppInfo/Application.php b/apps/federatedfilesharing/lib/AppInfo/Application.php index b86ebebe26f..9a8892bb6f9 100644 --- a/apps/federatedfilesharing/lib/AppInfo/Application.php +++ b/apps/federatedfilesharing/lib/AppInfo/Application.php @@ -59,6 +59,7 @@ class Application extends App { $server->query(AddressHandler::class), $server->getLogger(), $server->getUserManager(), + $server->getShareManager(), $server->getCloudIdManager(), $server->getActivityManager(), $server->getNotificationManager(), diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 33f9f2899e5..bd5aea37047 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -98,7 +98,7 @@ class FederatedShareProvider implements IShareProvider { private $cloudFederationProviderManager; /** @var array list of supported share types */ - private $supportedShareType = [\OCP\Share::SHARE_TYPE_REMOTE_GROUP, \OCP\Share::SHARE_TYPE_REMOTE]; + private $supportedShareType = [IShare::TYPE_REMOTE_GROUP, IShare::TYPE_REMOTE, IShare::TYPE_CIRCLE]; /** * DefaultShareProvider constructor. diff --git a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php index 6ca0282d81f..c51c5d43589 100644 --- a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php @@ -50,6 +50,7 @@ use OCP\IUserManager; use OCP\Notification\IManager as INotificationManager; use OCP\Share; use OCP\Share\Exceptions\ShareNotFound; +use OCP\Share\IManager; use OCP\Share\IShare; use OCP\Util; @@ -70,6 +71,9 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { /** @var IUserManager */ private $userManager; + /** @var IManager */ + private $shareManager; + /** @var ICloudIdManager */ private $cloudIdManager; @@ -102,6 +106,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @param AddressHandler $addressHandler * @param ILogger $logger * @param IUserManager $userManager + * @param IManager $shareManager * @param ICloudIdManager $cloudIdManager * @param IActivityManager $activityManager * @param INotificationManager $notificationManager @@ -116,6 +121,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { AddressHandler $addressHandler, ILogger $logger, IUserManager $userManager, + IManager $shareManager, ICloudIdManager $cloudIdManager, IActivityManager $activityManager, INotificationManager $notificationManager, @@ -130,6 +136,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $this->addressHandler = $addressHandler; $this->logger = $logger; $this->userManager = $userManager; + $this->shareManager = $shareManager; $this->cloudIdManager = $cloudIdManager; $this->activityManager = $activityManager; $this->notificationManager = $notificationManager; @@ -805,6 +812,16 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { return true; } + if ($share->getShareType() === IShare::TYPE_CIRCLE) { + try { + $knownShare = $this->shareManager->getShareByToken($token); + if ($knownShare->getId() === $share->getId()) { + return true; + } + } catch (ShareNotFound $e) { + } + } + throw new AuthenticationFailedException(); } |