@@ -40,7 +40,7 @@ |
||
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 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | list($partialId, $partialStage) = WebRequest::getAuthPartialLogin(); |
19 | 19 | |
20 | - if($partialId !== null && $partialStage > 1) { |
|
20 | + if ($partialId !== null && $partialStage > 1) { |
|
21 | 21 | $sql = 'SELECT type FROM credential WHERE user = :user AND factor = :stage AND disabled = 0 ORDER BY priority'; |
22 | 22 | $statement = $this->getDatabase()->prepare($sql); |
23 | 23 | $statement->execute(array(':user' => $partialId, ':stage' => $partialStage)); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | |
91 | 91 | $apiParams['format'] = 'json'; |
92 | 92 | |
93 | - if ($apiParams === null || ! is_array($apiParams)) { |
|
93 | + if ($apiParams === null || !is_array($apiParams)) { |
|
94 | 94 | throw new CurlException("Invalid API call"); |
95 | 95 | } |
96 | 96 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | curl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, false); |
34 | 34 | } |
35 | 35 | |
36 | - if($cookieJar !== null) { |
|
36 | + if ($cookieJar !== null) { |
|
37 | 37 | curl_setopt($this->curlHandle, CURLOPT_COOKIEFILE, $cookieJar); |
38 | 38 | curl_setopt($this->curlHandle, CURLOPT_COOKIEJAR, $cookieJar); |
39 | 39 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function isHospitalised() |
168 | 168 | { |
169 | 169 | $this->whereClause .= ' AND status = ?'; |
170 | - $this->parameterList[] = RequestStatus::HOSPITAL; |
|
170 | + $this->parameterList[] = RequestStatus::HOSPITAL; |
|
171 | 171 | |
172 | 172 | return $this; |
173 | 173 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function notHospitalised() |
181 | 181 | { |
182 | 182 | $this->whereClause .= ' AND status <> ?'; |
183 | - $this->parameterList[] = RequestStatus::HOSPITAL; |
|
183 | + $this->parameterList[] = RequestStatus::HOSPITAL; |
|
184 | 184 | |
185 | 185 | return $this; |
186 | 186 | } |
@@ -214,7 +214,8 @@ |
||
214 | 214 | 'jobId' => $job->getId(), |
215 | 215 | 'jobDesc' => JobQueue::getTaskDescriptions()[$job->getTask()], |
216 | 216 | ); |
217 | - } else { |
|
217 | + } |
|
218 | + else { |
|
218 | 219 | $requestLogs[] = array( |
219 | 220 | 'type' => 'log', |
220 | 221 | 'security' => 'user', |
@@ -352,7 +352,7 @@ |
||
352 | 352 | */ |
353 | 353 | public function setIp(?string $ip, ?int $mask): void |
354 | 354 | { |
355 | - if($ip === null) { |
|
355 | + if ($ip === null) { |
|
356 | 356 | $this->ip = null; |
357 | 357 | } else { |
358 | 358 | $this->ip = inet_pton($ip); |
@@ -354,7 +354,8 @@ |
||
354 | 354 | { |
355 | 355 | if($ip === null) { |
356 | 356 | $this->ip = null; |
357 | - } else { |
|
357 | + } |
|
358 | + else { |
|
358 | 359 | $this->ip = inet_pton($ip); |
359 | 360 | } |
360 | 361 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - $idList = explode(',',$rawIdList); |
|
53 | + $idList = explode(',', $rawIdList); |
|
54 | 54 | |
55 | 55 | $bans = Ban::getByIdList($idList, $this->getDatabase()); |
56 | 56 | |
@@ -188,16 +188,16 @@ discard block |
||
188 | 188 | $targetMask = null; |
189 | 189 | |
190 | 190 | // check the user is allowed to use provided targets |
191 | - if(!$this->barrierTest('name', $user, 'BanType')) { |
|
191 | + if (!$this->barrierTest('name', $user, 'BanType')) { |
|
192 | 192 | $targetName = null; |
193 | 193 | } |
194 | - if(!$this->barrierTest('ip', $user, 'BanType')) { |
|
194 | + if (!$this->barrierTest('ip', $user, 'BanType')) { |
|
195 | 195 | $targetIp = null; |
196 | 196 | } |
197 | - if(!$this->barrierTest('email', $user, 'BanType')) { |
|
197 | + if (!$this->barrierTest('email', $user, 'BanType')) { |
|
198 | 198 | $targetEmail = null; |
199 | 199 | } |
200 | - if(!$this->barrierTest('useragent', $user, 'BanType')) { |
|
200 | + if (!$this->barrierTest('useragent', $user, 'BanType')) { |
|
201 | 201 | $targetUseragent = null; |
202 | 202 | } |
203 | 203 |
@@ -215,7 +215,8 @@ |
||
215 | 215 | $ipParts = explode('/', $targetIp, 2); |
216 | 216 | $targetIp = $ipParts[0]; |
217 | 217 | $targetMask = $ipParts[1]; |
218 | - } else { |
|
218 | + } |
|
219 | + else { |
|
219 | 220 | $targetMask = filter_var($targetIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? 128 : 32; |
220 | 221 | } |
221 | 222 |