Completed
Pull Request — master (#151)
by Sander
02:35
created
templates/settings-admin.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		$versions = $element->getElementsByTagName("version");
17 17
 		$version = $versions->item(0)->nodeValue;
18 18
 	}
19
-	if($version) {
19
+	if ($version) {
20 20
 		$githubVersion = $version;
21 21
 	}
22 22
 	$AppInstance = new App();
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		Github version: <?php p($githubVersion); ?><br />
31 31
 		Local version: <?php p($localVersion); ?><br />
32 32
 		<?php
33
-		if(version_compare($githubVersion, $localVersion) === 1){
33
+		if (version_compare($githubVersion, $localVersion) === 1) {
34 34
 			p($l->t('A newer version of passman is available'));
35 35
 		}
36 36
 		?>
Please login to merge, or discard this patch.
Braces   +21 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		Github version: <?php p($githubVersion); ?><br />
31 31
 		Local version: <?php p($localVersion); ?><br />
32 32
 		<?php
33
-		if(version_compare($githubVersion, $localVersion) === 1){
33
+		if(version_compare($githubVersion, $localVersion) === 1) {
34 34
 			p($l->t('A newer version of passman is available'));
35 35
 		}
36 36
 		?>
@@ -47,7 +47,10 @@  discard block
 block discarded – undo
47 47
 		<p>
48 48
 			<input type="checkbox" name="passman_sharing_enabled"
49 49
 				   id="passman_sharing_enabled" class="checkbox"
50
-				   value="1" <?php if ($_['user_sharing_enabled']) print_unescaped('checked="checked"'); ?> />
50
+				   value="1" <?php if ($_['user_sharing_enabled']) {
51
+	print_unescaped('checked="checked"');
52
+}
53
+?> />
51 54
 			<label for="passman_sharing_enabled">
52 55
 				<?php p($l->t('Allow users on this server to share passwords with other users')); ?>
53 56
 			</label>
@@ -80,16 +83,28 @@  discard block
 block discarded – undo
80 83
 		<p>
81 84
 			<label for="vault_key_strength">Minimum vault key strength:</label>
82 85
 			<select name="vault_key_strength" id="vault_key_strength">
83
-				<option value="1" <?php if ($_['vault_key_strength'] === 1) print_unescaped('selected="selected"'); ?>>
86
+				<option value="1" <?php if ($_['vault_key_strength'] === 1) {
87
+	print_unescaped('selected="selected"');
88
+}
89
+?>>
84 90
 					Poor
85 91
 				</option>
86
-				<option value="2" <?php if ($_['vault_key_strength'] === 2) print_unescaped('selected="selected"'); ?>>
92
+				<option value="2" <?php if ($_['vault_key_strength'] === 2) {
93
+	print_unescaped('selected="selected"');
94
+}
95
+?>>
87 96
 					Weak
88 97
 				</option>
89
-				<option value="3" <?php if ($_['vault_key_strength'] === 3) print_unescaped('selected="selected"'); ?>>
98
+				<option value="3" <?php if ($_['vault_key_strength'] === 3) {
99
+	print_unescaped('selected="selected"');
100
+}
101
+?>>
90 102
 					Good
91 103
 				</option>
92
-				<option value="4" <?php if ($_['vault_key_strength'] === 4) print_unescaped('selected="selected"'); ?>>
104
+				<option value="4" <?php if ($_['vault_key_strength'] === 4) {
105
+	print_unescaped('selected="selected"');
106
+}
107
+?>>
93 108
 					Strong
94 109
 				</option>
95 110
 			</select>
Please login to merge, or discard this patch.
controller/internalcontroller.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 								$UserId,
29 29
 								CredentialService $credentialService,
30 30
 								IConfig $config
31
-                                ) {
31
+								) {
32 32
 		parent::__construct($AppName, $request);
33 33
 		$this->userId = $UserId;
34 34
 		$this->credentialService = $credentialService;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 	 * @NoCSRFRequired
106 106
 	 */
107 107
 	public function saveSettings($key, $value) {
108
-		if(is_numeric($value)){
108
+		if (is_numeric($value)) {
109 109
 			$value = intval($value);
110 110
 		}
111 111
 		$this->config->setAppValue('passman', $key, $value);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 	 * @NoCSRFRequired
106 106
 	 */
107 107
 	public function saveSettings($key, $value) {
108
-		if(is_numeric($value)){
108
+		if(is_numeric($value)) {
109 109
 			$value = intval($value);
110 110
 		}
111 111
 		$this->config->setAppValue('passman', $key, $value);
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
 				$server->getUserManager(),
69 69
  				$c->query('ActivityService'),
70 70
  				$c->query('VaultService'),
71
-                $c->query('ShareService'),
72
-                $c->query('CredentialService'),
73
-                $c->query('NotificationService'),
74
-                $c->query('FileService'),
75
-                $c->query('IConfig')
71
+				$c->query('ShareService'),
72
+				$c->query('CredentialService'),
73
+				$c->query('NotificationService'),
74
+				$c->query('FileService'),
75
+				$c->query('IConfig')
76 76
 			);
77 77
 		});
78 78
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		$container->registerAlias('ActivityService', ActivityService::class);
109 109
 		$container->registerAlias('VaultService', VaultService::class);
110 110
 		$container->registerAlias('FileService', FileService::class);
111
-        $container->registerAlias('ShareService', ShareService::class);
111
+		$container->registerAlias('ShareService', ShareService::class);
112 112
 		$container->registerAlias('Utils', Utils::class);
113 113
 		$container->registerAlias('IDBConnection', IDBConnection::class);
114 114
 		$container->registerAlias('IConfig', IConfig::class);
Please login to merge, or discard this patch.
controller/sharecontroller.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 	 * @NoCSRFRequired
86 86
 	 */
87 87
 	public function createPublicShare($item_id, $item_guid, $permissions, $expire_timestamp, $expire_views) {
88
-		if($this->config->getAppValue('passman', 'link_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'link_sharing_enabled', 1) === '0'){
88
+		if ($this->config->getAppValue('passman', 'link_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'link_sharing_enabled', 1) === '0') {
89 89
 			return new JSONResponse(array());
90 90
 		}
91 91
 
92 92
 
93
-		try{
93
+		try {
94 94
 			$credential = $this->credentialService->getCredentialByGUID($item_guid);
95
-		} catch (DoesNotExistException $exception){
95
+		} catch (DoesNotExistException $exception) {
96 96
 			return new NotFoundResponse();
97 97
 		}
98 98
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @NoCSRFRequired
127 127
 	 */
128 128
 	public function applyIntermediateShare($item_id, $item_guid, $vaults, $permissions) {
129
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
129
+		if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
130 130
 			return new JSONResponse(array());
131 131
 		}
132 132
 		/**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @NoCSRFRequired
222 222
 	 */
223 223
 	public function unshareCredential($item_guid) {
224
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
224
+		if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
225 225
 			return new JSONResponse(array());
226 226
 		}
227 227
 		$acl_list = $this->shareService->getCredentialAclList($item_guid);
@@ -242,21 +242,21 @@  discard block
 block discarded – undo
242 242
 	}
243 243
 
244 244
 
245
-	public function unshareCredentialFromUser($item_guid, $user_id){
245
+	public function unshareCredentialFromUser($item_guid, $user_id) {
246 246
 		$acl = null;
247 247
 		$sr = null;
248 248
 		try {
249 249
 			$acl = $this->shareService->getCredentialAclForUser($user_id, $item_guid);
250
-		} catch (DoesNotExistException $e){
250
+		} catch (DoesNotExistException $e) {
251 251
 
252 252
 		}
253
-		try{
254
-			$sr =  array_pop($this->shareService->getPendingShareRequestsForCredential($item_guid, $user_id));
255
-		} catch (DoesNotExistException $e){
253
+		try {
254
+			$sr = array_pop($this->shareService->getPendingShareRequestsForCredential($item_guid, $user_id));
255
+		} catch (DoesNotExistException $e) {
256 256
 
257 257
 		}
258 258
 
259
-		if($sr){
259
+		if ($sr) {
260 260
 			$this->shareService->cleanItemRequestsForUser($sr);
261 261
 			$manager = \OC::$server->getNotificationManager();
262 262
 			$notification = $manager->createNotification();
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 				->setUser($user_id);
266 266
 			$manager->markProcessed($notification);
267 267
 		}
268
-		if($acl){
268
+		if ($acl) {
269 269
 			$this->shareService->deleteShareACL($acl);
270 270
 		}
271 271
 		return new JSONResponse(array('result' => true));
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 * @NoCSRFRequired
375 375
 	 */
376 376
 	public function getVaultItems($vault_guid) {
377
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
377
+		if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
378 378
 			return new JSONResponse(array());
379 379
 		}
380 380
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	 * @PublicPage
429 429
 	 */
430 430
 	public function getPublicCredentialData($credential_guid) {
431
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
431
+		if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
432 432
 			return new NotFoundJSONResponse();
433 433
 		}
434 434
 		//@TODO Check expire date
@@ -489,15 +489,15 @@  discard block
 block discarded – undo
489 489
 	 * @return JSONResponse
490 490
 	 * @return NotFoundResponse
491 491
 	 */
492
-	public function getFile($item_guid, $file_guid){
492
+	public function getFile($item_guid, $file_guid) {
493 493
 		try {
494 494
 			$credential = $this->credentialService->getCredentialByGUID($item_guid);
495
-		} catch (DoesNotExistException $e){
495
+		} catch (DoesNotExistException $e) {
496 496
 			return new NotFoundJSONResponse();
497 497
 		}
498 498
 		$userId = ($this->userId) ? $this->userId->getUID() : null;
499 499
 		$acl = $this->shareService->getACL($userId, $credential->getGuid());
500
-		if (!$acl->hasPermission(SharingACL::FILES)){
500
+		if (!$acl->hasPermission(SharingACL::FILES)) {
501 501
 			return new NotFoundJSONResponse();
502 502
 		} else {
503 503
 			return $this->fileService->getFileByGuid($file_guid);
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @NoCSRFRequired
86 86
 	 */
87 87
 	public function createPublicShare($item_id, $item_guid, $permissions, $expire_timestamp, $expire_views) {
88
-		if($this->config->getAppValue('passman', 'link_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'link_sharing_enabled', 1) === '0'){
88
+		if($this->config->getAppValue('passman', 'link_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'link_sharing_enabled', 1) === '0') {
89 89
 			return new JSONResponse(array());
90 90
 		}
91 91
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @NoCSRFRequired
127 127
 	 */
128 128
 	public function applyIntermediateShare($item_id, $item_guid, $vaults, $permissions) {
129
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
129
+		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
130 130
 			return new JSONResponse(array());
131 131
 		}
132 132
 		/**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @NoCSRFRequired
222 222
 	 */
223 223
 	public function unshareCredential($item_guid) {
224
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
224
+		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
225 225
 			return new JSONResponse(array());
226 226
 		}
227 227
 		$acl_list = $this->shareService->getCredentialAclList($item_guid);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	}
243 243
 
244 244
 
245
-	public function unshareCredentialFromUser($item_guid, $user_id){
245
+	public function unshareCredentialFromUser($item_guid, $user_id) {
246 246
 		$acl = null;
247 247
 		$sr = null;
248 248
 		try {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
 		}
258 258
 
259
-		if($sr){
259
+		if($sr) {
260 260
 			$this->shareService->cleanItemRequestsForUser($sr);
261 261
 			$manager = \OC::$server->getNotificationManager();
262 262
 			$notification = $manager->createNotification();
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 				->setUser($user_id);
266 266
 			$manager->markProcessed($notification);
267 267
 		}
268
-		if($acl){
268
+		if($acl) {
269 269
 			$this->shareService->deleteShareACL($acl);
270 270
 		}
271 271
 		return new JSONResponse(array('result' => true));
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 * @NoCSRFRequired
375 375
 	 */
376 376
 	public function getVaultItems($vault_guid) {
377
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
377
+		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
378 378
 			return new JSONResponse(array());
379 379
 		}
380 380
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	 * @PublicPage
429 429
 	 */
430 430
 	public function getPublicCredentialData($credential_guid) {
431
-		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
431
+		if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
432 432
 			return new NotFoundJSONResponse();
433 433
 		}
434 434
 		//@TODO Check expire date
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	 * @return JSONResponse
490 490
 	 * @return NotFoundResponse
491 491
 	 */
492
-	public function getFile($item_guid, $file_guid){
492
+	public function getFile($item_guid, $file_guid) {
493 493
 		try {
494 494
 			$credential = $this->credentialService->getCredentialByGUID($item_guid);
495 495
 		} catch (DoesNotExistException $e){
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 		}
498 498
 		$userId = ($this->userId) ? $this->userId->getUID() : null;
499 499
 		$acl = $this->shareService->getACL($userId, $credential->getGuid());
500
-		if (!$acl->hasPermission(SharingACL::FILES)){
500
+		if (!$acl->hasPermission(SharingACL::FILES)) {
501 501
 			return new NotFoundJSONResponse();
502 502
 		} else {
503 503
 			return $this->fileService->getFileByGuid($file_guid);
Please login to merge, or discard this patch.
controller/credentialcontroller.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		);
90 90
 		$credential = $this->credentialService->createCredential($credential);
91 91
 		$link = ''; // @TODO create direct link to credential
92
-		if(!$credential->getHidden()) {
92
+		if (!$credential->getHidden()) {
93 93
 			$this->activityService->add(
94 94
 				Activity::SUBJECT_ITEM_CREATED_SELF, array($label, $this->userId),
95 95
 				'', array(),
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			} else {
151 151
 				return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
152 152
 			}
153
-			if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
153
+			if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
154 154
 				return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
155 155
 			}
156 156
 		}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 			foreach ($acl_list as $sharingACL) {
214 214
 				$target_user = $sharingACL->getUserId();
215
-				if($target_user === $this->userId){
215
+				if ($target_user === $this->userId) {
216 216
 					continue;
217 217
 				}
218 218
 				$this->activityService->add(
@@ -227,15 +227,15 @@  discard block
 block discarded – undo
227 227
 					$link, $storedCredential->getUserId(), Activity::TYPE_ITEM_ACTION);
228 228
 			}
229 229
 		}
230
-		if($set_share_key === true){
230
+		if ($set_share_key === true) {
231 231
 			$storedCredential->setSharedKey($shared_key);
232 232
 			$credential['shared_key'] = $shared_key;
233 233
 		}
234
-		if($unshare_action === true){
234
+		if ($unshare_action === true) {
235 235
 			$storedCredential->setSharedKey('');
236 236
 			$credential['shared_key'] = '';
237 237
 		}
238
-		if(!$skip_revision) {
238
+		if (!$skip_revision) {
239 239
 			$this->credentialRevisionService->createRevision($storedCredential, $storedCredential->getUserId(), $credential_id, $this->userId);
240 240
 		}
241 241
 		$credential = $this->credentialService->updateCredential($credential);
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	    try {
271 271
             $credential = $this->credentialService->getCredentialByGUID($credential_guid);
272 272
         }
273
-        catch (DoesNotExistException $ex){
273
+        catch (DoesNotExistException $ex) {
274 274
             return new NotFoundJSONResponse();
275 275
         }
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         }
281 281
         else {
282 282
             $acl = $this->sharingService->getACL($this->userId, $credential_guid);
283
-            if ($acl->hasPermission(SharingACL::HISTORY)){
283
+            if ($acl->hasPermission(SharingACL::HISTORY)) {
284 284
                 $result = $this->credentialRevisionService->getRevisions($credential->getId());
285 285
             }
286 286
             else {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	 * @NoAdminRequired
305 305
 	 * @NoCSRFRequired
306 306
 	 */
307
-	public function updateRevision($credential_guid, $revision_id, $credential_data){
307
+	public function updateRevision($credential_guid, $revision_id, $credential_data) {
308 308
 		$revision = null;
309 309
 		try {
310 310
 			$this->credentialService->getCredentialByGUID($credential_guid, $this->userId);
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
 			return new NotFoundJSONResponse();
313 313
 		}
314 314
 
315
-		try{
315
+		try {
316 316
 			$revision = $this->credentialRevisionService->getRevision($revision_id);
317
-		} catch(DoesNotExistException $exception){
317
+		} catch (DoesNotExistException $exception) {
318 318
 			return new NotFoundJSONResponse();
319 319
 		}
320 320
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -12 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			} else {
151 151
 				return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
152 152
 			}
153
-			if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0'){
153
+			if($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
154 154
 				return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
155 155
 			}
156 156
 		}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 			foreach ($acl_list as $sharingACL) {
214 214
 				$target_user = $sharingACL->getUserId();
215
-				if($target_user === $this->userId){
215
+				if($target_user === $this->userId) {
216 216
 					continue;
217 217
 				}
218 218
 				$this->activityService->add(
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
 					$link, $storedCredential->getUserId(), Activity::TYPE_ITEM_ACTION);
228 228
 			}
229 229
 		}
230
-		if($set_share_key === true){
230
+		if($set_share_key === true) {
231 231
 			$storedCredential->setSharedKey($shared_key);
232 232
 			$credential['shared_key'] = $shared_key;
233 233
 		}
234
-		if($unshare_action === true){
234
+		if($unshare_action === true) {
235 235
 			$storedCredential->setSharedKey('');
236 236
 			$credential['shared_key'] = '';
237 237
 		}
@@ -269,21 +269,18 @@  discard block
 block discarded – undo
269 269
 	public function getRevision($credential_guid) {
270 270
 	    try {
271 271
             $credential = $this->credentialService->getCredentialByGUID($credential_guid);
272
-        }
273
-        catch (DoesNotExistException $ex){
272
+        } catch (DoesNotExistException $ex){
274 273
             return new NotFoundJSONResponse();
275 274
         }
276 275
 
277 276
         // If the request was made by the owner of the credential
278 277
         if ($this->userId === $credential->getUserId()) {
279 278
             $result = $this->credentialRevisionService->getRevisions($credential->getId(), $this->userId);
280
-        }
281
-        else {
279
+        } else {
282 280
             $acl = $this->sharingService->getACL($this->userId, $credential_guid);
283
-            if ($acl->hasPermission(SharingACL::HISTORY)){
281
+            if ($acl->hasPermission(SharingACL::HISTORY)) {
284 282
                 $result = $this->credentialRevisionService->getRevisions($credential->getId());
285
-            }
286
-            else {
283
+            } else {
287 284
                 return new NotFoundJSONResponse();
288 285
             }
289 286
         }
@@ -304,7 +301,7 @@  discard block
 block discarded – undo
304 301
 	 * @NoAdminRequired
305 302
 	 * @NoCSRFRequired
306 303
 	 */
307
-	public function updateRevision($credential_guid, $revision_id, $credential_data){
304
+	public function updateRevision($credential_guid, $revision_id, $credential_data) {
308 305
 		$revision = null;
309 306
 		try {
310 307
 			$this->credentialService->getCredentialByGUID($credential_guid, $this->userId);
Please login to merge, or discard this patch.