[BUGFIX] @return for TYPO3\CMS\Sv\AuthenticationService::authUser 31/27931/3
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 28 Feb 2014 09:55:13 +0000 (10:55 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 28 Feb 2014 13:46:16 +0000 (14:46 +0100)
Adjust the @return documentation of authUser() to match the actual
implementation in
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication

Change-Id: I2d94cdfee6c58de80c7ec2be2b644b5fcd6c9a97
Resolves: #56421
Releases: 6.0, 6.1, 6.2
Reviewed-on: https://review.typo3.org/27931
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Klee
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/sv/Classes/AuthenticationService.php

index bda31c7..d29431b 100644 (file)
@@ -104,7 +104,15 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
         * Authenticate a user (Check various conditions for the user that might invalidate its authentication, eg. password match, domain, IP, etc.)
         *
         * @param array $user Data of user.
-        * @return boolean
+        *
+        * @return integer >= 200: User authenticated successfully.
+        *                         No more checking is needed by other auth services.
+        *                 >= 100: User not authenticated; this service is not responsible.
+        *                         Other auth services will be asked.
+        *                 > 0:    User authenticated successfully.
+        *                         Other auth services will still be asked.
+        *                 <= 0:   Authentication failed, no more checking needed
+        *                         by other auth services.
         */
        public function authUser(array $user) {
                $OK = 100;
@@ -128,7 +136,7 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
                                        $this->writelog(255, 3, 3, 1, 'Login-attempt from %s (%s), username \'%s\', locked domain \'%s\' did not match \'%s\'!', array($this->authInfo['REMOTE_ADDR'], $this->authInfo['REMOTE_HOST'], $user[$this->db_user['username_column']], $user['lockToDomain'], $this->authInfo['HTTP_HOST']));
                                        \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog(sprintf('Login-attempt from %s (%s), username \'%s\', locked domain \'%s\' did not match \'%s\'!', $this->authInfo['REMOTE_ADDR'], $this->authInfo['REMOTE_HOST'], $user[$this->db_user['username_column']], $user['lockToDomain'], $this->authInfo['HTTP_HOST']), 'Core', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING);
                                }
-                               $OK = FALSE;
+                               $OK = 0;
                        }
                }
                return $OK;