Completed
Pull Request — master (#3869)
by Jan-Christoph
22:08
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   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
 	<div class="verification-dialog-content">
15 15
 		<p class="explainVerification"></p>
16 16
 		<p class="verificationCode"></p>
17
-		<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
17
+		<p><?php p(\OC::$server->getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
18 18
 	</div>
19 19
 
20 20
 </div>
21 21
 
22 22
 <div id="app-navigation">
23 23
 	<ul class="with-icon">
24
-	<?php foreach($_['forms'] as $form) {
24
+	<?php foreach ($_['forms'] as $form) {
25 25
 		if (isset($form['anchor'])) {
26
-			$anchor = '#' . $form['anchor'];
27
-			$class = 'nav-icon-' . $form['anchor'];
26
+			$anchor = '#'.$form['anchor'];
27
+			$class = 'nav-icon-'.$form['anchor'];
28 28
 			$sectionName = $form['section-name'];
29 29
 			print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
30 30
 			\OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 <div id="app-content">
37 37
 
38 38
 <div id="quota" class="section">
39
-	<div style="width:<?php p($_['usage_relative']);?>%"
40
-		<?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
39
+	<div style="width:<?php p($_['usage_relative']); ?>%"
40
+		<?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
41 41
 		<p id="quotatext">
42 42
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
43 43
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
44
-					[$_['usage'], $_['total_space']]));?>
44
+					[$_['usage'], $_['total_space']])); ?>
45 45
 			<?php else: ?>
46 46
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
47
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
47
+					[$_['usage'], $_['total_space'], $_['usage_relative']])); ?>
48 48
 			<?php endif ?>
49 49
 		</p>
50 50
 	</div>
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			</div>
79 79
 		</div>
80 80
 		<span class="icon-checkmark hidden"/>
81
-		<?php if($_['lookupServerUploadEnabled']) { ?>
81
+		<?php if ($_['lookupServerUploadEnabled']) { ?>
82 82
 		<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
83 83
 		<?php } ?>
84 84
 	</form>
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 				<span class="icon-password"/>
93 93
 			</h2>
94 94
 			<input type="text" id="displayname" name="displayname"
95
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
95
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
96 96
 				value="<?php p($_['displayName']) ?>"
97 97
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
98
-			<?php if(!$_['displayNameChangeSupported']) { ?>
99
-				<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
98
+			<?php if (!$_['displayNameChangeSupported']) { ?>
99
+				<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
100 100
 			<?php } ?>
101 101
 			<span class="icon-checkmark hidden"/>
102
-			<?php if($_['lookupServerUploadEnabled']) { ?>
102
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
103 103
 			<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
104 104
 			<?php } ?>
105 105
 		</form>
@@ -112,36 +112,36 @@  discard block
 block discarded – undo
112 112
 			</h2>
113 113
 			<div class="verify">
114 114
 				<img id="verify-email" <?php
115
-				switch($_['emailVerification']) {
115
+				switch ($_['emailVerification']) {
116 116
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
117
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying …') . '"');
117
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying …').'"');
118 118
 						break;
119 119
 					case \OC\Accounts\AccountManager::VERIFIED:
120
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
120
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
121 121
 						break;
122 122
 					default:
123
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '"');
123
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'"');
124 124
 				}
125 125
 				?>>
126 126
 			</div>
127 127
 			<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
128
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
128
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
129 129
 				placeholder="<?php p($l->t('Your email address')); ?>"
130 130
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
131
-			<?php if(!$_['displayNameChangeSupported']) { ?>
132
-				<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
131
+			<?php if (!$_['displayNameChangeSupported']) { ?>
132
+				<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
133 133
 			<?php } ?>
134
-			<?php if($_['displayNameChangeSupported']) { ?>
134
+			<?php if ($_['displayNameChangeSupported']) { ?>
135 135
 				<br />
136 136
 				<em><?php p($l->t('For password reset and notifications')); ?></em>
137 137
 			<?php } ?>
138 138
 			<span class="icon-checkmark hidden"/>
139
-			<?php if($_['lookupServerUploadEnabled']) { ?>
139
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
140 140
 			<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
141 141
 			<?php } ?>
142 142
 		</form>
143 143
 	</div>
144
-	<?php if($_['lookupServerUploadEnabled']) { ?>
144
+	<?php if ($_['lookupServerUploadEnabled']) { ?>
145 145
 	<div class="personal-settings-setting-box">
146 146
 		<form id="phoneform" class="section">
147 147
 			<h2>
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 			</h2>
179 179
 			<div class="verify">
180 180
 				<img id="verify-website" <?php
181
-				switch($_['websiteVerification']) {
181
+				switch ($_['websiteVerification']) {
182 182
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
183
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying …') . '"');
183
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying …').'"');
184 184
 						break;
185 185
 					case \OC\Accounts\AccountManager::VERIFIED:
186
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
186
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
187 187
 						break;
188 188
 					default:
189
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"');
189
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'" class="verify-action"');
190 190
 				}
191 191
 				?>>
192 192
 			</div>
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 			</h2>
206 206
 			<div class="verify">
207 207
 				<img id="verify-twitter" <?php
208
-				switch($_['twitterVerification']) {
208
+				switch ($_['twitterVerification']) {
209 209
 					case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
210
-						print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="' . \OC::$server->getL10N()->t('Verifying …') . '"');
210
+						print_unescaped('src="'.image_path('core', 'actions/verifying.svg').'" title="'.\OC::$server->getL10N()->t('Verifying …').'"');
211 211
 						break;
212 212
 					case \OC\Accounts\AccountManager::VERIFIED:
213
-						print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"' . \OC::$server->getL10N()->t('Verified') . '"');
213
+						print_unescaped('src="'.image_path('core', 'actions/verified.svg').'"'.\OC::$server->getL10N()->t('Verified').'"');
214 214
 						break;
215 215
 					default:
216
-						print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"');
216
+						print_unescaped('src="'.image_path('core', 'actions/verify.svg').'" title="'.\OC::$server->getL10N()->t('Verify').'" class="verify-action"');
217 217
 				}
218 218
 				?>>
219 219
 			</div>
@@ -238,19 +238,19 @@  discard block
 block discarded – undo
238 238
 </div>
239 239
 
240 240
 <?php
241
-if($_['passwordChangeSupported']) {
241
+if ($_['passwordChangeSupported']) {
242 242
 	script('jquery-showpassword');
243 243
 ?>
244 244
 <form id="passwordform" class="section">
245
-	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
245
+	<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
246 246
 	<div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
247 247
 	<br>
248 248
 	<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
249 249
 	<input type="password" id="pass1" name="oldpassword"
250
-		placeholder="<?php p($l->t('Current password'));?>"
250
+		placeholder="<?php p($l->t('Current password')); ?>"
251 251
 		autocomplete="off" autocapitalize="none" autocorrect="off" />
252 252
 	<div class="personal-show-container">
253
-		<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
253
+		<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
254 254
 		<input type="password" id="pass2" name="newpassword"
255 255
 			placeholder="<?php p($l->t('New password')); ?>"
256 256
 			data-typetoggle="#personal-show"
@@ -266,44 +266,44 @@  discard block
 block discarded – undo
266 266
 
267 267
 <form id="language" class="section">
268 268
 	<h2>
269
-		<label for="languageinput"><?php p($l->t('Language'));?></label>
269
+		<label for="languageinput"><?php p($l->t('Language')); ?></label>
270 270
 	</h2>
271
-	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
272
-		<option value="<?php p($_['activelanguage']['code']);?>">
273
-			<?php p($_['activelanguage']['name']);?>
271
+	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
272
+		<option value="<?php p($_['activelanguage']['code']); ?>">
273
+			<?php p($_['activelanguage']['name']); ?>
274 274
 		</option>
275
-		<?php foreach($_['commonlanguages'] as $language):?>
276
-			<option value="<?php p($language['code']);?>">
277
-				<?php p($language['name']);?>
275
+		<?php foreach ($_['commonlanguages'] as $language):?>
276
+			<option value="<?php p($language['code']); ?>">
277
+				<?php p($language['name']); ?>
278 278
 			</option>
279
-		<?php endforeach;?>
279
+		<?php endforeach; ?>
280 280
 		<optgroup label="––––––––––"></optgroup>
281
-		<?php foreach($_['languages'] as $language):?>
282
-			<option value="<?php p($language['code']);?>">
283
-				<?php p($language['name']);?>
281
+		<?php foreach ($_['languages'] as $language):?>
282
+			<option value="<?php p($language['code']); ?>">
283
+				<?php p($language['name']); ?>
284 284
 			</option>
285
-		<?php endforeach;?>
285
+		<?php endforeach; ?>
286 286
 	</select>
287 287
 	<a href="https://www.transifex.com/nextcloud/nextcloud/"
288 288
 		target="_blank" rel="noreferrer">
289
-		<em><?php p($l->t('Help translate'));?></em>
289
+		<em><?php p($l->t('Help translate')); ?></em>
290 290
 	</a>
291 291
 </form>
292 292
 
293 293
 
294 294
 <div id="clientsbox" class="section clientsbox">
295
-	<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
295
+	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2>
296 296
 	<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
297 297
 		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
298
-			 alt="<?php p($l->t('Desktop client'));?>" />
298
+			 alt="<?php p($l->t('Desktop client')); ?>" />
299 299
 	</a>
300 300
 	<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
301 301
 		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
302
-			 alt="<?php p($l->t('Android app'));?>" />
302
+			 alt="<?php p($l->t('Android app')); ?>" />
303 303
 	</a>
304 304
 	<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
305 305
 		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
306
-			 alt="<?php p($l->t('iOS app'));?>" />
306
+			 alt="<?php p($l->t('iOS app')); ?>" />
307 307
 	</a>
308 308
 
309 309
 		<p>
@@ -319,19 +319,19 @@  discard block
 block discarded – undo
319 319
 				$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
320 320
 		</p>
321 321
 
322
-	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
323
-		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
322
+	<?php if (OC_APP::isEnabled('firstrunwizard')) {?>
323
+		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p>
324 324
 	<?php }?>
325 325
 </div>
326 326
 
327 327
 <div id="sessions" class="section">
328
-	<h2><?php p($l->t('Sessions'));?></h2>
329
-	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
328
+	<h2><?php p($l->t('Sessions')); ?></h2>
329
+	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.')); ?></span>
330 330
 	<table class="icon-loading">
331 331
 		<thead class="token-list-header">
332 332
 			<tr>
333
-				<th><?php p($l->t('Device'));?></th>
334
-				<th><?php p($l->t('Last activity'));?></th>
333
+				<th><?php p($l->t('Device')); ?></th>
334
+				<th><?php p($l->t('Last activity')); ?></th>
335 335
 				<th></th>
336 336
 			</tr>
337 337
 		</thead>
@@ -341,13 +341,13 @@  discard block
 block discarded – undo
341 341
 </div>
342 342
 
343 343
 <div id="apppasswords" class="section">
344
-	<h2><?php p($l->t('App passwords'));?></h2>
345
-	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
344
+	<h2><?php p($l->t('App passwords')); ?></h2>
345
+	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.')); ?></p>
346 346
 	<table class="icon-loading">
347 347
 		<thead class="hidden-when-empty">
348 348
 			<tr>
349
-				<th><?php p($l->t('Name'));?></th>
350
-				<th><?php p($l->t('Last activity'));?></th>
349
+				<th><?php p($l->t('Name')); ?></th>
350
+				<th><?php p($l->t('Last activity')); ?></th>
351 351
 				<th></th>
352 352
 			</tr>
353 353
 		</thead>
@@ -376,14 +376,14 @@  discard block
 block discarded – undo
376 376
 	</div>
377 377
 </div>
378 378
 
379
-<?php foreach($_['forms'] as $form) {
379
+<?php foreach ($_['forms'] as $form) {
380 380
 	if (isset($form['form'])) {?>
381
-	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
381
+	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p(''); ?>"><?php print_unescaped($form['form']); ?></div>
382 382
 	<?php }
383 383
 };?>
384 384
 
385 385
 <div class="section">
386
-	<h2><?php p($l->t('Version'));?></h2>
386
+	<h2><?php p($l->t('Version')); ?></h2>
387 387
 	<p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
388 388
 	<p><?php include('settings.development.notice.php'); ?></p>
389 389
 </div>
Please login to merge, or discard this patch.