From 6a880b2f34e4868d461f1afdaf052bd9eaa4d3ca Mon Sep 17 00:00:00 2001 From: quix0r 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.5