| @@ 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 |
|
| @@ 386-394 (lines=9) @@ | ||
| 383 | * @throws InvalidShareException |
|
| 384 | * @throws Share\Exceptions\ShareNotFound |
|
| 385 | */ |
|
| 386 | protected function getValidShare($id, $sharedSecret) { |
|
| 387 | $share = $this->federatedShareProvider->getShareById($id); |
|
| 388 | if ($share->getShareType() !== FederatedShareProvider::SHARE_TYPE_REMOTE |
|
| 389 | || $share->getToken() !== $sharedSecret |
|
| 390 | ) { |
|
| 391 | throw new InvalidShareException(); |
|
| 392 | } |
|
| 393 | return $share; |
|
| 394 | } |
|
| 395 | } |
|
| 396 | ||