@@ -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 |
@@ -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 |
@@ -33,8 +33,8 @@ |
||
33 | 33 | |
34 | 34 | foreach (['bootstrap-main', 'bootstrap-alt'] as $file) { |
35 | 35 | file_put_contents( |
36 | - self::RESOURCES_GENERATED . '/' . $file . '.css', |
|
37 | - $scss->compile('/*! Do not edit this auto-generated file! */ @import "' . $file . '";')); |
|
36 | + self::RESOURCES_GENERATED.'/'.$file.'.css', |
|
37 | + $scss->compile('/*! Do not edit this auto-generated file! */ @import "'.$file.'";')); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -62,15 +62,15 @@ |
||
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 | - WebRequest::setPostLoginRedirect($this->getConfiguration()->getBaseUrl() . "/internal.php/multiFactor"); |
|
68 | + WebRequest::setPostLoginRedirect($this->getConfiguration()->getBaseUrl()."/internal.php/multiFactor"); |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - if($usedToken === null) { |
|
73 | + if ($usedToken === null) { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $userSearchRequest = WebRequest::getString('usersearch'); |
41 | 41 | if ($userSearchRequest !== null) { |
42 | 42 | $searchedUser = User::getByUsername($userSearchRequest, $database); |
43 | - if($searchedUser !== false) { |
|
43 | + if ($searchedUser !== false) { |
|
44 | 44 | $this->redirect('statistics/users', 'detail', ['user' => $searchedUser->getId()]); |
45 | 45 | return; |
46 | 46 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | |
137 | - $newValue = WebRequest::postBoolean('role-' . $name) ? 1 : 0; |
|
137 | + $newValue = WebRequest::postBoolean('role-'.$name) ? 1 : 0; |
|
138 | 138 | if ($newValue !== $r['active']) { |
139 | 139 | if ($newValue === 0) { |
140 | 140 | $delete[] = $r['object']; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $user->save(); |
178 | 178 | |
179 | 179 | $this->getNotificationHelper()->userRolesEdited($user, $reason); |
180 | - SessionAlert::quick('Roles changed for user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
180 | + SessionAlert::quick('Roles changed for user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
181 | 181 | |
182 | 182 | $this->redirect('statistics/users', 'detail', array('user' => $user->getId())); |
183 | 183 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | Logger::suspendedUser($database, $user, $reason); |
231 | 231 | |
232 | 232 | $this->getNotificationHelper()->userSuspended($user, $reason); |
233 | - SessionAlert::quick('Suspended user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
233 | + SessionAlert::quick('Suspended user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
234 | 234 | |
235 | 235 | // send email |
236 | 236 | $this->sendStatusChangeEmail( |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | Logger::declinedUser($database, $user, $reason); |
292 | 292 | |
293 | 293 | $this->getNotificationHelper()->userDeclined($user, $reason); |
294 | - SessionAlert::quick('Declined user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
294 | + SessionAlert::quick('Declined user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
295 | 295 | |
296 | 296 | // send email |
297 | 297 | $this->sendStatusChangeEmail( |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | Logger::approvedUser($database, $user); |
347 | 347 | |
348 | 348 | $this->getNotificationHelper()->userApproved($user); |
349 | - SessionAlert::quick('Approved user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
349 | + SessionAlert::quick('Approved user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
350 | 350 | |
351 | 351 | // send email |
352 | 352 | $this->sendStatusChangeEmail( |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | 'ip' => '172.16.0.164', |
37 | 37 | 'routable' => false, |
38 | 38 | |
39 | - ],[ |
|
39 | + ], [ |
|
40 | 40 | 'trust' => true, |
41 | 41 | 'ip' => '198.51.100.123', |
42 | 42 | 'routable' => true, |
43 | 43 | 'rdns' => 'trustedproxy.example.com', |
44 | 44 | |
45 | - ],[ |
|
45 | + ], [ |
|
46 | 46 | 'trust' => true, |
47 | 47 | 'ip' => '192.0.2.1', |
48 | 48 | 'routable' => true, |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | 'ip' => '172.16.0.164', |
64 | 64 | 'routable' => false, |
65 | 65 | |
66 | - ],[ |
|
66 | + ], [ |
|
67 | 67 | 'trust' => false, |
68 | 68 | 'ip' => '198.51.100.234', |
69 | 69 | 'routable' => true, |
70 | 70 | 'rdns' => 'sketchyproxy.example.com', |
71 | 71 | 'showlinks' => true |
72 | 72 | |
73 | - ],[ |
|
73 | + ], [ |
|
74 | 74 | 'trust' => false, |
75 | 75 | 'ip' => '192.0.2.1', |
76 | 76 | 'routable' => true, |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | 'ip' => '172.16.0.164', |
92 | 92 | 'routable' => false, |
93 | 93 | |
94 | - ],[ |
|
94 | + ], [ |
|
95 | 95 | 'trust' => true, |
96 | 96 | 'ip' => '198.51.100.123', |
97 | 97 | 'routable' => true, |
98 | 98 | 'rdns' => 'trustedproxy.example.com', |
99 | - ],[ |
|
99 | + ], [ |
|
100 | 100 | 'trust' => false, |
101 | 101 | 'ip' => '198.51.100.234', |
102 | 102 | 'routable' => true, |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'routable' => true, |
110 | 110 | 'rdns' => 'trustedproxy2.example.com', |
111 | 111 | 'showlinks' => true |
112 | - ],[ |
|
112 | + ], [ |
|
113 | 113 | 'trust' => false, |
114 | 114 | 'ip' => '192.0.2.1', |
115 | 115 | 'routable' => true, |