@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | if (password_needs_rehash( |
| 97 | 97 | $password, |
| 98 | - $this->config[ 'password' ][ 'algorithm' ], |
|
| 99 | - $this->config[ 'password' ][ 'options' ] |
|
| 98 | + $this->config['password']['algorithm'], |
|
| 99 | + $this->config['password']['options'] |
|
| 100 | 100 | )) { |
| 101 | 101 | return $this->passwordHash($password); |
| 102 | 102 | } |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | return password_hash( |
| 119 | 119 | $password, |
| 120 | - $this->config[ 'password' ][ 'algorithm' ], |
|
| 121 | - $this->config[ 'password' ][ 'options' ] |
|
| 120 | + $this->config['password']['algorithm'], |
|
| 121 | + $this->config['password']['options'] |
|
| 122 | 122 | ); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function attempt() |
| 146 | 146 | { |
| 147 | - $_SESSION[ 'userAttempts' ] = $this->getAttempts() + 1; |
|
| 147 | + $_SESSION['userAttempts'] = $this->getAttempts() + 1; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // ------------------------------------------------------------------------ |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | public function getAttempts() |
| 158 | 158 | { |
| 159 | 159 | $currentAttempts = 0; |
| 160 | - if (isset($_SESSION[ 'userAttempts' ])) { |
|
| 161 | - $currentAttempts = (int)$_SESSION[ 'userAttempts' ]; |
|
| 160 | + if (isset($_SESSION['userAttempts'])) { |
|
| 161 | + $currentAttempts = (int)$_SESSION['userAttempts']; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | return (int)$currentAttempts; |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function login(array $account) |
| 175 | 175 | { |
| 176 | - $_SESSION[ 'account' ] = $account; |
|
| 177 | - unset($_SESSION[ 'userAttempts' ]); |
|
| 176 | + $_SESSION['account'] = $account; |
|
| 177 | + unset($_SESSION['userAttempts']); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // ------------------------------------------------------------------------ |
@@ -223,9 +223,9 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public function loggedIn() |
| 225 | 225 | { |
| 226 | - if (isset($_SESSION[ 'account' ])) { |
|
| 226 | + if (isset($_SESSION['account'])) { |
|
| 227 | 227 | return true; |
| 228 | - } elseif($this->tokenOn()) { |
|
| 228 | + } elseif ($this->tokenOn()) { |
|
| 229 | 229 | return true; |
| 230 | 230 | } elseif ($this->signedOn()) { |
| 231 | 231 | return true; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function tokenOn() |
| 243 | 243 | { |
| 244 | - if(false !== ($token = input()->bearerToken())) { |
|
| 244 | + if (false !== ($token = input()->bearerToken())) { |
|
| 245 | 245 | $_SESSION['account'] = (new JsonWebToken())->decode($token); |
| 246 | 246 | |
| 247 | 247 | globals()->store('account', $_SESSION['account']); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if ($virtualUserId = input()->cookie('ssid')) { |
| 266 | 266 | $cacheItemPool = $this->getCacheItemPool(); |
| 267 | 267 | |
| 268 | - if($cacheItemPool->hasItem('sso-' . $virtualUserId)) { |
|
| 268 | + if ($cacheItemPool->hasItem('sso-' . $virtualUserId)) { |
|
| 269 | 269 | |
| 270 | 270 | $item = $cacheItemPool->getItem('sso-' . input()->cookie('ssid')); |
| 271 | 271 | $_SESSION['account'] = $item->get(); |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | { |
| 289 | 289 | $this->signOff(); |
| 290 | 290 | |
| 291 | - if (isset($_SESSION[ 'account' ])) { |
|
| 292 | - unset($_SESSION[ 'account' ]); |
|
| 291 | + if (isset($_SESSION['account'])) { |
|
| 292 | + unset($_SESSION['account']); |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |