aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php2
-rw-r--r--apps/federatedfilesharing/lib/Controller/RequestHandlerController.php2
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php14
-rw-r--r--apps/federatedfilesharing/lib/Notifications.php2
-rw-r--r--apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php12
-rw-r--r--apps/federatedfilesharing/tests/AddressHandlerTest.php2
6 files changed, 17 insertions, 17 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
index c4190e0691a..f832fc7e54c 100644
--- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
+++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
@@ -138,7 +138,7 @@ class MountPublicLinkController extends Controller {
}
try {
- list(, $server) = $this->addressHandler->splitUserRemote($shareWith);
+ [, $server] = $this->addressHandler->splitUserRemote($shareWith);
$share = $this->shareManager->getShareByToken($token);
} catch (HintException $e) {
return new JSONResponse(['message' => $e->getHint()], Http::STATUS_BAD_REQUEST);
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
index fe0f1b45e53..ef49ca99ead 100644
--- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
+++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
@@ -219,7 +219,7 @@ class RequestHandlerController extends OCSController {
try {
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
- list($newToken, $localId) = $provider->notificationReceived('REQUEST_RESHARE', $id, $notification);
+ [$newToken, $localId] = $provider->notificationReceived('REQUEST_RESHARE', $id, $notification);
return new Http\DataResponse([
'token' => $newToken,
'remoteId' => $localId
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index d77bea1fb54..fe814284fb6 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -221,7 +221,7 @@ class FederatedShareProvider implements IShareProvider {
$ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']);
$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time(), $shareType);
$share->setId($shareId);
- list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId);
+ [$token, $remoteId] = $this->askOwnerToReShare($shareWith, $share, $shareId);
// remote share was create successfully if we get a valid token as return
$send = is_string($token) && $token !== '';
} catch (\Exception $e) {
@@ -323,7 +323,7 @@ class FederatedShareProvider implements IShareProvider {
$remoteId = $remoteShare['remote_id'];
$remote = $remoteShare['remote'];
- list($token, $remoteId) = $this->notifications->requestReShare(
+ [$token, $remoteId] = $this->notifications->requestReShare(
$token,
$remoteId,
$shareId,
@@ -435,9 +435,9 @@ class FederatedShareProvider implements IShareProvider {
$remoteId = $this->getRemoteId($share);
// if the local user is the owner we send the permission change to the initiator
if ($this->userManager->userExists($share->getShareOwner())) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy());
} else { // ... if not we send the permission change to the owner
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getShareOwner());
}
$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
}
@@ -541,7 +541,7 @@ class FederatedShareProvider implements IShareProvider {
* @throws \OC\HintException
*/
public function delete(IShare $share) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedWith());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedWith());
// if the local user is the owner we can send the unShare request directly...
if ($this->userManager->userExists($share->getShareOwner())) {
@@ -576,9 +576,9 @@ class FederatedShareProvider implements IShareProvider {
// also send a unShare request to the initiator, if this is a different user than the owner
if ($share->getShareOwner() !== $share->getSharedBy()) {
if ($isOwner) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy());
} else {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getShareOwner());
}
$remoteId = $this->getRemoteId($share);
$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php
index 410c155b072..4689f048d85 100644
--- a/apps/federatedfilesharing/lib/Notifications.php
+++ b/apps/federatedfilesharing/lib/Notifications.php
@@ -95,7 +95,7 @@ class Notifications {
* @throws \OC\ServerNotAvailableException
*/
public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) {
- list($user, $remote) = $this->addressHandler->splitUserRemote($shareWith);
+ [$user, $remote] = $this->addressHandler->splitUserRemote($shareWith);
if ($user && $remote) {
$local = $this->addressHandler->generateRemoteURL();
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
index f5aef1dbd8e..0bd0287f606 100644
--- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
+++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
@@ -183,7 +183,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
throw new ProviderCouldNotAddShareException('Unsupported protocol for data exchange.', '', Http::STATUS_NOT_IMPLEMENTED);
}
- list($ownerUid, $remote) = $this->addressHandler->splitUserRemote($share->getOwner());
+ [$ownerUid, $remote] = $this->addressHandler->splitUserRemote($share->getOwner());
// for backward compatibility make sure that the remote url stored in the
// database ends with a trailing slash
if (substr($remote, -1) !== '/') {
@@ -385,7 +385,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
$this->verifyShare($share, $token);
$this->executeAcceptShare($share);
if ($share->getShareOwner() !== $share->getSharedBy()) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy());
$remoteId = $this->federatedShareProvider->getRemoteId($share);
$notification = $this->cloudFederationFactory->getCloudFederationNotification();
$notification->setMessage(
@@ -411,7 +411,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
protected function executeAcceptShare(IShare $share) {
try {
$fileId = (int)$share->getNode()->getId();
- list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
+ [$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId);
} catch (\Exception $e) {
throw new ShareNotFound();
}
@@ -455,7 +455,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
$this->verifyShare($share, $token);
if ($share->getShareOwner() !== $share->getSharedBy()) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
+ [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy());
$remoteId = $this->federatedShareProvider->getRemoteId($share);
$notification = $this->cloudFederationFactory->getCloudFederationNotification();
$notification->setMessage(
@@ -487,7 +487,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
try {
$fileId = (int)$share->getNode()->getId();
- list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
+ [$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId);
} catch (\Exception $e) {
throw new ShareNotFound();
}
@@ -642,7 +642,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
$share = $this->federatedShareProvider->getShareById($id);
// don't allow to share a file back to the owner
try {
- list($user, $remote) = $this->addressHandler->splitUserRemote($shareWith);
+ [$user, $remote] = $this->addressHandler->splitUserRemote($shareWith);
$owner = $share->getShareOwner();
$currentServer = $this->addressHandler->generateRemoteURL();
if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) {
diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php
index 9ab3616412b..e2e61783ee7 100644
--- a/apps/federatedfilesharing/tests/AddressHandlerTest.php
+++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php
@@ -108,7 +108,7 @@ class AddressHandlerTest extends \Test\TestCase {
->method('search')
->willReturn([]);
- list($remoteUser, $remoteUrl) = $this->addressHandler->splitUserRemote($remote);
+ [$remoteUser, $remoteUrl] = $this->addressHandler->splitUserRemote($remote);
$this->assertSame($expectedUser, $remoteUser);
$this->assertSame($expectedUrl, $remoteUrl);
}