@@ -352,7 +352,7 @@ |
||
| 352 | 352 | $creationTaskClass = null; |
| 353 | 353 | |
| 354 | 354 | if ($action === self::CREATE_OAUTH) { |
| 355 | - if(!$canOauthCreate) { |
|
| 355 | + if (!$canOauthCreate) { |
|
| 356 | 356 | throw new AccessDeniedException($this->getSecurityManager()); |
| 357 | 357 | } |
| 358 | 358 | |
@@ -190,7 +190,7 @@ |
||
| 190 | 190 | $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint(); |
| 191 | 191 | $response = $this->httpHelper->get($endpoint, $parameters); |
| 192 | 192 | $response = json_decode($response, true); |
| 193 | - } |
|
| 193 | + } |
|
| 194 | 194 | catch (CurlException $ex) { |
| 195 | 195 | // failed getting identification status, so throw a nicer error. |
| 196 | 196 | $message = 'Could not contact metawiki API to determine user\' identification status. ' |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | $credentialProvider = new WebAuthnCredentialProvider($database, $this->getSiteConfiguration()); |
| 252 | 252 | |
| 253 | - if(WebRequest::wasPosted()) { |
|
| 253 | + if (WebRequest::wasPosted()) { |
|
| 254 | 254 | // used for routing only, not security |
| 255 | 255 | $stage = WebRequest::postString('stage'); |
| 256 | 256 | |
@@ -281,15 +281,15 @@ discard block |
||
| 281 | 281 | return; |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | - else if($stage == "failure") { |
|
| 284 | + else if ($stage == "failure") { |
|
| 285 | 285 | $this->redirect('multiFactor'); |
| 286 | 286 | return; |
| 287 | 287 | } |
| 288 | - else if($stage == "success") { |
|
| 288 | + else if ($stage == "success") { |
|
| 289 | 289 | SessionAlert::success('Enabled WebAuthn.'); |
| 290 | 290 | |
| 291 | 291 | $scratchProvider = new ScratchTokenCredentialProvider($database, $this->getSiteConfiguration()); |
| 292 | - if($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 292 | + if ($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 293 | 293 | $scratchProvider->setCredential($currentUser, 2, null); |
| 294 | 294 | $tokens = $scratchProvider->getTokens(); |
| 295 | 295 | $this->assign('tokens', $tokens); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | protected function disableWebAuthn() { |
| 358 | - if(!WebRequest::wasPosted()) { |
|
| 358 | + if (!WebRequest::wasPosted()) { |
|
| 359 | 359 | $this->redirect('multiFactor'); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | throw new ApplicationLogicException('User is not enrolled in the selected MFA mechanism'); |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - if(WebRequest::postString("password") === null) { |
|
| 372 | + if (WebRequest::postString("password") === null) { |
|
| 373 | 373 | $this->assignCSRFToken(); |
| 374 | 374 | $this->assign('otpType', "WebAuthn authenticator"); |
| 375 | 375 | $this->assign('identifier', WebRequest::postString('publicKeyId')); |
@@ -338,7 +338,8 @@ discard block |
||
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | throw new ApplicationLogicException('Enrollment failed.'); |
| 341 | - } catch (Throwable $ex) { |
|
| 341 | + } |
|
| 342 | + catch (Throwable $ex) { |
|
| 342 | 343 | SessionAlert::error($ex->getMessage()); |
| 343 | 344 | throw new ApplicationLogicException("", 0, $ex); |
| 344 | 345 | } |
@@ -354,7 +355,8 @@ discard block |
||
| 354 | 355 | } |
| 355 | 356 | } |
| 356 | 357 | |
| 357 | - protected function disableWebAuthn() { |
|
| 358 | + protected function disableWebAuthn() |
|
| 359 | + { |
|
| 358 | 360 | if(!WebRequest::wasPosted()) { |
| 359 | 361 | $this->redirect('multiFactor'); |
| 360 | 362 | } |
@@ -374,7 +376,8 @@ discard block |
||
| 374 | 376 | $this->assign('otpType', "WebAuthn authenticator"); |
| 375 | 377 | $this->assign('identifier', WebRequest::postString('publicKeyId')); |
| 376 | 378 | $this->setTemplate('mfa/disableOtp.tpl'); |
| 377 | - } else { |
|
| 379 | + } |
|
| 380 | + else { |
|
| 378 | 381 | $passwordCredentialProvider = new PasswordCredentialProvider($database, |
| 379 | 382 | $this->getSiteConfiguration()); |
| 380 | 383 | |