[BUGFIX] Make fetchUserRecord callable without username 76/19776/2
authorRobert Heel <typo3.org@bobosch.de>
Wed, 10 Apr 2013 10:32:30 +0000 (12:32 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Wed, 10 Apr 2013 10:39:18 +0000 (12:39 +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/19776
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
t3lib/class.t3lib_userauth.php

index 79ff8c8..18c6c47 100644 (file)
@@ -1479,7 +1479,7 @@ class t3lib_userAuth {
        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) {