|
@@ -133,7 +133,7 @@ discard block |
|
|
block discarded – undo |
|
133
|
133
|
$owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
|
134
|
134
|
$sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
|
135
|
135
|
$shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
|
136
|
|
- $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
|
136
|
+ $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
137
|
137
|
$sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
|
138
|
138
|
$ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
|
139
|
139
|
|
|
@@ -173,7 +173,7 @@ discard block |
|
|
block discarded – undo |
|
173
|
173
|
} catch (ProviderCouldNotAddShareException $e) { |
|
174
|
174
|
throw new OCSException($e->getMessage(), 400); |
|
175
|
175
|
} catch (\Exception $e) { |
|
176
|
|
- throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
|
176
|
+ throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
177
|
177
|
} |
|
178
|
178
|
|
|
179
|
179
|
return new Http\DataResponse(); |
|
@@ -194,8 +194,8 @@ discard block |
|
|
block discarded – undo |
|
194
|
194
|
public function reShare($id) { |
|
195
|
195
|
$token = $this->request->getParam('token', null); |
|
196
|
196
|
$shareWith = $this->request->getParam('shareWith', null); |
|
197
|
|
- $permission = (int)$this->request->getParam('permission', null); |
|
198
|
|
- $remoteId = (int)$this->request->getParam('remoteId', null); |
|
|
197
|
+ $permission = (int) $this->request->getParam('permission', null); |
|
|
198
|
+ $remoteId = (int) $this->request->getParam('remoteId', null); |
|
199
|
199
|
|
|
200
|
200
|
if ($id === null || |
|
201
|
201
|
$token === null || |
|
@@ -223,9 +223,9 @@ discard block |
|
|
block discarded – undo |
|
223
|
223
|
} catch (ProviderDoesNotExistsException $e) { |
|
224
|
224
|
throw new OCSException('Server does not support federated cloud sharing', 503); |
|
225
|
225
|
} catch (ShareNotFound $e) { |
|
226
|
|
- $this->logger->debug('Share not found: ' . $e->getMessage(), ['exception' => $e]); |
|
|
226
|
+ $this->logger->debug('Share not found: '.$e->getMessage(), ['exception' => $e]); |
|
227
|
227
|
} catch (\Exception $e) { |
|
228
|
|
- $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage(), ['exception' => $e]); |
|
|
228
|
+ $this->logger->debug('internal server error, can not process notification: '.$e->getMessage(), ['exception' => $e]); |
|
229
|
229
|
} |
|
230
|
230
|
|
|
231
|
231
|
throw new OCSBadRequestException(); |
|
@@ -259,9 +259,9 @@ discard block |
|
|
block discarded – undo |
|
259
|
259
|
} catch (ProviderDoesNotExistsException $e) { |
|
260
|
260
|
throw new OCSException('Server does not support federated cloud sharing', 503); |
|
261
|
261
|
} catch (ShareNotFound $e) { |
|
262
|
|
- $this->logger->debug('Share not found: ' . $e->getMessage(), ['exception' => $e]); |
|
|
262
|
+ $this->logger->debug('Share not found: '.$e->getMessage(), ['exception' => $e]); |
|
263
|
263
|
} catch (\Exception $e) { |
|
264
|
|
- $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage(), ['exception' => $e]); |
|
|
264
|
+ $this->logger->debug('internal server error, can not process notification: '.$e->getMessage(), ['exception' => $e]); |
|
265
|
265
|
} |
|
266
|
266
|
|
|
267
|
267
|
return new Http\DataResponse(); |
|
@@ -292,9 +292,9 @@ discard block |
|
|
block discarded – undo |
|
292
|
292
|
} catch (ProviderDoesNotExistsException $e) { |
|
293
|
293
|
throw new OCSException('Server does not support federated cloud sharing', 503); |
|
294
|
294
|
} catch (ShareNotFound $e) { |
|
295
|
|
- $this->logger->debug('Share not found: ' . $e->getMessage(), ['exception' => $e]); |
|
|
295
|
+ $this->logger->debug('Share not found: '.$e->getMessage(), ['exception' => $e]); |
|
296
|
296
|
} catch (\Exception $e) { |
|
297
|
|
- $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage(), ['exception' => $e]); |
|
|
297
|
+ $this->logger->debug('internal server error, can not process notification: '.$e->getMessage(), ['exception' => $e]); |
|
298
|
298
|
} |
|
299
|
299
|
|
|
300
|
300
|
return new Http\DataResponse(); |
|
@@ -323,7 +323,7 @@ discard block |
|
|
block discarded – undo |
|
323
|
323
|
$provider->notificationReceived('SHARE_UNSHARED', $id, $notification); |
|
324
|
324
|
$this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" was unshared', [$id])); |
|
325
|
325
|
} catch (\Exception $e) { |
|
326
|
|
- $this->logger->debug('processing unshare notification failed: ' . $e->getMessage(), ['exception' => $e]); |
|
|
326
|
+ $this->logger->debug('processing unshare notification failed: '.$e->getMessage(), ['exception' => $e]); |
|
327
|
327
|
} |
|
328
|
328
|
|
|
329
|
329
|
return new Http\DataResponse(); |
|
@@ -393,7 +393,7 @@ discard block |
|
|
block discarded – undo |
|
393
|
393
|
|
|
394
|
394
|
try { |
|
395
|
395
|
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); |
|
396
|
|
- $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); |
|
|
396
|
+ $ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions); |
|
397
|
397
|
$notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions]; |
|
398
|
398
|
$provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification); |
|
399
|
399
|
$this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" has updated permissions "%s"', [$id, implode(', ', $ocmPermissions)])); |