From: Roland Häder Date: Tue, 17 Nov 2009 20:30:22 +0000 (+0000) Subject: Possible fix #2 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9eeea4ffb9f186fb8d5207542a0bb0da7028f83;p=mailer.git Possible fix #2 --- 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!');