@@ -277,8 +277,9 @@ discard block |
||
| 277 | 277 | * |
| 278 | 278 | * @param string $path The path (relative to the application root) of the file |
| 279 | 279 | */ |
| 280 | - final protected function addCss($path) { |
|
| 281 | - if(in_array($path, $this->extraCss)){ |
|
| 280 | + final protected function addCss($path) |
|
| 281 | + { |
|
| 282 | + if(in_array($path, $this->extraCss)) { |
|
| 282 | 283 | // nothing to do |
| 283 | 284 | return; |
| 284 | 285 | } |
@@ -291,8 +292,9 @@ discard block |
||
| 291 | 292 | * |
| 292 | 293 | * @param string $path The path (relative to the application root) of the file |
| 293 | 294 | */ |
| 294 | - final protected function addJs($path){ |
|
| 295 | - if(in_array($path, $this->extraJs)){ |
|
| 295 | + final protected function addJs($path) |
|
| 296 | + { |
|
| 297 | + if(in_array($path, $this->extraJs)) { |
|
| 296 | 298 | // nothing to do |
| 297 | 299 | return; |
| 298 | 300 | } |
@@ -187,7 +187,8 @@ |
||
| 187 | 187 | $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint(); |
| 188 | 188 | $response = $this->httpHelper->get($endpoint, $parameters); |
| 189 | 189 | $response = json_decode($response, true); |
| 190 | - } catch (CurlException $ex) { |
|
| 190 | + } |
|
| 191 | + catch (CurlException $ex) { |
|
| 191 | 192 | // failed getting identification status, so throw a nicer error. |
| 192 | 193 | $m = 'Could not contact metawiki API to determine user\' identification status. ' |
| 193 | 194 | . 'This is probably a transient error, so please try again.'; |
@@ -11,9 +11,7 @@ |
||
| 11 | 11 | use Waca\DataObjects\Log; |
| 12 | 12 | use Waca\DataObjects\User; |
| 13 | 13 | use Waca\Fragments\NavigationMenuAccessControl; |
| 14 | -use Waca\Helpers\HttpHelper; |
|
| 15 | 14 | use Waca\Helpers\SearchHelpers\LogSearchHelper; |
| 16 | -use Waca\IdentificationVerifier; |
|
| 17 | 15 | use Waca\PdoDatabase; |
| 18 | 16 | use Waca\Security\SecurityManager; |
| 19 | 17 | |
@@ -207,7 +207,8 @@ |
||
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - public function getRoleConfiguration(){ |
|
| 210 | + public function getRoleConfiguration() |
|
| 211 | + { |
|
| 211 | 212 | return $this->roleConfiguration; |
| 212 | 213 | } |
| 213 | 214 | } |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | foreach ($users as $user) { |
| 30 | 30 | $toAdd = array('user'); |
| 31 | 31 | |
| 32 | - if($user['status'] === 'Admin'){ |
|
| 32 | + if($user['status'] === 'Admin') { |
|
| 33 | 33 | $toAdd[] = 'admin'; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if($user['checkuser'] == 1){ |
|
| 36 | + if($user['checkuser'] == 1) { |
|
| 37 | 37 | $toAdd[] = 'checkuser'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $log->setComment($logData); |
| 61 | 61 | $log->save(); |
| 62 | 62 | |
| 63 | - if($user['status'] === 'Admin' || $user['status'] === 'User'){ |
|
| 63 | + if($user['status'] === 'Admin' || $user['status'] === 'User') { |
|
| 64 | 64 | $update->execute(array('id' => $user['id'])); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -10,9 +10,9 @@ |
||
| 10 | 10 | |
| 11 | 11 | use DateTimeImmutable; |
| 12 | 12 | use Exception; |
| 13 | -use stdClass; |
|
| 14 | 13 | use Waca\DataObject; |
| 15 | 14 | use Waca\Exceptions\OptimisticLockFailedException; |
| 15 | +use stdClass; |
|
| 16 | 16 | |
| 17 | 17 | class OAuthIdentity extends DataObject |
| 18 | 18 | { |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | use Waca\DataObjects\Request; |
| 15 | 15 | use Waca\DataObjects\User; |
| 16 | 16 | use Waca\Exceptions\ApplicationLogicException; |
| 17 | -use Waca\Helpers\Logger; |
|
| 18 | 17 | use Waca\Helpers\LogHelper; |
| 18 | +use Waca\Helpers\Logger; |
|
| 19 | 19 | use Waca\Helpers\SearchHelpers\JobQueueSearchHelper; |
| 20 | 20 | use Waca\Helpers\SearchHelpers\LogSearchHelper; |
| 21 | 21 | use Waca\Helpers\SearchHelpers\RequestSearchHelper; |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | public function authenticate(User $user, $data) |
| 25 | 25 | { |
| 26 | 26 | $storedData = $this->getCredentialData($user->getId()); |
| 27 | - if($storedData === null) |
|
| 28 | - { |
|
| 27 | + if($storedData === null) { |
|
| 29 | 28 | // No available credential matching these parameters |
| 30 | 29 | return false; |
| 31 | 30 | } |
@@ -36,7 +35,7 @@ discard block |
||
| 36 | 35 | } |
| 37 | 36 | |
| 38 | 37 | if(password_verify($data, $storedData->getData())) { |
| 39 | - if(password_needs_rehash($storedData->getData(), PASSWORD_BCRYPT, array('cost' => self::PASSWORD_COST))){ |
|
| 38 | + if(password_needs_rehash($storedData->getData(), PASSWORD_BCRYPT, array('cost' => self::PASSWORD_COST))) { |
|
| 40 | 39 | $this->setCredential($user, $storedData->getFactor(), $data); |
| 41 | 40 | } |
| 42 | 41 | |
@@ -50,7 +49,7 @@ discard block |
||
| 50 | 49 | { |
| 51 | 50 | $storedData = $this->getCredentialData($user->getId()); |
| 52 | 51 | |
| 53 | - if($storedData === null){ |
|
| 52 | + if($storedData === null) { |
|
| 54 | 53 | $storedData = $this->createNewCredential($user); |
| 55 | 54 | } |
| 56 | 55 | |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | |
| 143 | 143 | $loginResponse = $this->callApi($params, 'POST'); |
| 144 | 144 | |
| 145 | - if($loginResponse->login->result == 'Success'){ |
|
| 145 | + if($loginResponse->login->result == 'Success') { |
|
| 146 | 146 | return; |
| 147 | 147 | } |
| 148 | 148 | |