From 63d14ce28ba29ba7f176f7aefa78c7c2b96ab5f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 17 Aug 2009 18:02:53 +0000 Subject: [PATCH] Rewritten to use NICKNAME_IS_ACTIVE() --- inc/libs/nickname_functions.php | 7 +------ inc/libs/user_functions.php | 4 ++-- inc/modules/guest/what-login.php | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php index fc575fbf3f..c776c5fb50 100644 --- a/inc/libs/nickname_functions.php +++ b/inc/libs/nickname_functions.php @@ -81,7 +81,7 @@ function NICKNAME_GET_NICK ($userid) { // Increment cache counter incrementConfigEntry('cache_hits'); - } elseif (NICKNAME_IS_ACTIVE($userid)) { + } else { // Init result $result = false; @@ -113,10 +113,5 @@ function NICKNAME_GET_NICK ($userid) { return $ret; } -// Simple wrapper function -function NICKNAME_PROBE_ON_USERID ($uid) { - return (NICKNAME_GET_NICK($uid) != ''); -} - // ?> diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 0737b412fd..5fc33f72a2 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -280,7 +280,7 @@ function USER_DO_LOGIN ($uid, $passwd) { ); // Check login data - if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_PROBE_ON_USERID($uid))) { + if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE($uid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$lastOnline." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND `status`='CONFIRMED' LIMIT 1", array($uid), __FUNCTION__, __LINE__); @@ -411,7 +411,7 @@ function USER_DO_NEW_PASSWORD ($email, $uid) { $result = false; // Probe userid/nickname - if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_PROBE_ON_USERID($uid))) { + if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE($uid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1", array($uid, $email), __FUNCTION__, __LINE__); diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index f48373d62f..6c10396024 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -64,7 +64,7 @@ if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) { $uid = getUserId(); } elseif ((REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST(('password'))) && (isFormSent())) { // Set userid and crypt password when login data was submitted - if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_PROBE_ON_USERID(REQUEST_POST('id')))) { + if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE(REQUEST_POST('id')))) { // Nickname entered $uid = SQL_ESCAPE(REQUEST_POST('id')); } else { -- 2.39.5