@@ -148,7 +148,7 @@ |
||
148 | 148 | * Update a credential |
149 | 149 | * |
150 | 150 | * @param $raw_credential array An array containing all the credential fields |
151 | - * @param $useRawUser bool |
|
151 | + * @param boolean $useRawUser bool |
|
152 | 152 | * @return Credential The updated credential |
153 | 153 | */ |
154 | 154 | public function updateCredential($raw_credential, $useRawUser) { |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | $activity . '_self', array($label, $this->userId, $revision_created), |
175 | 175 | '', array(), |
176 | 176 | $link, $this->userId, Activity::TYPE_ITEM_ACTION); |
177 | - } else if (($storedCredential->getDeleteTime() === 0) && (int)$delete_time > 0) { |
|
177 | + } else if (($storedCredential->getDeleteTime() === 0) && (int) $delete_time > 0) { |
|
178 | 178 | $activity = 'item_deleted'; |
179 | 179 | $this->activityService->add( |
180 | 180 | $activity . '_self', array($label, $this->userId), |
181 | 181 | '', array(), |
182 | 182 | $link, $this->userId, Activity::TYPE_ITEM_ACTION); |
183 | - } else if (($storedCredential->getDeleteTime() > 0) && (int)$delete_time === 0) { |
|
183 | + } else if (($storedCredential->getDeleteTime() > 0) && (int) $delete_time === 0) { |
|
184 | 184 | $activity = 'item_recovered'; |
185 | 185 | $this->activityService->add( |
186 | 186 | $activity . '_self', array($label, $this->userId), |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $this->sharingService->unshareCredential($credential->getGuid()); |
294 | 294 | foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) { |
295 | 295 | $id = $revision['revision_id']; |
296 | - if(isset($id)){ |
|
296 | + if (isset($id)) { |
|
297 | 297 | $this->credentialRevisionService->deleteRevision($id, $this->userId); |
298 | 298 | } |
299 | 299 | } |
@@ -293,7 +293,7 @@ |
||
293 | 293 | $this->sharingService->unshareCredential($credential->getGuid()); |
294 | 294 | foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) { |
295 | 295 | $id = $revision['revision_id']; |
296 | - if(isset($id)){ |
|
296 | + if(isset($id)) { |
|
297 | 297 | $this->credentialRevisionService->deleteRevision($id, $this->userId); |
298 | 298 | } |
299 | 299 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $link, $this->userId, Activity::TYPE_ITEM_ACTION); |
106 | 106 | } |
107 | 107 | |
108 | - return new JSONResponse($this->credentialService->getCredentialByGUID($credential->getGuid())); |
|
108 | + return new JSONResponse($this->credentialService->getCredentialByGUID($credential->getGuid())); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | $credential = $this->credentialService->updateCredential($credential); |
261 | 261 | |
262 | - return new JSONResponse($this->credentialService->getCredentialByGUID($credential->getGuid())); |
|
262 | + return new JSONResponse($this->credentialService->getCredentialByGUID($credential->getGuid())); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -107,10 +107,10 @@ |
||
107 | 107 | * @param string $userId |
108 | 108 | * @return File[] |
109 | 109 | */ |
110 | - public function getFilesFromUser($userId){ |
|
110 | + public function getFilesFromUser($userId) { |
|
111 | 111 | $files = $this->fileMapper->getFilesFromUser($userId); |
112 | 112 | $results = array(); |
113 | - foreach ($files as $file){ |
|
113 | + foreach ($files as $file) { |
|
114 | 114 | array_push($results, $this->encryptService->decryptFile($file)); |
115 | 115 | } |
116 | 116 | return $results; |
@@ -107,10 +107,10 @@ |
||
107 | 107 | * @param string $userId |
108 | 108 | * @return File[] |
109 | 109 | */ |
110 | - public function getFilesFromUser($userId){ |
|
110 | + public function getFilesFromUser($userId) { |
|
111 | 111 | $files = $this->fileMapper->getFilesFromUser($userId); |
112 | 112 | $results = array(); |
113 | - foreach ($files as $file){ |
|
113 | + foreach ($files as $file) { |
|
114 | 114 | array_push($results, $this->encryptService->decryptFile($file)); |
115 | 115 | } |
116 | 116 | return $results; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | |
40 | 40 | |
41 | -class DeleteVaultRequest extends Entity implements \JsonSerializable{ |
|
41 | +class DeleteVaultRequest extends Entity implements \JsonSerializable { |
|
42 | 42 | |
43 | 43 | use EntityJSONSerializer; |
44 | 44 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | |
40 | 40 | |
41 | -class DeleteVaultRequest extends Entity implements \JsonSerializable{ |
|
41 | +class DeleteVaultRequest extends Entity implements \JsonSerializable { |
|
42 | 42 | |
43 | 43 | use EntityJSONSerializer; |
44 | 44 |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | return new JSONResponse(array('success' => true)); |
110 | 110 | } |
111 | 111 | |
112 | - public function listRequests(){ |
|
112 | + public function listRequests() { |
|
113 | 113 | $requests = $this->deleteVaultRequestService->getDeleteRequests(); |
114 | 114 | $results = array(); |
115 | - foreach($requests as $request){ |
|
115 | + foreach ($requests as $request) { |
|
116 | 116 | $r = $request->jsonSerialize(); |
117 | 117 | $r['displayName'] = Utils::getNameByUid($request->getRequestedBy()); |
118 | 118 | array_push($results, $r); |
@@ -120,28 +120,28 @@ discard block |
||
120 | 120 | return new JSONResponse($results); |
121 | 121 | } |
122 | 122 | |
123 | - public function acceptRequestDeletion($vault_guid, $requested_by){ |
|
123 | + public function acceptRequestDeletion($vault_guid, $requested_by) { |
|
124 | 124 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
125 | - try{ |
|
125 | + try { |
|
126 | 126 | $vault = $this->vaultService->getByGuid($vault_guid, $requested_by); |
127 | - } catch (\Exception $e){ |
|
127 | + } catch (\Exception $e) { |
|
128 | 128 | //Ignore |
129 | 129 | } |
130 | 130 | |
131 | - if(isset($vault)){ |
|
131 | + if (isset($vault)) { |
|
132 | 132 | $credentials = $this->credentialService->getCredentialsByVaultId($vault->getId(), $requested_by); |
133 | - foreach($credentials as $credential){ |
|
133 | + foreach ($credentials as $credential) { |
|
134 | 134 | $revisions = $this->revisionService->getRevisions($credential->getId()); |
135 | - foreach($revisions as $revision){ |
|
135 | + foreach ($revisions as $revision) { |
|
136 | 136 | $this->revisionService->deleteRevision($revision['revision_id'], $requested_by); |
137 | 137 | } |
138 | - if($credential instanceof Credential){ |
|
138 | + if ($credential instanceof Credential) { |
|
139 | 139 | $this->credentialService->deleteCredential($credential); |
140 | 140 | } |
141 | 141 | } |
142 | 142 | $this->vaultService->deleteVault($vault_guid, $requested_by); |
143 | 143 | } |
144 | - if($req instanceof DeleteVaultRequest) { |
|
144 | + if ($req instanceof DeleteVaultRequest) { |
|
145 | 145 | $this->deleteVaultRequestService->removeDeleteRequestForVault($req); |
146 | 146 | } |
147 | 147 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function requestDeletion($vault_guid, $reason) { |
155 | 155 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
156 | - if($req){ |
|
156 | + if ($req) { |
|
157 | 157 | return new JSONResponse('Already exists'); |
158 | 158 | } |
159 | 159 | $vault = $this->vaultService->getByGuid($vault_guid, $this->userId); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $result = false; |
179 | 179 | try { |
180 | 180 | $delete_request = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
181 | - } catch (\Exception $exception){ |
|
181 | + } catch (\Exception $exception) { |
|
182 | 182 | // Ignore it |
183 | 183 | } |
184 | 184 |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | return new JSONResponse(array('success' => true)); |
110 | 110 | } |
111 | 111 | |
112 | - public function listRequests(){ |
|
112 | + public function listRequests() { |
|
113 | 113 | $requests = $this->deleteVaultRequestService->getDeleteRequests(); |
114 | 114 | $results = array(); |
115 | - foreach($requests as $request){ |
|
115 | + foreach($requests as $request) { |
|
116 | 116 | $r = $request->jsonSerialize(); |
117 | 117 | $r['displayName'] = Utils::getNameByUid($request->getRequestedBy()); |
118 | 118 | array_push($results, $r); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | return new JSONResponse($results); |
121 | 121 | } |
122 | 122 | |
123 | - public function acceptRequestDeletion($vault_guid, $requested_by){ |
|
123 | + public function acceptRequestDeletion($vault_guid, $requested_by) { |
|
124 | 124 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
125 | 125 | try{ |
126 | 126 | $vault = $this->vaultService->getByGuid($vault_guid, $requested_by); |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | //Ignore |
129 | 129 | } |
130 | 130 | |
131 | - if(isset($vault)){ |
|
131 | + if(isset($vault)) { |
|
132 | 132 | $credentials = $this->credentialService->getCredentialsByVaultId($vault->getId(), $requested_by); |
133 | - foreach($credentials as $credential){ |
|
133 | + foreach($credentials as $credential) { |
|
134 | 134 | $revisions = $this->revisionService->getRevisions($credential->getId()); |
135 | - foreach($revisions as $revision){ |
|
135 | + foreach($revisions as $revision) { |
|
136 | 136 | $this->revisionService->deleteRevision($revision['revision_id'], $requested_by); |
137 | 137 | } |
138 | - if($credential instanceof Credential){ |
|
138 | + if($credential instanceof Credential) { |
|
139 | 139 | $this->credentialService->deleteCredential($credential); |
140 | 140 | } |
141 | 141 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function requestDeletion($vault_guid, $reason) { |
155 | 155 | $req = $this->deleteVaultRequestService->getDeleteRequestForVault($vault_guid); |
156 | - if($req){ |
|
156 | + if($req) { |
|
157 | 157 | return new JSONResponse('Already exists'); |
158 | 158 | } |
159 | 159 | $vault = $this->vaultService->getByGuid($vault_guid, $this->userId); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param DeleteVaultRequest $request |
43 | 43 | * @return \OCP\AppFramework\Db\Entity |
44 | 44 | */ |
45 | - public function createRequest(DeleteVaultRequest $request){ |
|
45 | + public function createRequest(DeleteVaultRequest $request) { |
|
46 | 46 | return $this->insert($request); |
47 | 47 | } |
48 | 48 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * Get all delete requests |
51 | 51 | * @return \OCP\AppFramework\Db\Entity |
52 | 52 | */ |
53 | - public function getDeleteRequests(){ |
|
53 | + public function getDeleteRequests() { |
|
54 | 54 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME; |
55 | 55 | return $this->findEntities($q); |
56 | 56 | } |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @param $vault_id integer The vault id |
61 | 61 | * @return \OCP\AppFramework\Db\Entity |
62 | 62 | */ |
63 | - public function getDeleteRequestsForVault($vault_guid){ |
|
64 | - $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME .' WHERE `vault_guid` = ?'; |
|
63 | + public function getDeleteRequestsForVault($vault_guid) { |
|
64 | + $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME . ' WHERE `vault_guid` = ?'; |
|
65 | 65 | return $this->findEntity($q, [$vault_guid]); |
66 | 66 | } |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param DeleteVaultRequest $request Request to delete |
71 | 71 | * @return DeleteVaultRequest The deleted request |
72 | 72 | */ |
73 | - public function removeDeleteVaultRequest(DeleteVaultRequest $request){ |
|
73 | + public function removeDeleteVaultRequest(DeleteVaultRequest $request) { |
|
74 | 74 | return $this->delete($request); |
75 | 75 | } |
76 | 76 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param DeleteVaultRequest $request |
43 | 43 | * @return \OCP\AppFramework\Db\Entity |
44 | 44 | */ |
45 | - public function createRequest(DeleteVaultRequest $request){ |
|
45 | + public function createRequest(DeleteVaultRequest $request) { |
|
46 | 46 | return $this->insert($request); |
47 | 47 | } |
48 | 48 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * Get all delete requests |
51 | 51 | * @return \OCP\AppFramework\Db\Entity |
52 | 52 | */ |
53 | - public function getDeleteRequests(){ |
|
53 | + public function getDeleteRequests() { |
|
54 | 54 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME; |
55 | 55 | return $this->findEntities($q); |
56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param $vault_id integer The vault id |
61 | 61 | * @return \OCP\AppFramework\Db\Entity |
62 | 62 | */ |
63 | - public function getDeleteRequestsForVault($vault_guid){ |
|
63 | + public function getDeleteRequestsForVault($vault_guid) { |
|
64 | 64 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME .' WHERE `vault_guid` = ?'; |
65 | 65 | return $this->findEntity($q, [$vault_guid]); |
66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param DeleteVaultRequest $request Request to delete |
71 | 71 | * @return DeleteVaultRequest The deleted request |
72 | 72 | */ |
73 | - public function removeDeleteVaultRequest(DeleteVaultRequest $request){ |
|
73 | + public function removeDeleteVaultRequest(DeleteVaultRequest $request) { |
|
74 | 74 | return $this->delete($request); |
75 | 75 | } |
76 | 76 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function remind($credential_id) { |
47 | 47 | $credential = $this->credentialService->getCredentialById($credential_id, $this->userId); |
48 | - if($credential) { |
|
48 | + if ($credential) { |
|
49 | 49 | $credential->setExpireTime(time() + (24 * 60 * 60)); |
50 | 50 | $this->credentialService->upd($credential); |
51 | 51 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function read($credential_id) { |
65 | 65 | |
66 | 66 | $credential = $this->credentialService->getCredentialById($credential_id, $this->userId); |
67 | - if($credential) { |
|
67 | + if ($credential) { |
|
68 | 68 | $credential->setExpireTime(0); |
69 | 69 | $this->credentialService->upd($credential); |
70 | 70 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @NoAdminRequired |
91 | 91 | */ |
92 | 92 | public function generatePerson() { |
93 | - $context = [ 'http' => [ 'method' => 'GET' ], 'ssl' => [ 'verify_peer' => false, 'allow_self_signed'=> true ] ]; |
|
93 | + $context = ['http' => ['method' => 'GET'], 'ssl' => ['verify_peer' => false, 'allow_self_signed'=> true]]; |
|
94 | 94 | $context = stream_context_create($context); |
95 | 95 | $random_person = json_decode(file_get_contents('http://api.namefake.com/', false, $context)); |
96 | 96 | return new JSONResponse($random_person); |
@@ -181,7 +181,7 @@ |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | |
184 | - private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href){ |
|
184 | + private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href) { |
|
185 | 185 | if (preg_match('#<\s*link[^>]*(rel=(["\'])[^>\2]*icon[^>\2]*\2)[^>]*>#i', $htmlHead, $matches)) { |
186 | 186 | $link_tag = $matches[0]; |
187 | 187 | $this->debugInfo['link_tag'] = $link_tag; |
@@ -181,7 +181,7 @@ |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | |
184 | - private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href){ |
|
184 | + private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href) { |
|
185 | 185 | if (preg_match('#<\s*link[^>]*(rel=(["\'])[^>\2]*icon[^>\2]*\2)[^>]*>#i', $htmlHead, $matches)) { |
186 | 186 | $link_tag = $matches[0]; |
187 | 187 | $this->debugInfo['link_tag'] = $link_tag; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function getLanguageStrings() { |
42 | 42 | $translations = array( |
43 | 43 | // js/app/controllers/bookmarklet.js |
44 | - 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)','%step'), |
|
44 | + 'generating.sharing.keys' => $this->trans->t('Generating sharing keys ( %s / 2)', '%step'), |
|
45 | 45 | 'invalid.vault.key' => $this->trans->t('Incorrect vault password!'), |
46 | 46 | 'password.do.not.match' => $this->trans->t('Passwords do not match'), |
47 | 47 | 'general' => $this->trans->t('General'), |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | 'password.r' => $this->trans->t('Repeat password'), |
141 | 141 | 'add.tag' => $this->trans->t('Add tag'), |
142 | 142 | 'pick.icon' => $this->trans->t('Pick an icon'), |
143 | - 'pick.icon.search' => $this->trans->t('Search icons'), |
|
144 | - 'pick.icon.custom.label' => $this->trans->t('Upload a custom icon:'), |
|
143 | + 'pick.icon.search' => $this->trans->t('Search icons'), |
|
144 | + 'pick.icon.custom.label' => $this->trans->t('Upload a custom icon:'), |
|
145 | 145 | 'use.icon' => $this->trans->t('Use this icon'), |
146 | 146 | 'use.icon.delete' => $this->trans->t('Delete current icon'), |
147 | 147 | 'use.icon.refresh' => $this->trans->t('Get icon from page'), |
@@ -351,15 +351,15 @@ discard block |
||
351 | 351 | 'decline' => $this->trans->t('Decline'), |
352 | 352 | 'session.time.left' => $this->trans->t('You have {{session_time}} left before logout.'), |
353 | 353 | 'vault.locked' => $this->trans->t('Your vault has been locked for {{time}} because of {{tries}} failed attempts!'), |
354 | - 'vault.hint.hello' => $this->trans->t('Hello there!'), |
|
355 | - 'vault.hint.hello.add' => $this->trans->t('It does not seem that you have any passwords. Do you want to add one?'), |
|
356 | - 'vault.hint.list.nogood' => $this->trans->t('You don\'t have good credentials'), |
|
357 | - 'vault.hint.list.nomedium' => $this->trans->t('You don\'t have medium credentials'), |
|
358 | - 'vault.hint.list.nobad' => $this->trans->t('You don\'t have bad credentials'), |
|
359 | - 'vault.hint.list.noexpired' => $this->trans->t('You don\'t have expired credentials'), |
|
360 | - 'vault.hint.list.nodeleted' => $this->trans->t('You don\'t have deleted credentials'), |
|
361 | - 'vault.hint.list.notags' => $this->trans->t('There are no credentials with your selected tags'), |
|
362 | - 'vault.hint.list.nosearch' => $this->trans->t('There are no credentials matching'), |
|
354 | + 'vault.hint.hello' => $this->trans->t('Hello there!'), |
|
355 | + 'vault.hint.hello.add' => $this->trans->t('It does not seem that you have any passwords. Do you want to add one?'), |
|
356 | + 'vault.hint.list.nogood' => $this->trans->t('You don\'t have good credentials'), |
|
357 | + 'vault.hint.list.nomedium' => $this->trans->t('You don\'t have medium credentials'), |
|
358 | + 'vault.hint.list.nobad' => $this->trans->t('You don\'t have bad credentials'), |
|
359 | + 'vault.hint.list.noexpired' => $this->trans->t('You don\'t have expired credentials'), |
|
360 | + 'vault.hint.list.nodeleted' => $this->trans->t('You don\'t have deleted credentials'), |
|
361 | + 'vault.hint.list.notags' => $this->trans->t('There are no credentials with your selected tags'), |
|
362 | + 'vault.hint.list.nosearch' => $this->trans->t('There are no credentials matching'), |
|
363 | 363 | |
364 | 364 | |
365 | 365 | // templates/views/vaults.html |
@@ -405,15 +405,15 @@ discard block |
||
405 | 405 | 'deleted.credentials' => $this->trans->t('Deleted credentials'), |
406 | 406 | 'logout' => $this->trans->t('Logout'), |
407 | 407 | 'donate' => $this->trans->t('Donate'), |
408 | - 'navigation.show.all' => $this->trans->t('Show All'), |
|
409 | - 'navigation.tags' => $this->trans->t('Tags'), |
|
410 | - 'navigation.tags.search' => $this->trans->t('Search Tags'), |
|
411 | - 'navigation.strength.good' => $this->trans->t('Good Strength'), |
|
412 | - 'navigation.strength.medium' => $this->trans->t('Medium Strength'), |
|
413 | - 'navigation.strength.bad' => $this->trans->t('Bad Strength'), |
|
414 | - 'navigation.expired' => $this->trans->t('Expired'), |
|
415 | - 'navigation.advanced.filter' => $this->trans->t('Filter Tags'), |
|
416 | - 'navigation.advanced.checkbox' => $this->trans->t('Simple Navigation'), |
|
408 | + 'navigation.show.all' => $this->trans->t('Show All'), |
|
409 | + 'navigation.tags' => $this->trans->t('Tags'), |
|
410 | + 'navigation.tags.search' => $this->trans->t('Search Tags'), |
|
411 | + 'navigation.strength.good' => $this->trans->t('Good Strength'), |
|
412 | + 'navigation.strength.medium' => $this->trans->t('Medium Strength'), |
|
413 | + 'navigation.strength.bad' => $this->trans->t('Bad Strength'), |
|
414 | + 'navigation.expired' => $this->trans->t('Expired'), |
|
415 | + 'navigation.advanced.filter' => $this->trans->t('Filter Tags'), |
|
416 | + 'navigation.advanced.checkbox' => $this->trans->t('Simple Navigation'), |
|
417 | 417 | |
418 | 418 | |
419 | 419 | // templates/public_share.php |