mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
feat(cloud-federation-api): Make duplicate entries
Solve the problem by adding the provider for both files and folders Signed-off-by: Micke Nordin <kano@sunet.se>
This commit is contained in:
parent
5a7f72c6a6
commit
432709328c
2 changed files with 9 additions and 9 deletions
|
|
@ -106,9 +106,6 @@ class RequestHandlerController extends Controller {
|
|||
#[NoCSRFRequired]
|
||||
#[BruteForceProtection(action: 'receiveFederatedShare')]
|
||||
public function addShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $protocol, $shareType, $resourceType) {
|
||||
if ($resourceType === 'folder') {
|
||||
$resourceType = 'file';
|
||||
}
|
||||
try {
|
||||
// if request is signed and well signed, no exception are thrown
|
||||
// if request is not signed and host is known for not supporting signed request, no exception are thrown
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2016-2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
|
@ -35,10 +35,13 @@ class Application extends App implements IBootstrap {
|
|||
|
||||
private function registerCloudFederationProvider(ICloudFederationProviderManager $manager,
|
||||
IAppContainer $appContainer): void {
|
||||
$manager->addCloudFederationProvider('file',
|
||||
'Federated Files Sharing',
|
||||
function () use ($appContainer): CloudFederationProviderFiles {
|
||||
return $appContainer->get(CloudFederationProviderFiles::class);
|
||||
});
|
||||
$fileResourceTypes = ['file', 'folder'];
|
||||
foreach ($fileResourceTypes as $type) {
|
||||
$manager->addCloudFederationProvider($type,
|
||||
'Federated Files Sharing',
|
||||
function () use ($appContainer): CloudFederationProviderFiles {
|
||||
return $appContainer->get(CloudFederationProviderFiles::class);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue