Added ability to allow empty passwords, if the user does so, a random password will...
[mailer.git] / inc / libs / rallye_functions.php
index 40e601a1896978a2f0016f97fb3be2b176e5d4bd..8f9f08127cad44fead03fe90ff7b90d4d74f4a71 100644 (file)
@@ -104,9 +104,7 @@ WHERE
        `userid`=%s
 LIMIT 1",
                        array(bigintval($id), bigintval($content['userid'])), __FUNCTION__, __LINE__);
-               if (SQL_NUMROWS($result_ref) == 0) {
-                       // Free memory
-                       SQL_FREERESULT($result_ref);
+               if (SQL_HASZERONUMS($result_ref)) {
 
                        // Add userid and his ref count to table
                        $result_ref = SQL_QUERY_ESC("SELECT 
@@ -149,6 +147,9 @@ WHERE
                        $un = true;
                } // END - if
 
+               // Free memory
+               SQL_FREERESULT($result_ref);
+
                // Ignored but for the template required refs (made before start of rallye)
                $content['refs']  = $count;
 
@@ -415,7 +416,7 @@ LIMIT 1",
                        ), __FUNCTION__, __LINE__);
 
                // Is this user added?
-               if (SQL_NUMROWS($result) < 1) {
+               if (SQL_HASZERONUMS($result)) {
                        // Add userid and his ref count to table
                        SQL_QUERY_ESC("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_users`