Rewritten to use NICKNAME_IS_ACTIVE()
authorRoland Häder <roland@mxchange.org>
Mon, 17 Aug 2009 18:02:53 +0000 (18:02 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 17 Aug 2009 18:02:53 +0000 (18:02 +0000)
inc/libs/nickname_functions.php
inc/libs/user_functions.php
inc/modules/guest/what-login.php

index fc575fb..c776c5f 100644 (file)
@@ -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) != '');
-}
-
 //
 ?>
index 0737b41..5fc33f7 100644 (file)
@@ -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__);
index f48373d..6c10396 100644 (file)
@@ -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 {