[BUGFIX] Make fetchUserRecord callable without username 74/19774/2
authorRobert Heel <typo3.org@bobosch.de>
Tue, 27 Nov 2012 00:24:28 +0000 (01:24 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Wed, 10 Apr 2013 10:37:43 +0000 (12:37 +0200)
t3lib_userAuth::fetchUserRecord is not callable without a username.
Fix the $usernameClause to generate a correct SQL query.

Change-Id: I56b5f8bf8b326e880f157c3b4a5a15409305c3d9
Fixes: #39248
Releases: 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/13041
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Reviewed-by: Mattias Nilsson
Reviewed-by: Nicole Cordes
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-on: https://review.typo3.org/19774

typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php

index fe676a0..65a3d32 100644 (file)
@@ -1474,7 +1474,7 @@ abstract class AbstractUserAuthentication {
         */
        public function fetchUserRecord($dbUser, $username, $extraWhere = '') {
                $user = FALSE;
-               $usernameClause = $username ? $dbUser['username_column'] . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($username, $dbUser['table']) : '';
+               $usernameClause = $username ? $dbUser['username_column'] . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($username, $dbUser['table']) : '1=1';
                if ($username || $extraWhere) {
                        // Look up the user by the username and/or extraWhere:
                        $dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $dbUser['table'], $usernameClause . $dbUser['check_pid_clause'] . $dbUser['enable_clause'] . $extraWhere);