@@ -27,7 +27,7 @@ |
||
| 27 | 27 | try { |
| 28 | 28 | $then = new DateTime($input); |
| 29 | 29 | } |
| 30 | - catch(Exception $ex) { |
|
| 30 | + catch (Exception $ex) { |
|
| 31 | 31 | return $input; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $usedToken = null; |
| 64 | 64 | foreach ($scratchTokens as $scratchToken) { |
| 65 | - if (password_verify($data, $scratchToken)){ |
|
| 65 | + if (password_verify($data, $scratchToken)) { |
|
| 66 | 66 | $usedToken = $scratchToken; |
| 67 | 67 | SessionAlert::quick("Hey, it looks like you used a scratch token to log in. Would you like to change your multi-factor authentication configuration?", 'alert-warning'); |
| 68 | 68 | WebRequest::setPostLoginRedirect($this->getConfiguration()->getBaseUrl() . "/internal.php/multiFactor"); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if($usedToken === null) { |
|
| 73 | + if ($usedToken === null) { |
|
| 74 | 74 | return false; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ':t' => $this->type |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | - if($disabled !== null) { |
|
| 58 | + if ($disabled !== null) { |
|
| 59 | 59 | $sql .= ' AND disabled = :d'; |
| 60 | 60 | $parameters[':d'] = $disabled ? 1 : 0; |
| 61 | 61 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $alternates = $statement->fetchColumn(); |
| 110 | 110 | $statement->closeCursor(); |
| 111 | 111 | |
| 112 | - if($alternates <= 1) { |
|
| 112 | + if ($alternates <= 1) { |
|
| 113 | 113 | // decrement the factor for every stage above this |
| 114 | 114 | $sql = 'UPDATE credential SET factor = factor - 1 WHERE user = :user AND factor > :factor'; |
| 115 | 115 | $statement = $this->database->prepare($sql); |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | public function authenticate(User $user, $data) |
| 31 | 31 | { |
| 32 | 32 | $storedData = $this->getCredentialData($user->getId()); |
| 33 | - if($storedData === null) |
|
| 33 | + if ($storedData === null) |
|
| 34 | 34 | { |
| 35 | 35 | // No available credential matching these parameters |
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if($storedData->getVersion() !== 2) { |
|
| 39 | + if ($storedData->getVersion() !== 2) { |
|
| 40 | 40 | // Non-2 versions are not supported. |
| 41 | 41 | return false; |
| 42 | 42 | } |
@@ -592,7 +592,7 @@ |
||
| 592 | 592 | { |
| 593 | 593 | $cookie = &self::$globalStateProvider->getCookieSuperGlobal(); |
| 594 | 594 | |
| 595 | - if(isset($cookie['sitenotice'])) { |
|
| 595 | + if (isset($cookie['sitenotice'])) { |
|
| 596 | 596 | return $cookie['sitenotice'] === $expectedHash; |
| 597 | 597 | } |
| 598 | 598 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if (!$mediaWikiHelper->checkAccountExists($request->getName())){ |
|
| 64 | + if (!$mediaWikiHelper->checkAccountExists($request->getName())) { |
|
| 65 | 65 | $this->markFailed('Account does not exist!'); |
| 66 | 66 | |
| 67 | 67 | return; |
@@ -82,8 +82,8 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | protected abstract function getMediaWikiClient(); |
| 84 | 84 | |
| 85 | - protected function getMediaWikiHelper(){ |
|
| 86 | - if($this->mwHelper === null) { |
|
| 85 | + protected function getMediaWikiHelper() { |
|
| 86 | + if ($this->mwHelper === null) { |
|
| 87 | 87 | $this->mwHelper = new MediaWikiHelper($this->getMediaWikiClient(), $this->getSiteConfiguration()); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | throw new ApplicationLogicException('Cannot locate request'); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if($this->job->getEmailTemplate() !== null){ |
|
| 180 | + if ($this->job->getEmailTemplate() !== null) { |
|
| 181 | 181 | $this->emailTemplate = EmailTemplate::getById($this->job->getEmailTemplate(), $this->getDatabase()); |
| 182 | 182 | |
| 183 | 183 | if ($this->emailTemplate === false) { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if($this->job->getParameters() !== null) { |
|
| 188 | + if ($this->job->getParameters() !== null) { |
|
| 189 | 189 | $this->parameters = json_decode($this->job->getParameters()); |
| 190 | 190 | |
| 191 | 191 | if (json_last_error() !== JSON_ERROR_NONE) { |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // Should we wait for a parent job? |
| 197 | - if($this->job->getParent() !== null) { |
|
| 197 | + if ($this->job->getParent() !== null) { |
|
| 198 | 198 | /** @var JobQueue $parentJob */ |
| 199 | 199 | $parentJob = JobQueue::getById($this->job->getParent(), $this->getDatabase()); |
| 200 | 200 | |
| 201 | - if($parentJob === false) { |
|
| 201 | + if ($parentJob === false) { |
|
| 202 | 202 | $this->markFailed("Parent job could not be found"); |
| 203 | 203 | return; |
| 204 | 204 | } |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | $oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration()); |
| 147 | 147 | $this->assign('oauth', $oauth); |
| 148 | 148 | |
| 149 | - if($user->getForceIdentified() === null) { |
|
| 149 | + if ($user->getForceIdentified() === null) { |
|
| 150 | 150 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 151 | 151 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 152 | 152 | } else { |