@@ -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); |
@@ -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; |
@@ -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 |
@@ -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 | } |
@@ -16,8 +16,8 @@ |
||
16 | 16 | 'google' => 'https://www.google.com/search?q=%DATA%', |
17 | 17 | 'domain' => 'http://%DATA%/', |
18 | 18 | 'rangefinder' => 'https://tools.wmflabs.org/rangeblockfinder/?ip=%DATA%', |
19 | - 'ipcheck' => 'https://ipcheck.toolforge.org/index.php?ip=%DATA%', |
|
20 | - 'bgpview' => 'https://bgpview.io/ip/%DATA%' |
|
19 | + 'ipcheck' => 'https://ipcheck.toolforge.org/index.php?ip=%DATA%', |
|
20 | + 'bgpview' => 'https://bgpview.io/ip/%DATA%' |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | if (!isset($_GET['tool']) |
@@ -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 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $useOAuthSignup = $this->getSiteConfiguration()->getUseOAuthSignup(); |
34 | 34 | if (! $this->getSiteConfiguration()->isRegistrationAllowed()) { |
35 | - throw new AccessDeniedException(); |
|
35 | + throw new AccessDeniedException(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // Dual-mode page |
@@ -77,7 +77,7 @@ |
||
77 | 77 | echo ". Committed txn.\n"; |
78 | 78 | } |
79 | 79 | catch (Exception $ex) { |
80 | - echo ". Encountered exception: " . $ex->getMessage() . "\n"; |
|
80 | + echo ". Encountered exception: ".$ex->getMessage()."\n"; |
|
81 | 81 | $database->rollBack(); |
82 | 82 | echo ". Rolled back txn\n"; |
83 | 83 | throw $ex; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | { |
23 | 23 | $dataList = ''; |
24 | 24 | foreach ($generator() as $dataItem) { |
25 | - $dataList .= '"' . htmlentities($dataItem) . '", '; |
|
25 | + $dataList .= '"'.htmlentities($dataItem).'", '; |
|
26 | 26 | } |
27 | - $dataList = "[" . rtrim($dataList, ", ") . "]"; |
|
27 | + $dataList = "[".rtrim($dataList, ", ")."]"; |
|
28 | 28 | |
29 | 29 | $script = <<<JS |
30 | 30 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | foreach ($this->definedClasses as $class => $js) { |
57 | - $jsBlocks = $js . "\r\n\r\n"; |
|
57 | + $jsBlocks = $js."\r\n\r\n"; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $data = <<<HTML |
@@ -69,7 +69,7 @@ |
||
69 | 69 | $CORSallowed = $this->getSiteConfiguration()->getCrossOriginResourceSharingHosts(); |
70 | 70 | |
71 | 71 | if (in_array($httpOrigin, $CORSallowed)) { |
72 | - header("Access-Control-Allow-Origin: " . $httpOrigin); |
|
72 | + header("Access-Control-Allow-Origin: ".$httpOrigin); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 |