@@ -52,19 +52,19 @@ |
||
| 52 | 52 | //Sharing stuff |
| 53 | 53 | ['name' => 'share#search', 'url' => '/api/v2/sharing/search', 'verb' => 'POST'], |
| 54 | 54 | ['name' => 'share#getVaultsByUser', 'url' => '/api/v2/sharing/vaults/{user_id}', 'verb' => 'GET'], |
| 55 | - ['name' => 'share#applyIntermediateShare', 'url' => '/api/v2/sharing/share', 'verb' => 'POST'], |
|
| 56 | - ['name' => 'share#savePendingRequest', 'url' => '/api/v2/sharing/save', 'verb' => 'POST'], |
|
| 57 | - ['name' => 'share#getPendingRequests', 'url' => '/api/v2/sharing/pending', 'verb' => 'GET'], |
|
| 58 | - ['name' => 'share#deleteShareRequest', 'url' => '/api/v2/sharing/decline/{share_request_id}', 'verb' => 'DELETE'], |
|
| 59 | - ['name' => 'share#getVaultItems', 'url' => '/api/v2/sharing/vault/{vault_guid}/get', 'verb' => 'GET'], |
|
| 60 | - ['name' => 'share#createPublicShare', 'url' => '/api/v2/sharing/public', 'verb' => 'POST'], |
|
| 61 | - ['name' => 'share#getPublicCredentialData', 'url' => '/api/v2/sharing/credential/{credential_guid}/public', 'verb' => 'GET'], |
|
| 62 | - ['name' => 'share#unshareCredential', 'url' => '/api/v2/sharing/credential/{item_guid}', 'verb' => 'DELETE'], |
|
| 63 | - ['name' => 'share#unshareCredentialFromUser', 'url' => '/api/v2/sharing/credential/{item_guid}/{user_id}', 'verb' => 'DELETE'], |
|
| 64 | - ['name' => 'share#getRevisions', 'url' => '/api/v2/sharing/credential/{item_guid}/revisions', 'verb' => 'GET'], |
|
| 65 | - ['name' => 'share#getItemAcl', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'GET'], |
|
| 66 | - ['name' => 'share#getFile', 'url' => '/api/v2/sharing/credential/{item_guid}/file/{file_guid}', 'verb' => 'GET'], |
|
| 67 | - ['name' => 'share#updateSharedCredentialACL', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'PATCH'], |
|
| 55 | + ['name' => 'share#applyIntermediateShare', 'url' => '/api/v2/sharing/share', 'verb' => 'POST'], |
|
| 56 | + ['name' => 'share#savePendingRequest', 'url' => '/api/v2/sharing/save', 'verb' => 'POST'], |
|
| 57 | + ['name' => 'share#getPendingRequests', 'url' => '/api/v2/sharing/pending', 'verb' => 'GET'], |
|
| 58 | + ['name' => 'share#deleteShareRequest', 'url' => '/api/v2/sharing/decline/{share_request_id}', 'verb' => 'DELETE'], |
|
| 59 | + ['name' => 'share#getVaultItems', 'url' => '/api/v2/sharing/vault/{vault_guid}/get', 'verb' => 'GET'], |
|
| 60 | + ['name' => 'share#createPublicShare', 'url' => '/api/v2/sharing/public', 'verb' => 'POST'], |
|
| 61 | + ['name' => 'share#getPublicCredentialData', 'url' => '/api/v2/sharing/credential/{credential_guid}/public', 'verb' => 'GET'], |
|
| 62 | + ['name' => 'share#unshareCredential', 'url' => '/api/v2/sharing/credential/{item_guid}', 'verb' => 'DELETE'], |
|
| 63 | + ['name' => 'share#unshareCredentialFromUser', 'url' => '/api/v2/sharing/credential/{item_guid}/{user_id}', 'verb' => 'DELETE'], |
|
| 64 | + ['name' => 'share#getRevisions', 'url' => '/api/v2/sharing/credential/{item_guid}/revisions', 'verb' => 'GET'], |
|
| 65 | + ['name' => 'share#getItemAcl', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'GET'], |
|
| 66 | + ['name' => 'share#getFile', 'url' => '/api/v2/sharing/credential/{item_guid}/file/{file_guid}', 'verb' => 'GET'], |
|
| 67 | + ['name' => 'share#updateSharedCredentialACL', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'PATCH'], |
|
| 68 | 68 | ['name' => 'internal#getAppVersion', 'url' => '/api/v2/version', 'verb' => 'GET'], |
| 69 | 69 | |
| 70 | 70 | //Settings |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct($AppName, |
| 24 | 24 | IRequest $request, |
| 25 | 25 | $UserId, |
| 26 | - FileService $fileService){ |
|
| 26 | + FileService $fileService) { |
|
| 27 | 27 | parent::__construct( |
| 28 | 28 | $AppName, |
| 29 | 29 | $request, |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId)); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function updateFile($file_id, $file_data, $filename){ |
|
| 69 | - try{ |
|
| 68 | + public function updateFile($file_id, $file_data, $filename) { |
|
| 69 | + try { |
|
| 70 | 70 | $file = $this->fileService->getFile($file_id, $this->userId); |
| 71 | - } catch (\Exception $doesNotExistException){ |
|
| 71 | + } catch (\Exception $doesNotExistException) { |
|
| 72 | 72 | |
| 73 | 73 | } |
| 74 | - if($file){ |
|
| 75 | - if($file_data) { |
|
| 74 | + if ($file) { |
|
| 75 | + if ($file_data) { |
|
| 76 | 76 | $file->setFileData($file_data); |
| 77 | 77 | } |
| 78 | - if($filename) { |
|
| 78 | + if ($filename) { |
|
| 79 | 79 | $file->setFilename($filename); |
| 80 | 80 | } |
| 81 | - if($filename || $file_data){ |
|
| 81 | + if ($filename || $file_data) { |
|
| 82 | 82 | new JSONResponse($this->fileService->updateFile($file)); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct($AppName, |
| 24 | 24 | IRequest $request, |
| 25 | 25 | $UserId, |
| 26 | - FileService $fileService){ |
|
| 26 | + FileService $fileService) { |
|
| 27 | 27 | parent::__construct( |
| 28 | 28 | $AppName, |
| 29 | 29 | $request, |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId)); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function updateFile($file_id, $file_data, $filename){ |
|
| 68 | + public function updateFile($file_id, $file_data, $filename) { |
|
| 69 | 69 | try{ |
| 70 | 70 | $file = $this->fileService->getFile($file_id, $this->userId); |
| 71 | 71 | } catch (\Exception $doesNotExistException){ |
| 72 | 72 | |
| 73 | 73 | } |
| 74 | - if($file){ |
|
| 74 | + if($file) { |
|
| 75 | 75 | if($file_data) { |
| 76 | 76 | $file->setFileData($file_data); |
| 77 | 77 | } |
| 78 | 78 | if($filename) { |
| 79 | 79 | $file->setFilename($filename); |
| 80 | 80 | } |
| 81 | - if($filename || $file_data){ |
|
| 81 | + if($filename || $file_data) { |
|
| 82 | 82 | new JSONResponse($this->fileService->updateFile($file)); |
| 83 | 83 | } |
| 84 | 84 | } |