Completed
Pull Request — master (#3869)
by Björn
15:26
created
settings/templates/personal.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
 
23 23
 <div id="app-navigation">
24 24
 	<ul class="with-icon">
25
-	<?php foreach($_['forms'] as $form) {
25
+	<?php foreach ($_['forms'] as $form) {
26 26
 		if (isset($form['anchor'])) {
27
-			$anchor = '#' . $form['anchor'];
28
-			$class = 'nav-icon-' . $form['anchor'];
27
+			$anchor = '#'.$form['anchor'];
28
+			$class = 'nav-icon-'.$form['anchor'];
29 29
 			$sectionName = $form['section-name'];
30 30
 			print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor),
31 31
 			\OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName)));
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 <div id="app-content">
38 38
 
39 39
 <div id="quota" class="section">
40
-	<div style="width:<?php p($_['usage_relative']);?>%"
41
-		<?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
40
+	<div style="width:<?php p($_['usage_relative']); ?>%"
41
+		<?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
42 42
 		<p id="quotatext">
43 43
 			<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
44 44
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
45
-					[$_['usage'], $_['total_space']]));?>
45
+					[$_['usage'], $_['total_space']])); ?>
46 46
 			<?php else: ?>
47 47
 				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
48
-					[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
48
+					[$_['usage'], $_['total_space'], $_['usage_relative']])); ?>
49 49
 			<?php endif ?>
50 50
 		</p>
51 51
 	</div>
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 				<span class="icon-password"/>
92 92
 			</h2>
93 93
 			<input type="text" id="displayname" name="displayname"
94
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
94
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
95 95
 				value="<?php p($_['displayName']) ?>"
96 96
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
97
-			<?php if(!$_['displayNameChangeSupported']) { ?>
98
-				<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
97
+			<?php if (!$_['displayNameChangeSupported']) { ?>
98
+				<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
99 99
 			<?php } ?>
100 100
 			<span class="icon-checkmark hidden"/>
101 101
 			<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 			</h2>
110 110
 			<span class="verify" id="verify-email">Verify</span>
111 111
 			<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
112
-				<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
112
+				<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
113 113
 				placeholder="<?php p($l->t('Your email address')); ?>"
114 114
 				autocomplete="on" autocapitalize="none" autocorrect="off" />
115
-			<?php if(!$_['displayNameChangeSupported']) { ?>
116
-				<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
115
+			<?php if (!$_['displayNameChangeSupported']) { ?>
116
+				<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
117 117
 			<?php } ?>
118
-			<?php if($_['displayNameChangeSupported']) { ?>
118
+			<?php if ($_['displayNameChangeSupported']) { ?>
119 119
 				<br />
120 120
 				<em><?php p($l->t('For password reset and notifications')); ?></em>
121 121
 			<?php } ?>
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
 </div>
194 194
 
195 195
 <?php
196
-if($_['passwordChangeSupported']) {
196
+if ($_['passwordChangeSupported']) {
197 197
 	script('jquery-showpassword');
198 198
 ?>
199 199
 <form id="passwordform" class="section">
200
-	<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
200
+	<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
201 201
 	<div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
202 202
 	<br>
203 203
 	<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
204 204
 	<input type="password" id="pass1" name="oldpassword"
205
-		placeholder="<?php p($l->t('Current password'));?>"
205
+		placeholder="<?php p($l->t('Current password')); ?>"
206 206
 		autocomplete="off" autocapitalize="none" autocorrect="off" />
207 207
 	<div class="personal-show-container">
208
-		<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
208
+		<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
209 209
 		<input type="password" id="pass2" name="newpassword"
210 210
 			placeholder="<?php p($l->t('New password')); ?>"
211 211
 			data-typetoggle="#personal-show"
@@ -221,44 +221,44 @@  discard block
 block discarded – undo
221 221
 
222 222
 <form id="language" class="section">
223 223
 	<h2>
224
-		<label for="languageinput"><?php p($l->t('Language'));?></label>
224
+		<label for="languageinput"><?php p($l->t('Language')); ?></label>
225 225
 	</h2>
226
-	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
227
-		<option value="<?php p($_['activelanguage']['code']);?>">
228
-			<?php p($_['activelanguage']['name']);?>
226
+	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
227
+		<option value="<?php p($_['activelanguage']['code']); ?>">
228
+			<?php p($_['activelanguage']['name']); ?>
229 229
 		</option>
230
-		<?php foreach($_['commonlanguages'] as $language):?>
231
-			<option value="<?php p($language['code']);?>">
232
-				<?php p($language['name']);?>
230
+		<?php foreach ($_['commonlanguages'] as $language):?>
231
+			<option value="<?php p($language['code']); ?>">
232
+				<?php p($language['name']); ?>
233 233
 			</option>
234
-		<?php endforeach;?>
234
+		<?php endforeach; ?>
235 235
 		<optgroup label="––––––––––"></optgroup>
236
-		<?php foreach($_['languages'] as $language):?>
237
-			<option value="<?php p($language['code']);?>">
238
-				<?php p($language['name']);?>
236
+		<?php foreach ($_['languages'] as $language):?>
237
+			<option value="<?php p($language['code']); ?>">
238
+				<?php p($language['name']); ?>
239 239
 			</option>
240
-		<?php endforeach;?>
240
+		<?php endforeach; ?>
241 241
 	</select>
242 242
 	<a href="https://www.transifex.com/nextcloud/nextcloud/"
243 243
 		target="_blank" rel="noreferrer">
244
-		<em><?php p($l->t('Help translate'));?></em>
244
+		<em><?php p($l->t('Help translate')); ?></em>
245 245
 	</a>
246 246
 </form>
247 247
 
248 248
 
249 249
 <div id="clientsbox" class="section clientsbox">
250
-	<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
250
+	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2>
251 251
 	<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
252 252
 		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
253
-			 alt="<?php p($l->t('Desktop client'));?>" />
253
+			 alt="<?php p($l->t('Desktop client')); ?>" />
254 254
 	</a>
255 255
 	<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
256 256
 		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
257
-			 alt="<?php p($l->t('Android app'));?>" />
257
+			 alt="<?php p($l->t('Android app')); ?>" />
258 258
 	</a>
259 259
 	<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
260 260
 		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
261
-			 alt="<?php p($l->t('iOS app'));?>" />
261
+			 alt="<?php p($l->t('iOS app')); ?>" />
262 262
 	</a>
263 263
 
264 264
 		<p>
@@ -274,19 +274,19 @@  discard block
 block discarded – undo
274 274
 				$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
275 275
 		</p>
276 276
 
277
-	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
278
-		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
277
+	<?php if (OC_APP::isEnabled('firstrunwizard')) {?>
278
+		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p>
279 279
 	<?php }?>
280 280
 </div>
281 281
 
282 282
 <div id="sessions" class="section">
283
-	<h2><?php p($l->t('Sessions'));?></h2>
284
-	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.'));?></span>
283
+	<h2><?php p($l->t('Sessions')); ?></h2>
284
+	<span class="hidden-when-empty"><?php p($l->t('Web, desktop and mobile clients currently logged in to your account.')); ?></span>
285 285
 	<table class="icon-loading">
286 286
 		<thead class="token-list-header">
287 287
 			<tr>
288
-				<th><?php p($l->t('Device'));?></th>
289
-				<th><?php p($l->t('Last activity'));?></th>
288
+				<th><?php p($l->t('Device')); ?></th>
289
+				<th><?php p($l->t('Last activity')); ?></th>
290 290
 				<th></th>
291 291
 			</tr>
292 292
 		</thead>
@@ -296,13 +296,13 @@  discard block
 block discarded – undo
296 296
 </div>
297 297
 
298 298
 <div id="apppasswords" class="section">
299
-	<h2><?php p($l->t('App passwords'));?></h2>
300
-	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.'));?></p>
299
+	<h2><?php p($l->t('App passwords')); ?></h2>
300
+	<p><?php p($l->t('Passcodes that give an app or device permissions to access your account.')); ?></p>
301 301
 	<table class="icon-loading">
302 302
 		<thead class="hidden-when-empty">
303 303
 			<tr>
304
-				<th><?php p($l->t('Name'));?></th>
305
-				<th><?php p($l->t('Last activity'));?></th>
304
+				<th><?php p($l->t('Name')); ?></th>
305
+				<th><?php p($l->t('Last activity')); ?></th>
306 306
 				<th></th>
307 307
 			</tr>
308 308
 		</thead>
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
 	</div>
332 332
 </div>
333 333
 
334
-<?php foreach($_['forms'] as $form) {
334
+<?php foreach ($_['forms'] as $form) {
335 335
 	if (isset($form['form'])) {?>
336
-	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
336
+	<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p(''); ?>"><?php print_unescaped($form['form']); ?></div>
337 337
 	<?php }
338 338
 };?>
339 339
 
340 340
 <div class="section">
341
-	<h2><?php p($l->t('Version'));?></h2>
341
+	<h2><?php p($l->t('Version')); ?></h2>
342 342
 	<p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
343 343
 	<p><?php include('settings.development.notice.php'); ?></p>
344 344
 </div>
Please login to merge, or discard this patch.
lib/private/Accounts/AccountManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,19 +141,19 @@
 block discarded – undo
141 141
 		$websiteVerified = isset($oldData[self::PROPERTY_WEBSITE]['verified']) && $oldData[self::PROPERTY_WEBSITE]['verified'] === self::VERIFIED;
142 142
 		$emailVerified = isset($oldData[self::PROPERTY_EMAIL]['verified']) && $oldData[self::PROPERTY_EMAIL]['verified'] === self::VERIFIED;
143 143
 
144
-		if($twitterVerified &&
144
+		if ($twitterVerified &&
145 145
 			$oldData[self::PROPERTY_TWITTER]['value'] !== $newData[self::PROPERTY_TWITTER]['value']
146 146
 		) {
147 147
 			$newData[self::PROPERTY_TWITTER]['value']['verified'] = self::NOT_VERIFIED;
148 148
 		}
149 149
 
150
-		if($websiteVerified &&
150
+		if ($websiteVerified &&
151 151
 			$oldData[self::PROPERTY_WEBSITE]['value'] !== $newData[self::PROPERTY_WEBSITE]['value']
152 152
 		) {
153 153
 			$newData[self::PROPERTY_WEBSITE]['value']['verified'] = self::NOT_VERIFIED;
154 154
 		}
155 155
 
156
-		if($emailVerified &&
156
+		if ($emailVerified &&
157 157
 			$oldData[self::PROPERTY_EMAIL]['value'] !== $newData[self::PROPERTY_EMAIL]['value']
158 158
 		) {
159 159
 			$newData[self::PROPERTY_EMAIL]['value']['verified'] = self::NOT_VERIFIED;
Please login to merge, or discard this patch.
settings/Controller/UsersController.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 		// check for encryption state - TODO see formatUserForIndex
162 162
 		$this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption');
163
-		if($this->isEncryptionAppEnabled) {
163
+		if ($this->isEncryptionAppEnabled) {
164 164
 			// putting this directly in empty is possible in PHP 5.5+
165 165
 			$result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0);
166 166
 			$this->isRestoreEnabled = !empty($result);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		}
201 201
 
202 202
 		$subAdminGroups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($user);
203
-		foreach($subAdminGroups as $key => $subAdminGroup) {
203
+		foreach ($subAdminGroups as $key => $subAdminGroup) {
204 204
 			$subAdminGroups[$key] = $subAdminGroup->getGID();
205 205
 		}
206 206
 
@@ -257,16 +257,16 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function index($offset = 0, $limit = 10, $gid = '', $pattern = '', $backend = '') {
259 259
 		// FIXME: The JS sends the group '_everyone' instead of no GID for the "all users" group.
260
-		if($gid === '_everyone') {
260
+		if ($gid === '_everyone') {
261 261
 			$gid = '';
262 262
 		}
263 263
 
264 264
 		// Remove backends
265
-		if(!empty($backend)) {
265
+		if (!empty($backend)) {
266 266
 			$activeBackends = $this->userManager->getBackends();
267 267
 			$this->userManager->clearBackends();
268
-			foreach($activeBackends as $singleActiveBackend) {
269
-				if($backend === get_class($singleActiveBackend)) {
268
+			foreach ($activeBackends as $singleActiveBackend) {
269
+				if ($backend === get_class($singleActiveBackend)) {
270 270
 					$this->userManager->registerBackend($singleActiveBackend);
271 271
 					break;
272 272
 				}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		$users = [];
277 277
 		if ($this->isAdmin) {
278 278
 
279
-			if($gid !== '') {
279
+			if ($gid !== '') {
280 280
 				$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
281 281
 			} else {
282 282
 				$batch = $this->userManager->search($pattern, $limit, $offset);
@@ -296,17 +296,17 @@  discard block
 block discarded – undo
296 296
 			$subAdminOfGroups = $gids;
297 297
 
298 298
 			// Set the $gid parameter to an empty value if the subadmin has no rights to access a specific group
299
-			if($gid !== '' && !in_array($gid, $subAdminOfGroups)) {
299
+			if ($gid !== '' && !in_array($gid, $subAdminOfGroups)) {
300 300
 				$gid = '';
301 301
 			}
302 302
 
303 303
 			// Batch all groups the user is subadmin of when a group is specified
304 304
 			$batch = [];
305
-			if($gid === '') {
306
-				foreach($subAdminOfGroups as $group) {
305
+			if ($gid === '') {
306
+				foreach ($subAdminOfGroups as $group) {
307 307
 					$groupUsers = $this->groupManager->displayNamesInGroup($group, $pattern, $limit, $offset);
308 308
 
309
-					foreach($groupUsers as $uid => $displayName) {
309
+					foreach ($groupUsers as $uid => $displayName) {
310 310
 						$batch[$uid] = $displayName;
311 311
 					}
312 312
 				}
@@ -338,11 +338,11 @@  discard block
 block discarded – undo
338 338
 	 * @param string $email
339 339
 	 * @return DataResponse
340 340
 	 */
341
-	public function create($username, $password, array $groups=array(), $email='') {
342
-		if($email !== '' && !$this->mailer->validateMailAddress($email)) {
341
+	public function create($username, $password, array $groups = array(), $email = '') {
342
+		if ($email !== '' && !$this->mailer->validateMailAddress($email)) {
343 343
 			return new DataResponse(
344 344
 				array(
345
-					'message' => (string)$this->l10n->t('Invalid mail address')
345
+					'message' => (string) $this->l10n->t('Invalid mail address')
346 346
 				),
347 347
 				Http::STATUS_UNPROCESSABLE_ENTITY
348 348
 			);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 			if (!empty($groups)) {
355 355
 				foreach ($groups as $key => $group) {
356 356
 					$groupObject = $this->groupManager->get($group);
357
-					if($groupObject === null) {
357
+					if ($groupObject === null) {
358 358
 						unset($groups[$key]);
359 359
 						continue;
360 360
 					}
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 		if ($this->userManager->userExists($username)) {
379 379
 			return new DataResponse(
380 380
 				array(
381
-					'message' => (string)$this->l10n->t('A user with that name already exists.')
381
+					'message' => (string) $this->l10n->t('A user with that name already exists.')
382 382
 				),
383 383
 				Http::STATUS_CONFLICT
384 384
 			);
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 			if ($email === '') {
390 390
 				return new DataResponse(
391 391
 					array(
392
-						'message' => (string)$this->l10n->t('To send a password link to the user an email address is required.')
392
+						'message' => (string) $this->l10n->t('To send a password link to the user an email address is required.')
393 393
 					),
394 394
 					Http::STATUS_UNPROCESSABLE_ENTITY
395 395
 				);
@@ -414,12 +414,12 @@  discard block
 block discarded – undo
414 414
 			);
415 415
 		}
416 416
 
417
-		if($user instanceof IUser) {
418
-			if($groups !== null) {
419
-				foreach($groups as $groupName) {
417
+		if ($user instanceof IUser) {
418
+			if ($groups !== null) {
419
+				foreach ($groups as $groupName) {
420 420
 					$group = $this->groupManager->get($groupName);
421 421
 
422
-					if(empty($group)) {
422
+					if (empty($group)) {
423 423
 						$group = $this->groupManager->createGroup($groupName);
424 424
 					}
425 425
 					$group->addUser($user);
@@ -428,19 +428,19 @@  discard block
 block discarded – undo
428 428
 			/**
429 429
 			 * Send new user mail only if a mail is set
430 430
 			 */
431
-			if($email !== '') {
431
+			if ($email !== '') {
432 432
 				$user->setEMailAddress($email);
433 433
 
434 434
 				if ($generatedPassword) {
435 435
 					$token = $this->secureRandom->generate(
436 436
 						21,
437
-						ISecureRandom::CHAR_DIGITS .
438
-						ISecureRandom::CHAR_LOWER .
437
+						ISecureRandom::CHAR_DIGITS.
438
+						ISecureRandom::CHAR_LOWER.
439 439
 						ISecureRandom::CHAR_UPPER
440 440
 					);
441
-					$tokenValue = $this->timeFactory->getTime() . ':' . $token;
441
+					$tokenValue = $this->timeFactory->getTime().':'.$token;
442 442
 					$mailAddress = !is_null($user->getEMailAddress()) ? $user->getEMailAddress() : '';
443
-					$encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress . $this->config->getSystemValue('secret'));
443
+					$encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress.$this->config->getSystemValue('secret'));
444 444
 					$this->config->setUserValue($username, 'core', 'lostpassword', $encryptedValue);
445 445
 
446 446
 					$link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $username, 'token' => $token]);
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
 					$message->setPlainBody($plainTextMailContent);
471 471
 					$message->setFrom([$this->fromMailAddress => $this->defaults->getName()]);
472 472
 					$this->mailer->send($message);
473
-				} catch(\Exception $e) {
474
-					$this->log->error("Can't send new user mail to $email: " . $e->getMessage(), array('app' => 'settings'));
473
+				} catch (\Exception $e) {
474
+					$this->log->error("Can't send new user mail to $email: ".$e->getMessage(), array('app' => 'settings'));
475 475
 				}
476 476
 			}
477 477
 			// fetch users groups
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
 		return new DataResponse(
487 487
 			array(
488
-				'message' => (string)$this->l10n->t('Unable to create user.')
488
+				'message' => (string) $this->l10n->t('Unable to create user.')
489 489
 			),
490 490
 			Http::STATUS_FORBIDDEN
491 491
 		);
@@ -503,32 +503,32 @@  discard block
 block discarded – undo
503 503
 		$userId = $this->userSession->getUser()->getUID();
504 504
 		$user = $this->userManager->get($id);
505 505
 
506
-		if($userId === $id) {
506
+		if ($userId === $id) {
507 507
 			return new DataResponse(
508 508
 				array(
509 509
 					'status' => 'error',
510 510
 					'data' => array(
511
-						'message' => (string)$this->l10n->t('Unable to delete user.')
511
+						'message' => (string) $this->l10n->t('Unable to delete user.')
512 512
 					)
513 513
 				),
514 514
 				Http::STATUS_FORBIDDEN
515 515
 			);
516 516
 		}
517 517
 
518
-		if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
518
+		if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
519 519
 			return new DataResponse(
520 520
 				array(
521 521
 					'status' => 'error',
522 522
 					'data' => array(
523
-						'message' => (string)$this->l10n->t('Authentication error')
523
+						'message' => (string) $this->l10n->t('Authentication error')
524 524
 					)
525 525
 				),
526 526
 				Http::STATUS_FORBIDDEN
527 527
 			);
528 528
 		}
529 529
 
530
-		if($user) {
531
-			if($user->delete()) {
530
+		if ($user) {
531
+			if ($user->delete()) {
532 532
 				return new DataResponse(
533 533
 					array(
534 534
 						'status' => 'success',
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 			array(
546 546
 				'status' => 'error',
547 547
 				'data' => array(
548
-					'message' => (string)$this->l10n->t('Unable to delete user.')
548
+					'message' => (string) $this->l10n->t('Unable to delete user.')
549 549
 				)
550 550
 			),
551 551
 			Http::STATUS_FORBIDDEN
@@ -570,13 +570,13 @@  discard block
 block discarded – undo
570 570
 
571 571
 		$accountData = $this->accountManager->getUser($user);
572 572
 		$cloudId = $user->getCloudId();
573
-		$message = "Use my Federated Cloud ID to share with me: " . $cloudId;
573
+		$message = "Use my Federated Cloud ID to share with me: ".$cloudId;
574 574
 		$privateKey = $this->keyManager->getKey($user)->getPrivate();
575 575
 		openssl_sign(json_encode($message), $signature, $privateKey, OPENSSL_ALGO_SHA512);
576 576
 		$signatureBase64 = base64_encode($signature);
577 577
 
578
-		$code = $message . ' ' . $signatureBase64;
579
-		$codeMd5 = $message . ' ' . md5($signatureBase64);
578
+		$code = $message.' '.$signatureBase64;
579
+		$codeMd5 = $message.' '.md5($signatureBase64);
580 580
 
581 581
 		switch ($account) {
582 582
 			case 'verify-twitter':
@@ -632,12 +632,12 @@  discard block
 block discarded – undo
632 632
 									$twitterScope
633 633
 	) {
634 634
 
635
-		if(!empty($email) && !$this->mailer->validateMailAddress($email)) {
635
+		if (!empty($email) && !$this->mailer->validateMailAddress($email)) {
636 636
 			return new DataResponse(
637 637
 				array(
638 638
 					'status' => 'error',
639 639
 					'data' => array(
640
-						'message' => (string)$this->l10n->t('Invalid mail address')
640
+						'message' => (string) $this->l10n->t('Invalid mail address')
641 641
 					)
642 642
 				),
643 643
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 						'websiteScope' => $websiteScope,
673 673
 						'address' => $address,
674 674
 						'addressScope' => $addressScope,
675
-						'message' => (string)$this->l10n->t('Settings saved')
675
+						'message' => (string) $this->l10n->t('Settings saved')
676 676
 					)
677 677
 				),
678 678
 				Http::STATUS_OK
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 
750 750
 			$uniqueUsers = [];
751 751
 			foreach ($groups as $group) {
752
-				foreach($group->getUsers() as $uid => $displayName) {
752
+				foreach ($group->getUsers() as $uid => $displayName) {
753 753
 					$uniqueUsers[$uid] = true;
754 754
 				}
755 755
 			}
@@ -843,19 +843,19 @@  discard block
 block discarded – undo
843 843
 				array(
844 844
 					'status' => 'error',
845 845
 					'data' => array(
846
-						'message' => (string)$this->l10n->t('Forbidden')
846
+						'message' => (string) $this->l10n->t('Forbidden')
847 847
 					)
848 848
 				),
849 849
 				Http::STATUS_FORBIDDEN
850 850
 			);
851 851
 		}
852 852
 
853
-		if($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
853
+		if ($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
854 854
 			return new DataResponse(
855 855
 				array(
856 856
 					'status' => 'error',
857 857
 					'data' => array(
858
-						'message' => (string)$this->l10n->t('Invalid mail address')
858
+						'message' => (string) $this->l10n->t('Invalid mail address')
859 859
 					)
860 860
 				),
861 861
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 				array(
868 868
 					'status' => 'error',
869 869
 					'data' => array(
870
-						'message' => (string)$this->l10n->t('Invalid user')
870
+						'message' => (string) $this->l10n->t('Invalid user')
871 871
 					)
872 872
 				),
873 873
 				Http::STATUS_UNPROCESSABLE_ENTITY
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 				array(
881 881
 					'status' => 'error',
882 882
 					'data' => array(
883
-						'message' => (string)$this->l10n->t('Unable to change mail address')
883
+						'message' => (string) $this->l10n->t('Unable to change mail address')
884 884
 					)
885 885
 				),
886 886
 				Http::STATUS_FORBIDDEN
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
 					'data' => array(
899 899
 						'username' => $id,
900 900
 						'mailAddress' => $mailAddress,
901
-						'message' => (string)$this->l10n->t('Email saved')
901
+						'message' => (string) $this->l10n->t('Email saved')
902 902
 					)
903 903
 				),
904 904
 				Http::STATUS_OK
Please login to merge, or discard this patch.