| @@ 393-402 (lines=10) @@ | ||
| 390 | * @throws Share\Exceptions\ShareNotFound |
|
| 391 | * @throws InvalidShareException |
|
| 392 | */ |
|
| 393 | protected function getValidShare($id) { |
|
| 394 | $share = $this->federatedShareProvider->getShareById($id); |
|
| 395 | $token = $this->request->getParam('token', null); |
|
| 396 | if ($share->getShareType() !== FederatedShareProvider::SHARE_TYPE_REMOTE |
|
| 397 | || $share->getToken() !== $token |
|
| 398 | ) { |
|
| 399 | throw new InvalidShareException(); |
|
| 400 | } |
|
| 401 | return $share; |
|
| 402 | } |
|
| 403 | ||
| 404 | /** |
|
| 405 | * Make sure that incoming shares are enabled |
|
| @@ 406-414 (lines=9) @@ | ||
| 403 | * @throws InvalidShareException |
|
| 404 | * @throws Share\Exceptions\ShareNotFound |
|
| 405 | */ |
|
| 406 | protected function getValidShare($id, $sharedSecret) { |
|
| 407 | $share = $this->federatedShareProvider->getShareById($id); |
|
| 408 | if ($share->getShareType() !== FederatedShareProvider::SHARE_TYPE_REMOTE |
|
| 409 | || $share->getToken() !== $sharedSecret |
|
| 410 | ) { |
|
| 411 | throw new InvalidShareException(); |
|
| 412 | } |
|
| 413 | return $share; |
|
| 414 | } |
|
| 415 | ||
| 416 | /** |
|
| 417 | * @param string $resourceType |
|