@@ -207,7 +207,7 @@ |
||
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - public function getRoleConfiguration(){ |
|
| 210 | + public function getRoleConfiguration() { |
|
| 211 | 211 | return $this->roleConfiguration; |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | foreach ($users as $user) { |
| 30 | 30 | $toAdd = array('user'); |
| 31 | 31 | |
| 32 | - if($user['status'] === 'Admin'){ |
|
| 32 | + if ($user['status'] === 'Admin') { |
|
| 33 | 33 | $toAdd[] = 'admin'; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if($user['checkuser'] == 1){ |
|
| 36 | + if ($user['checkuser'] == 1) { |
|
| 37 | 37 | $toAdd[] = 'checkuser'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $log->setComment($logData); |
| 61 | 61 | $log->save(); |
| 62 | 62 | |
| 63 | - if($user['status'] === 'Admin' || $user['status'] === 'User'){ |
|
| 63 | + if ($user['status'] === 'Admin' || $user['status'] === 'User') { |
|
| 64 | 64 | $update->execute(array('id' => $user['id'])); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -408,7 +408,7 @@ |
||
| 408 | 408 | . '|' . $this->forwardedip // } private data not known to those without access |
| 409 | 409 | . '|' . $this->useragent // } |
| 410 | 410 | . '|' . $this->email // } |
| 411 | - . '|' . $this->status; // to rudimentarily invalidate the token on status change |
|
| 411 | + . '|' . $this->status; // to rudimentarily invalidate the token on status change |
|
| 412 | 412 | |
| 413 | 413 | return hash('sha256', $data); |
| 414 | 414 | } |
@@ -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; |