Completed
Pull Request — master (#3869)
by Jan-Christoph
17:04
created
settings/Controller/UsersController.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 		// check for encryption state - TODO see formatUserForIndex
159 159
 		$this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption');
160
-		if($this->isEncryptionAppEnabled) {
160
+		if ($this->isEncryptionAppEnabled) {
161 161
 			// putting this directly in empty is possible in PHP 5.5+
162 162
 			$result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0);
163 163
 			$this->isRestoreEnabled = !empty($result);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		}
198 198
 
199 199
 		$subAdminGroups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($user);
200
-		foreach($subAdminGroups as $key => $subAdminGroup) {
200
+		foreach ($subAdminGroups as $key => $subAdminGroup) {
201 201
 			$subAdminGroups[$key] = $subAdminGroup->getGID();
202 202
 		}
203 203
 
@@ -254,16 +254,16 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function index($offset = 0, $limit = 10, $gid = '', $pattern = '', $backend = '') {
256 256
 		// FIXME: The JS sends the group '_everyone' instead of no GID for the "all users" group.
257
-		if($gid === '_everyone') {
257
+		if ($gid === '_everyone') {
258 258
 			$gid = '';
259 259
 		}
260 260
 
261 261
 		// Remove backends
262
-		if(!empty($backend)) {
262
+		if (!empty($backend)) {
263 263
 			$activeBackends = $this->userManager->getBackends();
264 264
 			$this->userManager->clearBackends();
265
-			foreach($activeBackends as $singleActiveBackend) {
266
-				if($backend === get_class($singleActiveBackend)) {
265
+			foreach ($activeBackends as $singleActiveBackend) {
266
+				if ($backend === get_class($singleActiveBackend)) {
267 267
 					$this->userManager->registerBackend($singleActiveBackend);
268 268
 					break;
269 269
 				}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		$users = [];
274 274
 		if ($this->isAdmin) {
275 275
 
276
-			if($gid !== '') {
276
+			if ($gid !== '') {
277 277
 				$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
278 278
 			} else {
279 279
 				$batch = $this->userManager->search($pattern, $limit, $offset);
@@ -293,17 +293,17 @@  discard block
 block discarded – undo
293 293
 			$subAdminOfGroups = $gids;
294 294
 
295 295
 			// Set the $gid parameter to an empty value if the subadmin has no rights to access a specific group
296
-			if($gid !== '' && !in_array($gid, $subAdminOfGroups)) {
296
+			if ($gid !== '' && !in_array($gid, $subAdminOfGroups)) {
297 297
 				$gid = '';
298 298
 			}
299 299
 
300 300
 			// Batch all groups the user is subadmin of when a group is specified
301 301
 			$batch = [];
302
-			if($gid === '') {
303
-				foreach($subAdminOfGroups as $group) {
302
+			if ($gid === '') {
303
+				foreach ($subAdminOfGroups as $group) {
304 304
 					$groupUsers = $this->groupManager->displayNamesInGroup($group, $pattern, $limit, $offset);
305 305
 
306
-					foreach($groupUsers as $uid => $displayName) {
306
+					foreach ($groupUsers as $uid => $displayName) {
307 307
 						$batch[$uid] = $displayName;
308 308
 					}
309 309
 				}
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
 	 * @param string $email
336 336
 	 * @return DataResponse
337 337
 	 */
338
-	public function create($username, $password, array $groups=array(), $email='') {
339
-		if($email !== '' && !$this->mailer->validateMailAddress($email)) {
338
+	public function create($username, $password, array $groups = array(), $email = '') {
339
+		if ($email !== '' && !$this->mailer->validateMailAddress($email)) {
340 340
 			return new DataResponse(
341 341
 				array(
342
-					'message' => (string)$this->l10n->t('Invalid mail address')
342
+					'message' => (string) $this->l10n->t('Invalid mail address')
343 343
 				),
344 344
 				Http::STATUS_UNPROCESSABLE_ENTITY
345 345
 			);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 			if (!empty($groups)) {
352 352
 				foreach ($groups as $key => $group) {
353 353
 					$groupObject = $this->groupManager->get($group);
354
-					if($groupObject === null) {
354
+					if ($groupObject === null) {
355 355
 						unset($groups[$key]);
356 356
 						continue;
357 357
 					}
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 		if ($this->userManager->userExists($username)) {
376 376
 			return new DataResponse(
377 377
 				array(
378
-					'message' => (string)$this->l10n->t('A user with that name already exists.')
378
+					'message' => (string) $this->l10n->t('A user with that name already exists.')
379 379
 				),
380 380
 				Http::STATUS_CONFLICT
381 381
 			);
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			if ($email === '') {
387 387
 				return new DataResponse(
388 388
 					array(
389
-						'message' => (string)$this->l10n->t('To send a password link to the user an email address is required.')
389
+						'message' => (string) $this->l10n->t('To send a password link to the user an email address is required.')
390 390
 					),
391 391
 					Http::STATUS_UNPROCESSABLE_ENTITY
392 392
 				);
@@ -411,12 +411,12 @@  discard block
 block discarded – undo
411 411
 			);
412 412
 		}
413 413
 
414
-		if($user instanceof IUser) {
415
-			if($groups !== null) {
416
-				foreach($groups as $groupName) {
414
+		if ($user instanceof IUser) {
415
+			if ($groups !== null) {
416
+				foreach ($groups as $groupName) {
417 417
 					$group = $this->groupManager->get($groupName);
418 418
 
419
-					if(empty($group)) {
419
+					if (empty($group)) {
420 420
 						$group = $this->groupManager->createGroup($groupName);
421 421
 					}
422 422
 					$group->addUser($user);
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
 			/**
426 426
 			 * Send new user mail only if a mail is set
427 427
 			 */
428
-			if($email !== '') {
428
+			if ($email !== '') {
429 429
 				$user->setEMailAddress($email);
430 430
 				try {
431 431
 					$emailTemplate = $this->newUserMailHelper->generateTemplate($user, $generatePasswordResetToken);
432 432
 					$this->newUserMailHelper->sendMail($user, $emailTemplate);
433
-				} catch(\Exception $e) {
434
-					$this->log->error("Can't send new user mail to $email: " . $e->getMessage(), array('app' => 'settings'));
433
+				} catch (\Exception $e) {
434
+					$this->log->error("Can't send new user mail to $email: ".$e->getMessage(), array('app' => 'settings'));
435 435
 				}
436 436
 			}
437 437
 			// fetch users groups
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
 		return new DataResponse(
447 447
 			array(
448
-				'message' => (string)$this->l10n->t('Unable to create user.')
448
+				'message' => (string) $this->l10n->t('Unable to create user.')
449 449
 			),
450 450
 			Http::STATUS_FORBIDDEN
451 451
 		);
@@ -463,32 +463,32 @@  discard block
 block discarded – undo
463 463
 		$userId = $this->userSession->getUser()->getUID();
464 464
 		$user = $this->userManager->get($id);
465 465
 
466
-		if($userId === $id) {
466
+		if ($userId === $id) {
467 467
 			return new DataResponse(
468 468
 				array(
469 469
 					'status' => 'error',
470 470
 					'data' => array(
471
-						'message' => (string)$this->l10n->t('Unable to delete user.')
471
+						'message' => (string) $this->l10n->t('Unable to delete user.')
472 472
 					)
473 473
 				),
474 474
 				Http::STATUS_FORBIDDEN
475 475
 			);
476 476
 		}
477 477
 
478
-		if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
478
+		if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
479 479
 			return new DataResponse(
480 480
 				array(
481 481
 					'status' => 'error',
482 482
 					'data' => array(
483
-						'message' => (string)$this->l10n->t('Authentication error')
483
+						'message' => (string) $this->l10n->t('Authentication error')
484 484
 					)
485 485
 				),
486 486
 				Http::STATUS_FORBIDDEN
487 487
 			);
488 488
 		}
489 489
 
490
-		if($user) {
491
-			if($user->delete()) {
490
+		if ($user) {
491
+			if ($user->delete()) {
492 492
 				return new DataResponse(
493 493
 					array(
494 494
 						'status' => 'success',
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 			array(
506 506
 				'status' => 'error',
507 507
 				'data' => array(
508
-					'message' => (string)$this->l10n->t('Unable to delete user.')
508
+					'message' => (string) $this->l10n->t('Unable to delete user.')
509 509
 				)
510 510
 			),
511 511
 			Http::STATUS_FORBIDDEN
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
 
531 531
 		$accountData = $this->accountManager->getUser($user);
532 532
 		$cloudId = $user->getCloudId();
533
-		$message = "Use my Federated Cloud ID to share with me: " . $cloudId;
533
+		$message = "Use my Federated Cloud ID to share with me: ".$cloudId;
534 534
 		$signature = $this->signMessage($user, $message);
535 535
 
536
-		$code = $message . ' ' . $signature;
537
-		$codeMd5 = $message . ' ' . md5($signature);
536
+		$code = $message.' '.$signature;
537
+		$codeMd5 = $message.' '.md5($signature);
538 538
 
539 539
 		switch ($account) {
540 540
 			case 'verify-twitter':
@@ -631,12 +631,12 @@  discard block
 block discarded – undo
631 631
 									$twitterScope
632 632
 	) {
633 633
 
634
-		if(!empty($email) && !$this->mailer->validateMailAddress($email)) {
634
+		if (!empty($email) && !$this->mailer->validateMailAddress($email)) {
635 635
 			return new DataResponse(
636 636
 				array(
637 637
 					'status' => 'error',
638 638
 					'data' => array(
639
-						'message' => (string)$this->l10n->t('Invalid mail address')
639
+						'message' => (string) $this->l10n->t('Invalid mail address')
640 640
 					)
641 641
 				),
642 642
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 						'websiteScope' => $websiteScope,
672 672
 						'address' => $address,
673 673
 						'addressScope' => $addressScope,
674
-						'message' => (string)$this->l10n->t('Settings saved')
674
+						'message' => (string) $this->l10n->t('Settings saved')
675 675
 					)
676 676
 				),
677 677
 				Http::STATUS_OK
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 
749 749
 			$uniqueUsers = [];
750 750
 			foreach ($groups as $group) {
751
-				foreach($group->getUsers() as $uid => $displayName) {
751
+				foreach ($group->getUsers() as $uid => $displayName) {
752 752
 					$uniqueUsers[$uid] = true;
753 753
 				}
754 754
 			}
@@ -842,19 +842,19 @@  discard block
 block discarded – undo
842 842
 				array(
843 843
 					'status' => 'error',
844 844
 					'data' => array(
845
-						'message' => (string)$this->l10n->t('Forbidden')
845
+						'message' => (string) $this->l10n->t('Forbidden')
846 846
 					)
847 847
 				),
848 848
 				Http::STATUS_FORBIDDEN
849 849
 			);
850 850
 		}
851 851
 
852
-		if($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
852
+		if ($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
853 853
 			return new DataResponse(
854 854
 				array(
855 855
 					'status' => 'error',
856 856
 					'data' => array(
857
-						'message' => (string)$this->l10n->t('Invalid mail address')
857
+						'message' => (string) $this->l10n->t('Invalid mail address')
858 858
 					)
859 859
 				),
860 860
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 				array(
867 867
 					'status' => 'error',
868 868
 					'data' => array(
869
-						'message' => (string)$this->l10n->t('Invalid user')
869
+						'message' => (string) $this->l10n->t('Invalid user')
870 870
 					)
871 871
 				),
872 872
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 				array(
880 880
 					'status' => 'error',
881 881
 					'data' => array(
882
-						'message' => (string)$this->l10n->t('Unable to change mail address')
882
+						'message' => (string) $this->l10n->t('Unable to change mail address')
883 883
 					)
884 884
 				),
885 885
 				Http::STATUS_FORBIDDEN
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 					'data' => array(
898 898
 						'username' => $id,
899 899
 						'mailAddress' => $mailAddress,
900
-						'message' => (string)$this->l10n->t('Email saved')
900
+						'message' => (string) $this->l10n->t('Email saved')
901 901
 					)
902 902
 				),
903 903
 				Http::STATUS_OK
Please login to merge, or discard this patch.
settings/BackgroundJobs/VerifyUserData.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
 	protected function run($argument) {
107 107
 
108
-		$try = (int)$argument['try'] + 1;
108
+		$try = (int) $argument['try'] + 1;
109 109
 
110
-		switch($argument['type']) {
110
+		switch ($argument['type']) {
111 111
 			case AccountManager::PROPERTY_WEBSITE:
112 112
 				$result = $this->verifyWebsite($argument);
113 113
 				break;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 				break;
118 118
 			default:
119 119
 				// no valid type given, no need to retry
120
-				$this->logger->error($argument['type'] . ' is no valid type for user account data.');
120
+				$this->logger->error($argument['type'].' is no valid type for user account data.');
121 121
 				$result = true;
122 122
 		}
123 123
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
 		$result = false;
138 138
 
139
-		$url = rtrim($argument['data'], '/') . '/well-known/' . 'CloudIdVerificationCode.txt';
139
+		$url = rtrim($argument['data'], '/').'/well-known/'.'CloudIdVerificationCode.txt';
140 140
 
141 141
 		$client = $this->httpClientService->newClient();
142 142
 		try {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 			$user = $this->userManager->get($argument['uid']);
154 154
 			// we don't check a valid user -> give up
155 155
 			if ($user === null) {
156
-				$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
156
+				$this->logger->error($argument['uid'].' doesn\'t exist, can\'t verify user data.');
157 157
 				return $result;
158 158
 			}
159 159
 			$userData = $this->accountManager->getUser($user);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 		// we don't check a valid user -> give up
185 185
 		if ($user === null) {
186
-			$this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.');
186
+			$this->logger->error($argument['uid'].' doesn\'t exist, can\'t verify user data.');
187 187
 			return true;
188 188
 		}
189 189
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		try {
223 223
 			$client = $this->httpClientService->newClient();
224 224
 			$response = $client->get(
225
-				$this->lookupServerUrl . '/users?search=' . urlencode($cloudId) . '&exactCloudId=1',
225
+				$this->lookupServerUrl.'/users?search='.urlencode($cloudId).'&exactCloudId=1',
226 226
 				[
227 227
 					'timeout' => 10,
228 228
 					'connect_timeout' => 3,
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 				'data' => $argument['data'],
256 256
 				'type' => $argument['type'],
257 257
 				'uid' => $argument['uid'],
258
-				'try' => (int)$argument['try'] + 1,
258
+				'try' => (int) $argument['try'] + 1,
259 259
 				'lastRun' => time()
260 260
 			]
261 261
 		);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 * @return bool
269 269
 	 */
270 270
 	protected function shouldRun(array $argument) {
271
-		$lastRun = (int)$argument['lastRun'];
271
+		$lastRun = (int) $argument['lastRun'];
272 272
 		return ((time() - $lastRun) > $this->interval);
273 273
 	}
274 274
 
Please login to merge, or discard this patch.
lib/private/Accounts/AccountManager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -195,38 +195,38 @@
 block discarded – undo
195 195
 		$emailVerified = isset($oldData[self::PROPERTY_EMAIL]['verified']) && $oldData[self::PROPERTY_EMAIL]['verified'] === self::VERIFIED;
196 196
 
197 197
 		// keep old verification status if we don't have a new one
198
-		if(!isset($newData[self::PROPERTY_TWITTER]['verified'])) {
198
+		if (!isset($newData[self::PROPERTY_TWITTER]['verified'])) {
199 199
 			// keep old verification status if value didn't changed and an old value exists
200 200
 			$keepOldStatus = $newData[self::PROPERTY_TWITTER]['value'] === $oldData[self::PROPERTY_TWITTER]['value'] && isset($oldData[self::PROPERTY_TWITTER]['verified']);
201 201
 			$newData[self::PROPERTY_TWITTER]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_TWITTER]['verified'] : self::NOT_VERIFIED;
202 202
 		}
203 203
 
204
-		if(!isset($newData[self::PROPERTY_WEBSITE]['verified'])) {
204
+		if (!isset($newData[self::PROPERTY_WEBSITE]['verified'])) {
205 205
 			// keep old verification status if value didn't changed and an old value exists
206 206
 			$keepOldStatus = $newData[self::PROPERTY_WEBSITE]['value'] === $oldData[self::PROPERTY_WEBSITE]['value'] && isset($oldData[self::PROPERTY_WEBSITE]['verified']);
207 207
 			$newData[self::PROPERTY_WEBSITE]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_WEBSITE]['verified'] : self::NOT_VERIFIED;
208 208
 		}
209 209
 
210
-		if(!isset($newData[self::PROPERTY_EMAIL]['verified'])) {
210
+		if (!isset($newData[self::PROPERTY_EMAIL]['verified'])) {
211 211
 			// keep old verification status if value didn't changed and an old value exists
212 212
 			$keepOldStatus = $newData[self::PROPERTY_EMAIL]['value'] === $oldData[self::PROPERTY_EMAIL]['value'] && isset($oldData[self::PROPERTY_EMAIL]['verified']);
213 213
 			$newData[self::PROPERTY_EMAIL]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_EMAIL]['verified'] : self::VERIFICATION_IN_PROGRESS;
214 214
 		}
215 215
 
216 216
 		// reset verification status if a value from a previously verified data was changed
217
-		if($twitterVerified &&
217
+		if ($twitterVerified &&
218 218
 			$oldData[self::PROPERTY_TWITTER]['value'] !== $newData[self::PROPERTY_TWITTER]['value']
219 219
 		) {
220 220
 			$newData[self::PROPERTY_TWITTER]['verified'] = self::NOT_VERIFIED;
221 221
 		}
222 222
 
223
-		if($websiteVerified &&
223
+		if ($websiteVerified &&
224 224
 			$oldData[self::PROPERTY_WEBSITE]['value'] !== $newData[self::PROPERTY_WEBSITE]['value']
225 225
 		) {
226 226
 			$newData[self::PROPERTY_WEBSITE]['verified'] = self::NOT_VERIFIED;
227 227
 		}
228 228
 
229
-		if($emailVerified &&
229
+		if ($emailVerified &&
230 230
 			$oldData[self::PROPERTY_EMAIL]['value'] !== $newData[self::PROPERTY_EMAIL]['value']
231 231
 		) {
232 232
 			$newData[self::PROPERTY_EMAIL]['verified'] = self::NOT_VERIFIED;
Please login to merge, or discard this patch.
apps/files_sharing/lib/Controller/ShareesAPIController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
 		$this->result['groups'] = $this->result['exact']['groups'] = [];
237 237
 
238 238
 		$groups = $this->groupManager->search($search, $this->limit, $this->offset);
239
-		$groupIds = array_map(function (IGroup $group) { return $group->getGID(); }, $groups);
239
+		$groupIds = array_map(function(IGroup $group) { return $group->getGID(); }, $groups);
240 240
 
241 241
 		if (!$this->shareeEnumeration || sizeof($groups) < $this->limit) {
242 242
 			$this->reachedEndFor[] = 'groups';
243 243
 		}
244 244
 
245
-		$userGroups =  [];
245
+		$userGroups = [];
246 246
 		if (!empty($groups) && $this->shareWithGroupOnly) {
247 247
 			// Intersect all the groups that match with the groups this user is a member of
248 248
 			$userGroups = $this->groupManager->getUserGroups($this->userSession->getUser());
249
-			$userGroups = array_map(function (IGroup $group) { return $group->getGID(); }, $userGroups);
249
+			$userGroups = array_map(function(IGroup $group) { return $group->getGID(); }, $userGroups);
250 250
 			$groupIds = array_intersect($groupIds, $userGroups);
251 251
 		}
252 252
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 							$result['exactIdMatch'] = true;
342 342
 						}
343 343
 						$result['exact'][] = [
344
-							'label' => $contact['FN'] . " ($cloudId)",
344
+							'label' => $contact['FN']." ($cloudId)",
345 345
 							'value' => [
346 346
 								'shareType' => Share::SHARE_TYPE_REMOTE,
347 347
 								'shareWith' => $cloudId,
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 						];
351 351
 					} else {
352 352
 						$result['results'][] = [
353
-							'label' => $contact['FN'] . " ($cloudId)",
353
+							'label' => $contact['FN']." ($cloudId)",
354 354
 							'value' => [
355 355
 								'shareType' => Share::SHARE_TYPE_REMOTE,
356 356
 								'shareWith' => $cloudId,
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
 	public function search($search = '', $itemType = null, $page = 1, $perPage = 200, $shareType = null, $lookup = true) {
435 435
 
436 436
 		// only search for string larger than a given threshold
437
-		$threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0);
437
+		$threshold = (int) $this->config->getSystemValue('sharing.minSearchStringLength', 0);
438 438
 		if (strlen($search) < $threshold) {
439 439
 			return new DataResponse($this->result);
440 440
 		}
441 441
 
442 442
 		// never return more than the max. number of results configured in the config.php
443
-		$maxResults = (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0);
443
+		$maxResults = (int) $this->config->getSystemValue('sharing.maxAutocompleteResults', 0);
444 444
 		if ($maxResults > 0) {
445 445
 			$perPage = min($perPage, $maxResults);
446 446
 		}
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 							$result['exactIdMatch'] = true;
615 615
 						}
616 616
 						$result['exact'][] = [
617
-							'label' => $contact['FN'] . " ($emailAddress)",
617
+							'label' => $contact['FN']." ($emailAddress)",
618 618
 							'value' => [
619 619
 								'shareType' => Share::SHARE_TYPE_EMAIL,
620 620
 								'shareWith' => $emailAddress,
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 						];
623 623
 					} else {
624 624
 						$result['results'][] = [
625
-							'label' => $contact['FN'] . " ($emailAddress)",
625
+							'label' => $contact['FN']." ($emailAddress)",
626 626
 							'value' => [
627 627
 								'shareType' => Share::SHARE_TYPE_EMAIL,
628 628
 								'shareWith' => $emailAddress,
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 		$lookupServerUrl = rtrim($lookupServerUrl, '/');
659 659
 		$result = [];
660 660
 
661
-		if($isEnabled === 'yes') {
661
+		if ($isEnabled === 'yes') {
662 662
 			try {
663 663
 				$client = $this->clientService->newClient();
664 664
 				$response = $client->get(
665
-					$lookupServerUrl . '/users?search=' . urlencode($search),
665
+					$lookupServerUrl.'/users?search='.urlencode($search),
666 666
 					[
667 667
 						'timeout' => 10,
668 668
 						'connect_timeout' => 3,
@@ -697,12 +697,12 @@  discard block
 block discarded – undo
697 697
 	 */
698 698
 	protected function getPaginationLink($page, array $params) {
699 699
 		if ($this->isV2()) {
700
-			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees') . '?';
700
+			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees').'?';
701 701
 		} else {
702
-			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees') . '?';
702
+			$url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees').'?';
703 703
 		}
704 704
 		$params['page'] = $page + 1;
705
-		$link = '<' . $url . http_build_query($params) . '>; rel="next"';
705
+		$link = '<'.$url.http_build_query($params).'>; rel="next"';
706 706
 
707 707
 		return $link;
708 708
 	}
Please login to merge, or discard this patch.
settings/templates/personal.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 <div id="app-navigation">
12 12
 	<ul class="with-icon">
13
-	<?php foreach($_['forms'] as $form) {
13
+	<?php foreach ($_['forms'] as $form) {
14 14
 		if (isset($form['anchor'])) {
15
-			$anchor = '#' . $form['anchor'];
16
-			$class = 'nav-icon-' . $form['anchor'];
15
+			$anchor = '#'.$form['anchor'];
16
+			$class = 'nav-icon-'.$form['anchor'];
17 17
 			$sectionName = $form['section-name'];
18 18
 			print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
19 19
 			\OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 <div id="app-content">
26 26
 
27 27
 <div id="quota" class="section">
28
-	<div style="width:<?php p($_['usage_relative']);?>%"
29
-		<?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
28
+	<div style="width:<?php p($_['usage_relative']); ?>%"
29
+		<?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
30 30
 		<p id="quotatext">
31 31
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
32 32
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
33
-					[$_['usage'], $_['total_space']]));?>
33
+					[$_['usage'], $_['total_space']])); ?>
34 34
 			<?php else: ?>
35 35
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
36
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
36
+					[$_['usage'], $_['total_space'], $_['usage_relative']])); ?>
37 37
 			<?php endif ?>
38 38
 		</p>
39 39
 	</div>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			</div>
68 68
 		</div>
69 69
 		<span class="icon-checkmark hidden"/>
70
-		<?php if($_['lookupServerUploadEnabled']) { ?>
70
+		<?php if ($_['lookupServerUploadEnabled']) { ?>
71 71
 		<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
72 72
 		<?php } ?>
73 73
 	</form>
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 				<span class="icon-password"/>
82 82
 			</h2>
83 83
 			<input type="text" id="displayname" name="displayname"
84
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
84
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
85 85
 				value="<?php p($_['displayName']) ?>"
86 86
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
87
-			<?php if(!$_['displayNameChangeSupported']) { ?>
88
-				<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
87
+			<?php if (!$_['displayNameChangeSupported']) { ?>
88
+				<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
89 89
 			<?php } ?>
90 90
 			<span class="icon-checkmark hidden"/>
91
-			<?php if($_['lookupServerUploadEnabled']) { ?>
91
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
92 92
 			<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
93 93
 			<?php } ?>
94 94
 		</form>
@@ -99,38 +99,38 @@  discard block
 block discarded – undo
99 99
 				<label for="email"><?php p($l->t('Email')); ?></label>
100 100
 				<span class="icon-password"/>
101 101
 			</h2>
102
-			<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
102
+			<div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>">
103 103
 				<img id="verify-email" <?php
104
-				switch($_['emailVerification']) {
104
+				switch ($_['emailVerification']) {
105 105
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
106
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying…') . '"');
106
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying…').'"');
107 107
 						break;
108 108
 					case \OC\Accounts\AccountManager::VERIFIED:
109
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
109
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
110 110
 						break;
111 111
 					default:
112
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '"');
112
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'"');
113 113
 				}
114 114
 				?>>
115 115
 			</div>
116 116
 			<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
117
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
117
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
118 118
 				placeholder="<?php p($l->t('Your email address')); ?>"
119 119
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
120
-			<?php if(!$_['displayNameChangeSupported']) { ?>
121
-				<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
120
+			<?php if (!$_['displayNameChangeSupported']) { ?>
121
+				<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
122 122
 			<?php } ?>
123
-			<?php if($_['displayNameChangeSupported']) { ?>
123
+			<?php if ($_['displayNameChangeSupported']) { ?>
124 124
 				<br />
125 125
 				<em><?php p($l->t('For password reset and notifications')); ?></em>
126 126
 			<?php } ?>
127 127
 			<span class="icon-checkmark hidden"/>
128
-			<?php if($_['lookupServerUploadEnabled']) { ?>
128
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
129 129
 			<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
130 130
 			<?php } ?>
131 131
 		</form>
132 132
 	</div>
133
-	<?php if($_['lookupServerUploadEnabled']) { ?>
133
+	<?php if ($_['lookupServerUploadEnabled']) { ?>
134 134
 	<div class="personal-settings-setting-box">
135 135
 		<form id="phoneform" class="section">
136 136
 			<h2>
@@ -165,24 +165,24 @@  discard block
 block discarded – undo
165 165
 				<label for="website"><?php p($l->t('Website')); ?></label>
166 166
 				<span class="icon-password"/>
167 167
 			</h2>
168
-			<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
168
+			<div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>">
169 169
 				<img id="verify-website" <?php
170
-				switch($_['websiteVerification']) {
170
+				switch ($_['websiteVerification']) {
171 171
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
172
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying…') . '"');
172
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying…').'"');
173 173
 						break;
174 174
 					case \OC\Accounts\AccountManager::VERIFIED:
175
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
175
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
176 176
 						break;
177 177
 					default:
178
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"');
178
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'" class="verify-action"');
179 179
 				}
180 180
 				?>>
181 181
 				<div class="verification-dialog popovermenu bubble menu">
182 182
 					<div class="verification-dialog-content">
183 183
 						<p class="explainVerification"></p>
184 184
 						<p class="verificationCode"></p>
185
-						<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
185
+						<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
186 186
 					</div>
187 187
 				</div>
188 188
 			</div>
@@ -199,24 +199,24 @@  discard block
 block discarded – undo
199 199
 				<label for="twitter"><?php p($l->t('Twitter')); ?></label>
200 200
 				<span class="icon-password"/>
201 201
 			</h2>
202
-			<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
202
+			<div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>">
203 203
 				<img id="verify-twitter" <?php
204
-				switch($_['twitterVerification']) {
204
+				switch ($_['twitterVerification']) {
205 205
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
206
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying…') . '"');
206
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying…').'"');
207 207
 						break;
208 208
 					case \OC\Accounts\AccountManager::VERIFIED:
209
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
209
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
210 210
 						break;
211 211
 					default:
212
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"');
212
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'" class="verify-action"');
213 213
 				}
214 214
 				?>>
215 215
 				<div class="verification-dialog popovermenu bubble menu">
216 216
 					<div class="verification-dialog-content">
217 217
 						<p class="explainVerification"></p>
218 218
 						<p class="verificationCode"></p>
219
-						<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
219
+						<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
220 220
 					</div>
221 221
 				</div>
222 222
 			</div>
@@ -241,19 +241,19 @@  discard block
 block discarded – undo
241 241
 </div>
242 242
 
243 243
 <?php
244
-if($_['passwordChangeSupported']) {
244
+if ($_['passwordChangeSupported']) {
245 245
 	script('jquery-showpassword');
246 246
 ?>
247 247
 <form id="passwordform" class="section">
248
-	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
248
+	<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
249 249
 	<div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
250 250
 	<br>
251 251
 	<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
252 252
 	<input type="password" id="pass1" name="oldpassword"
253
-		placeholder="<?php p($l->t('Current password'));?>"
253
+		placeholder="<?php p($l->t('Current password')); ?>"
254 254
 		autocomplete="off" autocapitalize="none" autocorrect="off" />
255 255
 	<div class="personal-show-container">
256
-		<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
256
+		<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
257 257
 		<input type="password" id="pass2" name="newpassword"
258 258
 			placeholder="<?php p($l->t('New password')); ?>"
259 259
 			data-typetoggle="#personal-show"
@@ -269,44 +269,44 @@  discard block
 block discarded – undo
269 269
 
270 270
 <form id="language" class="section">
271 271
 	<h2>
272
-		<label for="languageinput"><?php p($l->t('Language'));?></label>
272
+		<label for="languageinput"><?php p($l->t('Language')); ?></label>
273 273
 	</h2>
274
-	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
275
-		<option value="<?php p($_['activelanguage']['code']);?>">
276
-			<?php p($_['activelanguage']['name']);?>
274
+	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
275
+		<option value="<?php p($_['activelanguage']['code']); ?>">
276
+			<?php p($_['activelanguage']['name']); ?>
277 277
 		</option>
278
-		<?php foreach($_['commonlanguages'] as $language):?>
279
-			<option value="<?php p($language['code']);?>">
280
-				<?php p($language['name']);?>
278
+		<?php foreach ($_['commonlanguages'] as $language):?>
279
+			<option value="<?php p($language['code']); ?>">
280
+				<?php p($language['name']); ?>
281 281
 			</option>
282
-		<?php endforeach;?>
282
+		<?php endforeach; ?>
283 283
 		<optgroup label="––––––––––"></optgroup>
284
-		<?php foreach($_['languages'] as $language):?>
285
-			<option value="<?php p($language['code']);?>">
286
-				<?php p($language['name']);?>
284
+		<?php foreach ($_['languages'] as $language):?>
285
+			<option value="<?php p($language['code']); ?>">
286
+				<?php p($language['name']); ?>
287 287
 			</option>
288
-		<?php endforeach;?>
288
+		<?php endforeach; ?>
289 289
 	</select>
290 290
 	<a href="https://www.transifex.com/nextcloud/nextcloud/"
291 291
 		target="_blank" rel="noreferrer">
292
-		<em><?php p($l->t('Help translate'));?></em>
292
+		<em><?php p($l->t('Help translate')); ?></em>
293 293
 	</a>
294 294
 </form>
295 295
 
296 296
 
297 297
 <div id="clientsbox" class="section clientsbox">
298
-	<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
298
+	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2>
299 299
 	<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
300 300
 		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
301
-			 alt="<?php p($l->t('Desktop client'));?>" />
301
+			 alt="<?php p($l->t('Desktop client')); ?>" />
302 302
 	</a>
303 303
 	<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
304 304
 		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
305
-			 alt="<?php p($l->t('Android app'));?>" />
305
+			 alt="<?php p($l->t('Android app')); ?>" />
306 306
 	</a>
307 307
 	<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
308 308
 		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
309
-			 alt="<?php p($l->t('iOS app'));?>" />
309
+			 alt="<?php p($l->t('iOS app')); ?>" />
310 310
 	</a>
311 311
 
312 312
 		<p>
@@ -322,19 +322,19 @@  discard block
 block discarded – undo
322 322
 				$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
323 323
 		</p>
324 324
 
325
-	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
326
-		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
325
+	<?php if (OC_APP::isEnabled('firstrunwizard')) {?>
326
+		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p>
327 327
 	<?php }?>
328 328
 </div>
329 329
 
330 330
 <div id="sessions" class="section">
331
-	<h2><?php p($l->t('Sessions'));?></h2>
332
-	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
331
+	<h2><?php p($l->t('Sessions')); ?></h2>
332
+	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.')); ?></span>
333 333
 	<table class="icon-loading">
334 334
 		<thead class="token-list-header">
335 335
 			<tr>
336
-				<th><?php p($l->t('Device'));?></th>
337
-				<th><?php p($l->t('Last activity'));?></th>
336
+				<th><?php p($l->t('Device')); ?></th>
337
+				<th><?php p($l->t('Last activity')); ?></th>
338 338
 				<th></th>
339 339
 			</tr>
340 340
 		</thead>
@@ -344,13 +344,13 @@  discard block
 block discarded – undo
344 344
 </div>
345 345
 
346 346
 <div id="apppasswords" class="section">
347
-	<h2><?php p($l->t('App passwords'));?></h2>
348
-	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
347
+	<h2><?php p($l->t('App passwords')); ?></h2>
348
+	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.')); ?></p>
349 349
 	<table class="icon-loading">
350 350
 		<thead class="hidden-when-empty">
351 351
 			<tr>
352
-				<th><?php p($l->t('Name'));?></th>
353
-				<th><?php p($l->t('Last activity'));?></th>
352
+				<th><?php p($l->t('Name')); ?></th>
353
+				<th><?php p($l->t('Last activity')); ?></th>
354 354
 				<th></th>
355 355
 			</tr>
356 356
 		</thead>
@@ -379,14 +379,14 @@  discard block
 block discarded – undo
379 379
 	</div>
380 380
 </div>
381 381
 
382
-<?php foreach($_['forms'] as $form) {
382
+<?php foreach ($_['forms'] as $form) {
383 383
 	if (isset($form['form'])) {?>
384
-	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
384
+	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p(''); ?>"><?php print_unescaped($form['form']); ?></div>
385 385
 	<?php }
386 386
 };?>
387 387
 
388 388
 <div class="section">
389
-	<h2><?php p($l->t('Version'));?></h2>
389
+	<h2><?php p($l->t('Version')); ?></h2>
390 390
 	<p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
391 391
 	<p><?php include('settings.development.notice.php'); ?></p>
392 392
 </div>
Please login to merge, or discard this patch.