Completed
Pull Request — master (#5231)
by Morris
16:38
created
settings/templates/users/part.userlist.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1
-<table id="userlist" class="hascontrols grid" data-groups="<?php p($_['allGroups']);?>">
1
+<table id="userlist" class="hascontrols grid" data-groups="<?php p($_['allGroups']); ?>">
2 2
 	<thead>
3 3
 		<tr>
4 4
 			<th id="headerAvatar" scope="col"></th>
5 5
 			<th id="headerName" scope="col"><?php p($l->t('Username'))?></th>
6
-			<th id="headerDisplayName" scope="col"><?php p($l->t( 'Full name' )); ?></th>
7
-			<th id="headerPassword" scope="col"><?php p($l->t( 'Password' )); ?></th>
8
-			<th class="mailAddress" scope="col"><?php p($l->t( 'Email' )); ?></th>
9
-			<th id="headerGroups" scope="col"><?php p($l->t( 'Groups' )); ?></th>
10
-		<?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
6
+			<th id="headerDisplayName" scope="col"><?php p($l->t('Full name')); ?></th>
7
+			<th id="headerPassword" scope="col"><?php p($l->t('Password')); ?></th>
8
+			<th class="mailAddress" scope="col"><?php p($l->t('Email')); ?></th>
9
+			<th id="headerGroups" scope="col"><?php p($l->t('Groups')); ?></th>
10
+		<?php if (is_array($_['subadmins']) || $_['subadmins']): ?>
11 11
 			<th id="headerSubAdmins" scope="col"><?php p($l->t('Group admin for')); ?></th>
12
-		<?php endif;?>
12
+		<?php endif; ?>
13 13
 			<th id="headerQuota" scope="col"><?php p($l->t('Quota')); ?></th>
14 14
 			<th class="storageLocation" scope="col"><?php p($l->t('Storage location')); ?></th>
15 15
 			<th class="userBackend" scope="col"><?php p($l->t('User backend')); ?></th>
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
 			<td class="groups"><div class="groupsListContainer multiselect button"
38 38
 				><span class="title groupsList"></span><span class="icon-triangle-s"></span></div>
39 39
 			</td>
40
-		<?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
40
+		<?php if (is_array($_['subadmins']) || $_['subadmins']): ?>
41 41
 			<td class="subadmins"><div class="groupsListContainer multiselect button"
42 42
 				><span class="title groupsList"></span><span class="icon-triangle-s"></span></div>
43 43
 			</td>
44
-		<?php endif;?>
44
+		<?php endif; ?>
45 45
 			<td class="quota">
46 46
 				<div class="quota_progress_container"><div class="quota_progress"></div></div>
47 47
 				<select class="quota-user" data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>">
48 48
 					<option	value='default'>
49
-						<?php p($l->t('Default'));?>
49
+						<?php p($l->t('Default')); ?>
50 50
 					</option>
51 51
 					<option value='none'>
52
-						<?php p($l->t('Unlimited'));?>
52
+						<?php p($l->t('Unlimited')); ?>
53 53
 					</option>
54
-					<?php foreach($_['quota_preset'] as $preset):?>
55
-						<option value='<?php p($preset);?>'>
56
-							<?php p($preset);?>
54
+					<?php foreach ($_['quota_preset'] as $preset):?>
55
+						<option value='<?php p($preset); ?>'>
56
+							<?php p($preset); ?>
57 57
 						</option>
58
-					<?php endforeach;?>
58
+					<?php endforeach; ?>
59 59
 					<option value='other' data-new>
60
-						<?php p($l->t('Other'));?> ...
60
+						<?php p($l->t('Other')); ?> ...
61 61
 					</option>
62 62
 				</select>
63 63
 			</td>
Please login to merge, or discard this patch.
settings/Controller/UsersController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 		if ($email !== '' && !$this->mailer->validateMailAddress($email)) {
363 363
 			return new DataResponse(
364 364
 				[
365
-					'message' => (string)$this->l10n->t('Invalid mail address')
365
+					'message' => (string) $this->l10n->t('Invalid mail address')
366 366
 				],
367 367
 				Http::STATUS_UNPROCESSABLE_ENTITY
368 368
 			);
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		if ($this->userManager->userExists($username)) {
399 399
 			return new DataResponse(
400 400
 				[
401
-					'message' => (string)$this->l10n->t('A user with that name already exists.')
401
+					'message' => (string) $this->l10n->t('A user with that name already exists.')
402 402
 				],
403 403
 				Http::STATUS_CONFLICT
404 404
 			);
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 			if ($email === '') {
410 410
 				return new DataResponse(
411 411
 					[
412
-						'message' => (string)$this->l10n->t('To send a password link to the user an email address is required.')
412
+						'message' => (string) $this->l10n->t('To send a password link to the user an email address is required.')
413 413
 					],
414 414
 					Http::STATUS_UNPROCESSABLE_ENTITY
415 415
 				);
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 			}
429 429
 			return new DataResponse(
430 430
 				[
431
-					'message' => (string)$message,
431
+					'message' => (string) $message,
432 432
 				],
433 433
 				Http::STATUS_FORBIDDEN
434 434
 			);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 					$emailTemplate = $this->newUserMailHelper->generateTemplate($user, $generatePasswordResetToken);
455 455
 					$this->newUserMailHelper->sendMail($user, $emailTemplate);
456 456
 				} catch (\Exception $e) {
457
-					$this->log->error("Can't send new user mail to $email: " . $e->getMessage(), ['app' => 'settings']);
457
+					$this->log->error("Can't send new user mail to $email: ".$e->getMessage(), ['app' => 'settings']);
458 458
 				}
459 459
 			}
460 460
 			// fetch users groups
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
 		return new DataResponse(
470 470
 			[
471
-				'message' => (string)$this->l10n->t('Unable to create user.')
471
+				'message' => (string) $this->l10n->t('Unable to create user.')
472 472
 			],
473 473
 			Http::STATUS_FORBIDDEN
474 474
 		);
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 				[
492 492
 					'status' => 'error',
493 493
 					'data' => [
494
-						'message' => (string)$this->l10n->t('Unable to delete user.')
494
+						'message' => (string) $this->l10n->t('Unable to delete user.')
495 495
 					]
496 496
 				],
497 497
 				Http::STATUS_FORBIDDEN
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 				[
504 504
 					'status' => 'error',
505 505
 					'data' => [
506
-						'message' => (string)$this->l10n->t('Authentication error')
506
+						'message' => (string) $this->l10n->t('Authentication error')
507 507
 					]
508 508
 				],
509 509
 				Http::STATUS_FORBIDDEN
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 			[
529 529
 				'status' => 'error',
530 530
 				'data' => [
531
-					'message' => (string)$this->l10n->t('Unable to delete user.')
531
+					'message' => (string) $this->l10n->t('Unable to delete user.')
532 532
 				]
533 533
 			],
534 534
 			Http::STATUS_FORBIDDEN
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
 	 * @return DataResponse
544 544
 	 */
545 545
 	public function setEnabled($id, $enabled) {
546
-		$enabled = (bool)$enabled;
546
+		$enabled = (bool) $enabled;
547 547
 		if ($enabled) {
548
-			$errorMsgGeneral = (string)$this->l10n->t('Error while enabling user.');
548
+			$errorMsgGeneral = (string) $this->l10n->t('Error while enabling user.');
549 549
 		} else {
550
-			$errorMsgGeneral = (string)$this->l10n->t('Error while disabling user.');
550
+			$errorMsgGeneral = (string) $this->l10n->t('Error while disabling user.');
551 551
 		}
552 552
 
553 553
 		$userId = $this->userSession->getUser()->getUID();
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 					[
571 571
 						'status' => 'error',
572 572
 						'data' => [
573
-							'message' => (string)$this->l10n->t('Authentication error')
573
+							'message' => (string) $this->l10n->t('Authentication error')
574 574
 						]
575 575
 					],
576 576
 					Http::STATUS_FORBIDDEN
@@ -622,11 +622,11 @@  discard block
 block discarded – undo
622 622
 
623 623
 		$accountData = $this->accountManager->getUser($user);
624 624
 		$cloudId = $user->getCloudId();
625
-		$message = "Use my Federated Cloud ID to share with me: " . $cloudId;
625
+		$message = "Use my Federated Cloud ID to share with me: ".$cloudId;
626 626
 		$signature = $this->signMessage($user, $message);
627 627
 
628
-		$code = $message . ' ' . $signature;
629
-		$codeMd5 = $message . ' ' . md5($signature);
628
+		$code = $message.' '.$signature;
629
+		$codeMd5 = $message.' '.md5($signature);
630 630
 
631 631
 		switch ($account) {
632 632
 			case 'verify-twitter':
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 				[
732 732
 					'status' => 'error',
733 733
 					'data' => [
734
-						'message' => (string)$this->l10n->t('Invalid mail address')
734
+						'message' => (string) $this->l10n->t('Invalid mail address')
735 735
 					]
736 736
 				],
737 737
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 						'websiteScope' => $data[AccountManager::PROPERTY_WEBSITE]['scope'],
776 776
 						'address' => $data[AccountManager::PROPERTY_ADDRESS]['value'],
777 777
 						'addressScope' => $data[AccountManager::PROPERTY_ADDRESS]['scope'],
778
-						'message' => (string)$this->l10n->t('Settings saved')
778
+						'message' => (string) $this->l10n->t('Settings saved')
779 779
 					]
780 780
 				],
781 781
 				Http::STATUS_OK
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 				[
947 947
 					'status' => 'error',
948 948
 					'data' => [
949
-						'message' => (string)$this->l10n->t('Forbidden')
949
+						'message' => (string) $this->l10n->t('Forbidden')
950 950
 					]
951 951
 				],
952 952
 				Http::STATUS_FORBIDDEN
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 				[
959 959
 					'status' => 'error',
960 960
 					'data' => [
961
-						'message' => (string)$this->l10n->t('Invalid mail address')
961
+						'message' => (string) $this->l10n->t('Invalid mail address')
962 962
 					]
963 963
 				],
964 964
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 				[
971 971
 					'status' => 'error',
972 972
 					'data' => [
973
-						'message' => (string)$this->l10n->t('Invalid user')
973
+						'message' => (string) $this->l10n->t('Invalid user')
974 974
 					]
975 975
 				],
976 976
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
 				[
984 984
 					'status' => 'error',
985 985
 					'data' => [
986
-						'message' => (string)$this->l10n->t('Unable to change mail address')
986
+						'message' => (string) $this->l10n->t('Unable to change mail address')
987 987
 					]
988 988
 				],
989 989
 				Http::STATUS_FORBIDDEN
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 					'data' => [
1002 1002
 						'username' => $id,
1003 1003
 						'mailAddress' => $mailAddress,
1004
-						'message' => (string)$this->l10n->t('Email saved')
1004
+						'message' => (string) $this->l10n->t('Email saved')
1005 1005
 					]
1006 1006
 				],
1007 1007
 				Http::STATUS_OK
Please login to merge, or discard this patch.
lib/private/Files/Config/UserMountCache.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 
88 88
 	public function registerMounts(IUser $user, array $mounts) {
89 89
 		// filter out non-proper storages coming from unit tests
90
-		$mounts = array_filter($mounts, function (IMountPoint $mount) {
90
+		$mounts = array_filter($mounts, function(IMountPoint $mount) {
91 91
 			return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
92 92
 		});
93 93
 		/** @var ICachedMountInfo[] $newMounts */
94
-		$newMounts = array_map(function (IMountPoint $mount) use ($user) {
94
+		$newMounts = array_map(function(IMountPoint $mount) use ($user) {
95 95
 			// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
96 96
 			if ($mount->getStorageRootId() === -1) {
97 97
 				return null;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		$newMounts = array_values(array_filter($newMounts));
103 103
 
104 104
 		$cachedMounts = $this->getMountsForUser($user);
105
-		$mountDiff = function (ICachedMountInfo $mount1, ICachedMountInfo $mount2) {
105
+		$mountDiff = function(ICachedMountInfo $mount1, ICachedMountInfo $mount2) {
106 106
 			// since we are only looking for mounts for a specific user comparing on root id is enough
107 107
 			return $mount1->getRootId() - $mount2->getRootId();
108 108
 		};
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			], ['root_id', 'user_id']);
164 164
 		} else {
165 165
 			// in some cases this is legitimate, like orphaned shares
166
-			$this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint());
166
+			$this->logger->debug('Could not get storage info for mount at '.$mount->getMountPoint());
167 167
 		}
168 168
 	}
169 169
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		if (is_null($user)) {
195 195
 			return null;
196 196
 		}
197
-		return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path']) ? $row['path'] : '');
197
+		return new CachedMountInfo($user, (int) $row['storage_id'], (int) $row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path']) ? $row['path'] : '');
198 198
 	}
199 199
 
200 200
 	/**
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 			$row = $query->execute()->fetch();
269 269
 			if (is_array($row)) {
270 270
 				$this->cacheInfoCache[$fileId] = [
271
-					(int)$row['storage'],
271
+					(int) $row['storage'],
272 272
 					$row['path'],
273
-					(int)$row['mimetype']
273
+					(int) $row['mimetype']
274 274
 				];
275 275
 			} else {
276
-				throw new NotFoundException('File with id "' . $fileId . '" not found');
276
+				throw new NotFoundException('File with id "'.$fileId.'" not found');
277 277
 			}
278 278
 		}
279 279
 		return $this->cacheInfoCache[$fileId];
@@ -294,13 +294,13 @@  discard block
 block discarded – undo
294 294
 		$mountsForStorage = $this->getMountsForStorageId($storageId, $user);
295 295
 
296 296
 		// filter mounts that are from the same storage but a different directory
297
-		return array_filter($mountsForStorage, function (ICachedMountInfo $mount) use ($internalPath, $fileId) {
297
+		return array_filter($mountsForStorage, function(ICachedMountInfo $mount) use ($internalPath, $fileId) {
298 298
 			if ($fileId === $mount->getRootId()) {
299 299
 				return true;
300 300
 			}
301 301
 			$internalMountPath = $mount->getRootInternalPath();
302 302
 
303
-			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath . '/';
303
+			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath.'/';
304 304
 		});
305 305
 	}
306 306
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 			$slash
345 345
 		);
346 346
 
347
-		$userIds = array_map(function (IUser $user) {
347
+		$userIds = array_map(function(IUser $user) {
348 348
 			return $user->getUID();
349 349
 		}, $users);
350 350
 
Please login to merge, or discard this patch.