@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $users = UserSearchHelper::get($database)->inIds( |
| 22 | 22 | $database->query('SELECT user FROM oauthtoken WHERE type = \'access\'')->fetchColumn()); |
| 23 | 23 | |
| 24 | - foreach ($users as $u){ |
|
| 24 | + foreach ($users as $u) { |
|
| 25 | 25 | $oauth = new OAuthUserHelper($u, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration()); |
| 26 | 26 | $oauth->detach(); |
| 27 | 27 | } |
@@ -229,7 +229,8 @@ discard block |
||
| 229 | 229 | $this->deleteCredential($database, $currentUser, $otpCredentialProvider, $factorType); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - protected function enableU2F() { |
|
| 232 | + protected function enableU2F() |
|
| 233 | + { |
|
| 233 | 234 | $database = $this->getDatabase(); |
| 234 | 235 | $currentUser = User::getCurrent($database); |
| 235 | 236 | |
@@ -336,7 +337,8 @@ discard block |
||
| 336 | 337 | } |
| 337 | 338 | } |
| 338 | 339 | |
| 339 | - protected function disableU2F() { |
|
| 340 | + protected function disableU2F() |
|
| 341 | + { |
|
| 340 | 342 | $database = $this->getDatabase(); |
| 341 | 343 | $currentUser = User::getCurrent($database); |
| 342 | 344 | |
@@ -93,7 +93,8 @@ discard block |
||
| 93 | 93 | return $this->configuration; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function deleteCredential(User $user) { |
|
| 96 | + public function deleteCredential(User $user) |
|
| 97 | + { |
|
| 97 | 98 | // get this factor |
| 98 | 99 | $statement = $this->database->prepare('SELECT * FROM credential WHERE user = :user AND type = :type'); |
| 99 | 100 | $statement->execute(array(':user' => $user->getId(), ':type' => $this->type)); |
@@ -143,7 +144,8 @@ discard block |
||
| 143 | 144 | * |
| 144 | 145 | * @return bool |
| 145 | 146 | */ |
| 146 | - public function userIsEnrolled($userId) { |
|
| 147 | + public function userIsEnrolled($userId) |
|
| 148 | + { |
|
| 147 | 149 | $cred = $this->getCredentialData($userId); |
| 148 | 150 | |
| 149 | 151 | return $cred !== null; |
@@ -62,7 +62,7 @@ |
||
| 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"); |
@@ -44,7 +44,8 @@ |
||
| 44 | 44 | $userObj = User::getByUsername($filterUser, $database); |
| 45 | 45 | if ($userObj !== false) { |
| 46 | 46 | $logSearch->byUser($userObj->getId()); |
| 47 | - } else { |
|
| 47 | + } |
|
| 48 | + else { |
|
| 48 | 49 | $logSearch->byUser(-1); |
| 49 | 50 | } |
| 50 | 51 | } |
@@ -72,7 +72,8 @@ |
||
| 72 | 72 | if ($targetVar !== null && preg_match('/^[a-z]+$/', $targetVar)) { |
| 73 | 73 | $data = $targetVar . ' = ' . $data . ';'; |
| 74 | 74 | header("Content-Type: text/javascript"); |
| 75 | - } else { |
|
| 75 | + } |
|
| 76 | + else { |
|
| 76 | 77 | header("Content-Type: application/json"); |
| 77 | 78 | } |
| 78 | 79 | |
@@ -307,8 +307,9 @@ |
||
| 307 | 307 | * |
| 308 | 308 | * @param string $path The path (relative to the application root) of the file |
| 309 | 309 | */ |
| 310 | - final protected function addJs($path){ |
|
| 311 | - if(in_array($path, $this->extraJs)){ |
|
| 310 | + final protected function addJs($path) |
|
| 311 | + { |
|
| 312 | + if(in_array($path, $this->extraJs)) { |
|
| 312 | 313 | // nothing to do |
| 313 | 314 | return; |
| 314 | 315 | } |
@@ -549,7 +549,8 @@ |
||
| 549 | 549 | * |
| 550 | 550 | * @return bool|null |
| 551 | 551 | */ |
| 552 | - public function getForceIdentified() { |
|
| 552 | + public function getForceIdentified() |
|
| 553 | + { |
|
| 553 | 554 | return $this->forceidentified; |
| 554 | 555 | } |
| 555 | 556 | |
@@ -150,7 +150,8 @@ |
||
| 150 | 150 | if($user->getForceIdentified() === null) { |
| 151 | 151 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 152 | 152 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 153 | - } else { |
|
| 153 | + } |
|
| 154 | + else { |
|
| 154 | 155 | $this->assign('identificationStatus', $user->getForceIdentified() == 1 ? 'forced-on' : 'forced-off'); |
| 155 | 156 | } |
| 156 | 157 | |