| @@ 256-271 (lines=16) @@ | ||
| 253 | * |
|
| 254 | * @return Result |
|
| 255 | */ |
|
| 256 | public function acceptShare($id) { |
|
| 257 | try { |
|
| 258 | $this->assertOutgoingSharingEnabled(); |
|
| 259 | $share = $this->getValidShare($id); |
|
| 260 | $this->fedShareManager->acceptShare($share); |
|
| 261 | } catch (NotImplementedException $e) { |
|
| 262 | return new Result( |
|
| 263 | null, |
|
| 264 | Http::STATUS_SERVICE_UNAVAILABLE, |
|
| 265 | 'Server does not support federated cloud sharing' |
|
| 266 | ); |
|
| 267 | } catch (Share\Exceptions\ShareNotFound $e) { |
|
| 268 | // pass |
|
| 269 | } |
|
| 270 | return new Result(); |
|
| 271 | } |
|
| 272 | ||
| 273 | /** |
|
| 274 | * @NoCSRFRequired |
|
| @@ 283-299 (lines=17) @@ | ||
| 280 | * |
|
| 281 | * @return Result |
|
| 282 | */ |
|
| 283 | public function declineShare($id) { |
|
| 284 | try { |
|
| 285 | $this->assertOutgoingSharingEnabled(); |
|
| 286 | $share = $this->getValidShare($id); |
|
| 287 | $this->fedShareManager->declineShare($share); |
|
| 288 | } catch (NotImplementedException $e) { |
|
| 289 | return new Result( |
|
| 290 | null, |
|
| 291 | Http::STATUS_SERVICE_UNAVAILABLE, |
|
| 292 | 'Server does not support federated cloud sharing' |
|
| 293 | ); |
|
| 294 | } catch (Share\Exceptions\ShareNotFound $e) { |
|
| 295 | // pass |
|
| 296 | } |
|
| 297 | ||
| 298 | return new Result(); |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * @NoCSRFRequired |
|