[BUGFIX] Make fetchUserRecord callable without username 41/13041/5
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:21:56 +0000 (12:21 +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
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php

index 6e6e4e2..3221b08 100644 (file)
@@ -1500,7 +1500,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);