[BUGFIX] BE-Login: redirect if already authenticated 37/40037/3
authorFrank Nägler <typo3@naegler.net>
Fri, 5 Jun 2015 22:16:45 +0000 (00:16 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 6 Jun 2015 10:22:42 +0000 (12:22 +0200)
Resolves: #67321
Related: #66669
Releases: master
Change-Id: Ib8de4463194a304467b06d3d0c00f42943e6b8d5
Reviewed-on: http://review.typo3.org/40037
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/LoginController.php

index 4b3df5d..9b7bf6c 100644 (file)
@@ -239,13 +239,16 @@ class LoginController {
         * @throws \UnexpectedValueException
         */
        protected function checkRedirect() {
-               if (empty($this->getBackendUserAuthentication()->user['uid']) && $this->isLoginInProgress()) {
-                       // Wrong password, wait for 5 seconds
-                       sleep(5);
-                       return;
-               }
-               if (!$this->isLoginInProgress() && !$this->loginRefresh) {
-                       return;
+               if (empty($this->getBackendUserAuthentication()->user['uid'])) {
+                       // a) if either the login is just done (isLoginInProgress) or
+                       if ($this->isLoginInProgress()) {
+                               // Wrong password, wait for 5 seconds
+                               sleep(5);
+                               return;
+                       // b) a loginRefresh is done
+                       } elseif (!$this->loginRefresh) {
+                               return;
+                       }
                }
                /*
                 * If no cookie has been set previously, we tell people that this is a problem.