diff options
Diffstat (limited to 'apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php')
-rw-r--r-- | apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index 836b6610199..1ce639532e8 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -308,7 +309,10 @@ class CloudFederationProviderFiles implements ISignedCloudFederationProvider { $this->verifyShare($share, $token); $this->executeAcceptShare($share); - if ($share->getShareOwner() !== $share->getSharedBy()) { + + if ($share->getShareOwner() !== $share->getSharedBy() + && !$this->userManager->userExists($share->getSharedBy())) { + // only if share was initiated from another instance [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy()); $remoteId = $this->federatedShareProvider->getRemoteId($share); $notification = $this->cloudFederationFactory->getCloudFederationNotification(); @@ -702,8 +706,8 @@ class CloudFederationProviderFiles implements ISignedCloudFederationProvider { */ protected function verifyShare(IShare $share, $token) { if ( - $share->getShareType() === IShare::TYPE_REMOTE && - $share->getToken() === $token + $share->getShareType() === IShare::TYPE_REMOTE + && $share->getToken() === $token ) { return true; } |