projects
/
mailer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
af98c1d
)
Possible fix #2
author
Roland Häder
<roland@mxchange.org>
Tue, 17 Nov 2009 20:30:22 +0000
(20:30 +0000)
committer
Roland Häder
<roland@mxchange.org>
Tue, 17 Nov 2009 20:30:22 +0000
(20:30 +0000)
inc/libs/user_functions.php
patch
|
blob
|
history
diff --git
a/inc/libs/user_functions.php
b/inc/libs/user_functions.php
index 32d21c16a7190617159858df4453efb646aeddbc..8e1435575bbc784b2ab413086058ad3e6fdd4a85 100644
(file)
--- 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
// 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__);
// 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__);
// 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!');
} else {
// Userid not set!
logDebugMessage(__FUNCTION__, __LINE__, 'Userid is not set! BUG!');