| @@ 250-265 (lines=16) @@ | ||
| 247 | * |
|
| 248 | * @return Result |
|
| 249 | */ |
|
| 250 | public function acceptShare($id) { |
|
| 251 | try { |
|
| 252 | $this->assertOutgoingSharingEnabled(); |
|
| 253 | $share = $this->getValidShare($id); |
|
| 254 | $this->fedShareManager->acceptShare($share); |
|
| 255 | } catch (NotSupportedException $e) { |
|
| 256 | return new Result( |
|
| 257 | null, |
|
| 258 | Http::STATUS_SERVICE_UNAVAILABLE, |
|
| 259 | 'Server does not support federated cloud sharing' |
|
| 260 | ); |
|
| 261 | } catch (Share\Exceptions\ShareNotFound $e) { |
|
| 262 | // pass |
|
| 263 | } |
|
| 264 | return new Result(); |
|
| 265 | } |
|
| 266 | ||
| 267 | /** |
|
| 268 | * @NoCSRFRequired |
|
| @@ 277-293 (lines=17) @@ | ||
| 274 | * |
|
| 275 | * @return Result |
|
| 276 | */ |
|
| 277 | public function declineShare($id) { |
|
| 278 | try { |
|
| 279 | $this->assertOutgoingSharingEnabled(); |
|
| 280 | $share = $this->getValidShare($id); |
|
| 281 | $this->fedShareManager->declineShare($share); |
|
| 282 | } catch (NotSupportedException $e) { |
|
| 283 | return new Result( |
|
| 284 | null, |
|
| 285 | Http::STATUS_SERVICE_UNAVAILABLE, |
|
| 286 | 'Server does not support federated cloud sharing' |
|
| 287 | ); |
|
| 288 | } catch (Share\Exceptions\ShareNotFound $e) { |
|
| 289 | // pass |
|
| 290 | } |
|
| 291 | ||
| 292 | return new Result(); |
|
| 293 | } |
|
| 294 | ||
| 295 | /** |
|
| 296 | * @NoCSRFRequired |
|