@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | $autocomplete = $this->config->getSystemValue('login_form_autocomplete', true); |
176 | - if ($autocomplete){ |
|
176 | + if ($autocomplete) { |
|
177 | 177 | $parameters['login_form_autocomplete'] = 'on'; |
178 | 178 | } else { |
179 | 179 | $parameters['login_form_autocomplete'] = 'off'; |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | * @return RedirectResponse |
277 | 277 | */ |
278 | 278 | public function tryLogin($user, $password, $redirect_url, $remember_login = true, $timezone = '', $timezone_offset = '') { |
279 | - if(!is_string($user)) { |
|
279 | + if (!is_string($user)) { |
|
280 | 280 | throw new \InvalidArgumentException('Username must be string'); |
281 | 281 | } |
282 | 282 | |
283 | 283 | // If the user is already logged in and the CSRF check does not pass then |
284 | 284 | // simply redirect the user to the correct page as required. This is the |
285 | 285 | // case when an user has already logged-in, in another tab. |
286 | - if(!$this->request->passesCSRFCheck()) { |
|
286 | + if (!$this->request->passesCSRFCheck()) { |
|
287 | 287 | return $this->generateRedirect($redirect_url); |
288 | 288 | } |
289 | 289 | |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | $userObj = $this->userManager->get($user); |
297 | 297 | |
298 | 298 | if ($userObj !== null && $userObj->isEnabled() === false) { |
299 | - $this->logger->warning('Login failed: \''. $user . '\' disabled' . |
|
300 | - ' (Remote IP: \''. $this->request->getRemoteAddress(). '\')', |
|
299 | + $this->logger->warning('Login failed: \''.$user.'\' disabled'. |
|
300 | + ' (Remote IP: \''.$this->request->getRemoteAddress().'\')', |
|
301 | 301 | ['app' => 'core']); |
302 | 302 | return $this->createLoginFailedResponse($user, $originalUser, |
303 | 303 | $redirect_url, self::LOGIN_MSG_USERDISABLED); |
@@ -312,15 +312,15 @@ discard block |
||
312 | 312 | if (count($users) === 1) { |
313 | 313 | $previousUser = $user; |
314 | 314 | $user = $users[0]->getUID(); |
315 | - if($user !== $previousUser) { |
|
315 | + if ($user !== $previousUser) { |
|
316 | 316 | $loginResult = $this->userManager->checkPassword($user, $password); |
317 | 317 | } |
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
321 | 321 | if ($loginResult === false) { |
322 | - $this->logger->warning('Login failed: \''. $user . |
|
323 | - '\' (Remote IP: \''. $this->request->getRemoteAddress(). '\')', |
|
322 | + $this->logger->warning('Login failed: \''.$user. |
|
323 | + '\' (Remote IP: \''.$this->request->getRemoteAddress().'\')', |
|
324 | 324 | ['app' => 'core']); |
325 | 325 | return $this->createLoginFailedResponse($user, $originalUser, |
326 | 326 | $redirect_url, self::LOGIN_MSG_INVALIDPASSWORD); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $this->userSession->completeLogin($loginResult, ['loginName' => $user, 'password' => $password]); |
332 | 332 | |
333 | 333 | $tokenType = IToken::REMEMBER; |
334 | - if ((int)$this->config->getSystemValue('remember_login_cookie_lifetime', 60*60*24*15) === 0) { |
|
334 | + if ((int) $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15) === 0) { |
|
335 | 335 | $remember_login = false; |
336 | 336 | $tokenType = IToken::DO_NOT_REMEMBER; |
337 | 337 | } |