@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | parent::__construct($database, $configuration, 'u2f'); |
34 | 34 | |
35 | - $appId = 'https://' . WebRequest::httpHost(); |
|
35 | + $appId = 'https://'.WebRequest::httpHost(); |
|
36 | 36 | $this->u2f = new U2F($appId); |
37 | 37 | } |
38 | 38 |
@@ -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); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $password = $this->getEncryptionKey(); |
34 | 34 | $encryptedKey = openssl_encrypt($secret, 'aes-256-ctr', $password, OPENSSL_RAW_DATA, $iv); |
35 | 35 | |
36 | - $data = base64_encode($iv) . '|' . base64_encode($encryptedKey); |
|
36 | + $data = base64_encode($iv).'|'.base64_encode($encryptedKey); |
|
37 | 37 | |
38 | 38 | return $data; |
39 | 39 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | $last = array_pop($list); |
18 | 18 | if ($list) { |
19 | - return implode(', ', $list) . ', ' . $conjunction . ' ' . $last; |
|
19 | + return implode(', ', $list).', '.$conjunction.' '.$last; |
|
20 | 20 | } |
21 | 21 | return $last; |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | public function authenticate(User $user, $data) |
27 | 27 | { |
28 | 28 | $storedData = $this->getCredentialData($user->getId()); |
29 | - if($storedData === null) |
|
29 | + if ($storedData === null) |
|
30 | 30 | { |
31 | 31 | // No available credential matching these parameters |
32 | 32 | return false; |
33 | 33 | } |
34 | 34 | |
35 | - if($storedData->getVersion() !== 2) { |
|
35 | + if ($storedData->getVersion() !== 2) { |
|
36 | 36 | // Non-2 versions are not supported. |
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - if(password_verify($data, $storedData->getData())) { |
|
41 | - if(password_needs_rehash($storedData->getData(), self::PASSWORD_ALGO, array('cost' => self::PASSWORD_COST))){ |
|
40 | + if (password_verify($data, $storedData->getData())) { |
|
41 | + if (password_needs_rehash($storedData->getData(), self::PASSWORD_ALGO, array('cost' => self::PASSWORD_COST))) { |
|
42 | 42 | $this->setCredential($user, $storedData->getFactor(), $data); |
43 | 43 | } |
44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | $storedData = $this->getCredentialData($user->getId()); |
54 | 54 | |
55 | - if($storedData === null){ |
|
55 | + if ($storedData === null) { |
|
56 | 56 | $storedData = $this->createNewCredential($user); |
57 | 57 | } |
58 | 58 |
@@ -45,8 +45,8 @@ |
||
45 | 45 | $data = urlencode($data); |
46 | 46 | } |
47 | 47 | |
48 | - echo '<script>window.location.href=' . json_encode(str_replace("%DATA%", $data, $toolList[$tool])) . '</script>'; |
|
48 | + echo '<script>window.location.href='.json_encode(str_replace("%DATA%", $data, $toolList[$tool])).'</script>'; |
|
49 | 49 | } |
50 | 50 | else { |
51 | - header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
|
51 | + header("Location: ".$_SERVER["REQUEST_URI"]."&round2=true"); |
|
52 | 52 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $onWikiName = $strings->ucfirst($onWikiName); |
184 | 184 | |
185 | 185 | $parameters = self::$apiQueryParameters; |
186 | - $parameters['pltitles'] = "User:" . $onWikiName; |
|
186 | + $parameters['pltitles'] = "User:".$onWikiName; |
|
187 | 187 | $parameters['titles'] = $this->siteConfiguration->getIdentificationNoticeboardPage(); |
188 | 188 | |
189 | 189 | try { |
@@ -200,6 +200,6 @@ discard block |
||
200 | 200 | |
201 | 201 | $page = @array_pop($response['query']['pages']); |
202 | 202 | |
203 | - return @$page['links'][0]['title'] === "User:" . $onWikiName; |
|
203 | + return @$page['links'][0]['title'] === "User:".$onWikiName; |
|
204 | 204 | } |
205 | 205 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public static function getByAddress($address, PdoDatabase $database, $forUpdate = false) |
35 | 35 | { |
36 | 36 | $lockMode = $forUpdate ? ' FOR UPDATE' : ''; |
37 | - $sql = "SELECT * FROM geolocation WHERE address = :id LIMIT 1" . $lockMode; |
|
37 | + $sql = "SELECT * FROM geolocation WHERE address = :id LIMIT 1".$lockMode; |
|
38 | 38 | |
39 | 39 | $statement = $database->prepare($sql); |
40 | 40 | $statement->bindValue(":id", $address); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | protected function main() |
29 | 29 | { |
30 | 30 | $useOAuthSignup = $this->getSiteConfiguration()->getUseOAuthSignup(); |
31 | - if (! $this->getSiteConfiguration()->isRegistrationAllowed()) { |
|
31 | + if (!$this->getSiteConfiguration()->isRegistrationAllowed()) { |
|
32 | 32 | throw new AccessDeniedException(); |
33 | 33 | } |
34 | 34 |