diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-07-14 11:01:25 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-07-14 16:39:48 +0200 |
commit | c7f6461c53e1d432f268305e63eb9a604e12cba4 (patch) | |
tree | 1e1caadddfc389e9106da059df76e36c29abef46 /apps/federatedfilesharing/lib | |
parent | 56d3100f44e5541c2b19ee24fa37df372a809372 (diff) | |
download | nextcloud-server-c7f6461c53e1d432f268305e63eb9a604e12cba4.tar.gz nextcloud-server-c7f6461c53e1d432f268305e63eb9a604e12cba4.zip |
rename SaveToNextcloudController to MountPublicLinkController
Diffstat (limited to 'apps/federatedfilesharing/lib')
-rw-r--r-- | apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php (renamed from apps/federatedfilesharing/lib/Controller/SaveToNextcloudController.php) | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/SaveToNextcloudController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php index c95b50ecf46..ec70090f97a 100644 --- a/apps/federatedfilesharing/lib/Controller/SaveToNextcloudController.php +++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php @@ -37,7 +37,14 @@ use OCP\ISession; use OCP\IUserSession; use OCP\Share\IManager; -class SaveToNextcloudController extends Controller { +/** + * Class MountPublicLinkController + * + * convert public links to federated shares + * + * @package OCA\FederatedFileSharing\Controller + */ +class MountPublicLinkController extends Controller { /** @var FederatedShareProvider */ private $federatedShareProvider; @@ -61,7 +68,7 @@ class SaveToNextcloudController extends Controller { private $clientService; /** - * SaveToNextcloudController constructor. + * MountPublicLinkController constructor. * * @param string $appName * @param IRequest $request @@ -95,8 +102,7 @@ class SaveToNextcloudController extends Controller { } /** - * save public link to my Nextcloud by asking the owner to create a federated - * share with me + * send federated share to a user of a public link * * @NoCSRFRequired * @PublicPage @@ -106,7 +112,7 @@ class SaveToNextcloudController extends Controller { * @param string $password * @return JSONResponse */ - public function saveToNextcloud($shareWith, $token, $password = '') { + public function createFederatedShare($shareWith, $token, $password = '') { try { list(, $server) = $this->addressHandler->splitUserRemote($shareWith); @@ -147,7 +153,7 @@ class SaveToNextcloudController extends Controller { * @param string $name (only for legacy reasons, can be removed with legacyMountPublicLink()) * @return JSONResponse */ - public function askForFederatedShare($token, $remote, $password = '', $owner='', $ownerDisplayName = '', $name = '') { + public function askForFederatedShare($token, $remote, $password = '', $owner = '', $ownerDisplayName = '', $name = '') { // check if server admin allows to mount public links from other servers if ($this->federatedShareProvider->isIncomingServer2serverShareEnabled() === false) { return new JSONResponse(['message' => $this->l->t('Server to server sharing is not enabled on this server')], Http::STATUS_BAD_REQUEST); @@ -158,14 +164,15 @@ class SaveToNextcloudController extends Controller { $httpClient = $this->clientService->newClient(); try { - $response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/saveToNextcloud', + $response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/createFederatedShare', [ 'body' => [ 'token' => $token, 'shareWith' => rtrim($shareWith, '/'), 'password' => $password - ] + ], + 'connect_timeout' => 10, ] ); } catch (\Exception $e) { |