From c9eeea4ffb9f186fb8d5207542a0bb0da7028f83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 17 Nov 2009 20:30:22 +0000 Subject: [PATCH] Possible fix #2 --- inc/libs/user_functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 32d21c16a7..8e1435575b 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -415,7 +415,11 @@ function doNewUserPassword ($email, $userid) { // Probe userid/nickname // @TODO We should try to rewrite this to fetchUserData() somehow - if ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) { + if (!empty($email)) { + // Email entered + $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' LIMIT 1", + array($email), __FUNCTION__, __LINE__); + } elseif ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' OR `userid`='%s' OR `email`='%s' LIMIT 1", array($userid, $userid, $email), __FUNCTION__, __LINE__); @@ -423,10 +427,6 @@ function doNewUserPassword ($email, $userid) { // Direct userid entered $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", array(bigintval($userid)), __FUNCTION__, __LINE__); - } elseif (!empty($email)) { - // Email entered - $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' LIMIT 1", - array($email), __FUNCTION__, __LINE__); } else { // Userid not set! logDebugMessage(__FUNCTION__, __LINE__, 'Userid is not set! BUG!'); -- 2.39.2