More usage of isValdUserId()
authorRoland Häder <roland@mxchange.org>
Thu, 29 Jul 2010 21:01:34 +0000 (21:01 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Jul 2010 21:01:34 +0000 (21:01 +0000)
13 files changed:
DOCS/TODOs.txt
inc/autopurge/purge-general.php
inc/language/de.php
inc/libs/doubler_functions.php
inc/libs/rallye_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_payouts.php
inc/mysql-manager.php
inc/pool/pool-user.php
mailid.php
mailid_top.php

index b182f967edbd13a57e1f498f89d229d69347656d..0a0fe07f243b9e5078f16268f536d77323cf636c 100644 (file)
@@ -49,8 +49,8 @@
 ./inc/functions.php:2255:      // @TODO This is still very static, rewrite it somehow
 ./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:59:        // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1118:// @TODO Rewrite these two constants
-./inc/language/de.php:1133:// @TODO Rewrite these three constants
+./inc/language/de.php:1117:// @TODO Rewrite these two constants
+./inc/language/de.php:1132:// @TODO Rewrite these three constants
 ./inc/language/de.php:300:     // @TODO Following two are unused?
 ./inc/language/de.php:811:// @TODO Are these constants longer used?
 ./inc/language-functions.php:234:      // @TODO These are all valid languages, again hard-coded
index 8a7735c2f98b6a716052b6694d6b892c4713d027..286622c289362b9026c03bb81c9f491701b89f39 100644 (file)
@@ -78,7 +78,7 @@ ORDER BY
                                SQL_FREERESULT($result_links);
 
                                // At least one link was found, enougth to pay back the points
-                               if (($userid != $content['userid']) && ($userid > 0) && ($points > 0)) {
+                               if (($userid != $content['userid']) && (isValidUserId($userid)) && ($points > 0)) {
                                        // Directly add points back to senders account
                                        addPointsAutoPurge($userid, $points);
                                        $points = '0';
index 5ece1e6fa042966a85794a9ae30d4a2bedd25039..a905e24c223f947016308237ebcb65ce74986b75 100644 (file)
@@ -890,7 +890,7 @@ addMessages(array(
        'ADMIN_USER_PROFILE_TITLE' => "Mitgliedsprofil aufrufen",
        'LIST_UNCONFIRMED_MEMBER_LINKS' => "Unbest&auml;tigte Maillinks eines Mitgliedes auflisten",
        'MEMBER_ENTER_MORE_MIN_RECEIVERS' => "Geben Sie mehr als <span class=\"data\">{?order_min?}</span> Empf&auml;nger ein.",
-       'NO_TEMPLATE_SUPPLIED' => "Keinen Template-Namen &uuml;bergeben! Bug im Script erkannt. Bitte den Webmaster ({?WEBMASTER?}) verst&auml;ndigen.",
+       'NO_TEMPLATE_SUPPLIED' => "Keinen Templatenamen &uuml;bergeben! Bug im Script erkannt. Bitte den Webmaster ({?WEBMASTER?}) verst&auml;ndigen.",
        '_OR' => "oder",
        'GUEST_NEW_PASSWORD_SEND' => "Neues Passwort ist zu Ihrem Postfach unterwegs.",
        'UNDER_CONSTRUCTION' => "Funktion noch im Aufbau.",
@@ -964,8 +964,7 @@ addMessages(array(
        'DEFAULT_POINTS' => "Punkte",
        'PROBLEM_POINTS_OVERVIEW_UNAVAILABLE' => "{?POINTS?}-&Uuml;bersicht derzeit nicht verf&uuml;gbar.",
        'ADMIN_NOTHING_SELECTED_CHANGE' => "Sie haben nichts zum &Auml;ndern des Status ausgew&auml;hlt.",
-       'TEMPLATE_CONTENT' => "Template-Content:",
-       'TEMPLATE_DATA' => "Template-Daten:",
+       'TEMPLATE_CONTENT' => "Templatedaten:",
        'ADMIN_LINK_DELETE_USER_TITLE' => "Mitglied l&ouml;schen (mit Abfrage)",
        'ADMIN_LINK_EDIT_USER_TITLE' => "Mitglied editieren",
        'ADMIN_LINK_LOCK_USER_TITLE' => "Mitglied sperren",
index a374d0a42d7a0a4c4f287e740506d50bdf9daa62..4b550e706d5e7c924225dca0d0399c69edc4c978 100644 (file)
@@ -47,7 +47,7 @@ if (!defined('__SECURITY')) {
 function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
        if (empty($cnt)) $cnt = '0';
        $add = ''; $DT_MODE = '0';
-       if ($userid > 0) {
+       if (isValidUserId($userid)) {
                // Load entries only from a single user
                $add = sprintf(" AND `userid`=%s", bigintval($userid));
                $mode = 'member'; $COLS = 4; $DT_MODE = 2;
index ca7e60fb54485d1b44931d4c2fcb8de472c457bd..26babebf3f7a53819133c054e83188c2e1fd92d4 100644 (file)
@@ -468,7 +468,7 @@ function markReferalRallyesAsExpired ($result) {
                $prices['active'][$key] = $active;
 
                // Allow valid and active users with at least one ref to get points
-               if (($userid > 0) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0)) {
+               if ((isValidUserId($userid)) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0)) {
                        $total++;
                } // END - if
        } // END - foreach
@@ -486,7 +486,7 @@ function markReferalRallyesAsExpired ($result) {
        // Run array through (by userid is the most important 2nd-level-array)
        foreach($prices['userid'] as $key => $userid) {
                // Allow valid and active users with at least one ref to get points
-               if (($userid > 0) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0)) {
+               if ((isValidUserId($userid)) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0)) {
                        // Transfer data to array for the mail template
                        $DATA['level']  = $prices['level'][$key];
                        $DATA['points'] = $prices['points'][$key];
index 546f27d070e173ca008032eadfb5a18612041195..8468645b285a0d6f717f172e5a17db240ed253bd 100644 (file)
@@ -876,7 +876,7 @@ function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = '0') {
        } // END - if
 
        // Is the exlude userid set?
-       if ($excludeUserId > 0) {
+       if (isValidUserId($excludeUserId)) {
                // Then add it
                $userids['url_userid'][$excludeUserId] = $excludeUserId;
        } // END - if
index 758ad55be19c9e098851859b29c1d6019b80bd14..fd7ac7740d50a6526bbd8ccddeb823b550c88c86 100644 (file)
@@ -428,7 +428,7 @@ function doNewUserPassword ($email, $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__);
-       } elseif (($userid > 0) && (empty($email))) {
+       } elseif ((isValidUserId($userid)) && (empty($email))) {
                // 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__);
index 0b483d1c7ffd716cde5164f32cd0df028af27b83..5c20771c895554e61dc23c185797c2dc215105ea 100644 (file)
@@ -623,7 +623,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
 function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
-       if (($title == '') && ($userid > 0)) {
+       if (($title == '') && (isValidUserId($userid))) {
                // Set userid as title
                $title = $userid;
        } elseif ($userid == 0) {
@@ -1247,7 +1247,7 @@ function setAdminMenuHasEntries ($action, $hasEntries) {
 // Creates a link to the user's admin-profile
 function adminCreateUserLink ($userid) {
        // Is the userid set correctly?
-       if ($userid > 0) {
+       if (isValidUserId($userid)) {
                // Create a link to that profile
                return '{%url=modules.php?module=admin&amp;what=list_user&amp;userid=' . bigintval($userid) . '%}';
        } // END - if
index 9a95ae69504833b3ac550d2075d9c7af904d4ff3..b846eb8b56352f3925ca4d6267d15375ff2ecb67 100644 (file)
@@ -53,7 +53,7 @@ if (isGetRequestParameterSet('pid')) {
        SQL_FREERESULT($result);
 
        // Obtain some data
-       if (!isGetRequestParameterSet('task') && (!empty($userid)) && ($userid > 0)) {
+       if (!isGetRequestParameterSet('task') && (!empty($userid)) && (isValidUserId($userid))) {
                // Get task id from database
                $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `userid`=%s AND `task_type`='PAYOUT_REQUEST' AND `task_created`=%s LIMIT 1",
                        array(bigintval($userid), bigintval($tstamp)), __FILE__, __LINE__);
@@ -68,7 +68,7 @@ if (isGetRequestParameterSet('pid')) {
                $taskId = getRequestParameter('task');
        }
 
-       if ((!empty($taskId)) && (!empty($userid)) && ($userid > 0)) {
+       if ((!empty($taskId)) && (!empty($userid)) && (isValidUserId($userid))) {
                // Load user's data
                if (!fetchUserData($userid)) {
                        // Abort here because it is not valid!
index ce69ffa3eec6937b46eead2ebc738ee7b01e2ffc..33bbd3fd13af8fa5cd3d58d1d4c7fa5b96341bfc 100644 (file)
@@ -863,7 +863,7 @@ function removeReceiver (&$receivers, $key, $userid, $pool_id, $stats_id = '', $
        $ret = 'failed';
 
        // Is the userid valid?
-       if ($userid > 0) {
+       if (isValidUserId($userid)) {
                // Remove entry from array
                unset($receivers[$key]);
 
index 10d1780feab69f43aeaf6e11b146f190abd1772f..290770b259efebda033070b18e570d41342cbeb2 100644 (file)
@@ -238,7 +238,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                        array(bigintval($DATA['id'])), __FILE__, __LINE__);
                                        } else {
                                                // Is the userid set?
-                                               if ($userid > 0) {
+                                               if (isValidUserId($userid)) {
                                                        // User does not exists, pay points back
                                                        $points = getPaymentPoints($DATA['payment_id']);
                                                        addPointsDirectly('pool_payback', $DATA['sender'], $points);
@@ -267,7 +267,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                // Walk through all points
                foreach ($pointsBack as $userid => $PB) {
                        // Add points only when we have points left to add and a valid user id
-                       if (($PB > 0) && ($userid > 0)) {
+                       if (($PB > 0) && (isValidUserId($userid))) {
                                // Prepare content
                                $content = array(
                                        'points' => $PB
index b7d50bf0b4c0c6fa23916fea16f0917480952b39..bc7848c2d88bd098ff7391c15e964791e8e00273 100644 (file)
@@ -58,33 +58,33 @@ setContentType('text/html');
 redirectOnUninstalledExtension('mailid');
 
 // Init
-$url_userid = '0';
-$url_bid    = '0';
-$url_mid    = '0';
+$userId = '0';
+$bonusId    = '0';
+$mailId    = '0';
 
 // Secure all data
-if (isGetRequestParameterSet('userid'))  $url_userid = bigintval(getRequestParameter('userid'));
-if (isGetRequestParameterSet('mailid'))  $url_mid    = bigintval(getRequestParameter('mailid'));
-if (isGetRequestParameterSet('bonusid')) $url_bid    = bigintval(getRequestParameter('bonusid'));
+if (isGetRequestParameterSet('userid'))  $userId = bigintval(getRequestParameter('userid'));
+if (isGetRequestParameterSet('mailid'))  $mailId    = bigintval(getRequestParameter('mailid'));
+if (isGetRequestParameterSet('bonusid')) $bonusId    = bigintval(getRequestParameter('bonusid'));
 
 // 01           1        12            2    2            21    1                      2210
-if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
        // Init result
        $result_link = false;
 
        // Maybe he wants to confirm an email?
-       if ($url_mid > 0) {
+       if ($mailId > 0) {
                // Normal-Mails
                $result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
-                       array($url_mid, $url_userid), __FILE__, __LINE__);
+                       array($mailId, $userId), __FILE__, __LINE__);
                $type = 'mailid';
-               $urlId = $url_mid;
-       } elseif ($url_bid > 0) {
+               $urlId = $mailId;
+       } elseif ($bonusId > 0) {
                // Bonus-Mail
                $result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
-                       array($url_bid, $url_userid), __FILE__, __LINE__);
+                       array($bonusId, $userId), __FILE__, __LINE__);
                $type = 'bonusid';
-               $urlId = $url_bid;
+               $urlId = $bonusId;
        } else {
                // Problem: No id entered
                redirectToUrl('modules.php?module=index');
@@ -99,7 +99,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                        case 'NORMAL':
                                // Is the stats id valid?
                                $result = SQL_QUERY_ESC("SELECT `pool_id`, `url`, `subject` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
-                                       array($url_mid), __FILE__, __LINE__);
+                                       array($mailId), __FILE__, __LINE__);
                                break;
 
                        case 'BONUS':
@@ -108,7 +108,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
 
                                // Bonus-Mails
                                $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-                                       array($url_bid), __FILE__, __LINE__);
+                                       array($bonusId), __FILE__, __LINE__);
                                break;
 
                        default: // Invalid mail type
@@ -127,13 +127,13 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                        setExtraTitle($title);
 
                        // Is the user's id unlocked?
-                       if (fetchUserData($url_userid)) {
+                       if (fetchUserData($userId)) {
                                // Status must be CONFIRMED
                                if (getUserData('status') == 'CONFIRMED') {
                                        // Update last activity if not admin
                                        if (!isAdmin()) {
                                                // Is not admin, so update last activity
-                                               updateLastActivity($url_userid);
+                                               updateLastActivity($userId);
                                        } // END - if
 
                                        // User has confirmed his account so we can procede...
@@ -155,7 +155,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
 
                                                case 'BONUS':
                                                        $result = SQL_QUERY_ESC("SELECT `points`, `time` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-                                                               array($url_bid), __FILE__, __LINE__);
+                                                               array($bonusId), __FILE__, __LINE__);
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($points, $time) = SQL_FETCHROW($result);
                                                                $payment = '0.00000';
@@ -185,7 +185,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                if (($time > 0) && (($payment > 0) || ($points > 0))) {
                                                        // Export data into constants for the template
                                                        $content = array(
-                                                               'userid'  => $url_userid,
+                                                               'userid'  => $userId,
                                                                'type'    => $type,
                                                                'data'    => $urlId,
                                                                'url'     => $URL
index 5c4b8afecbe7608cd75dcd47e12e6069bcc9146a..5b54056787b89d8d2e59ba6be0cc61ba434f451f 100644 (file)
@@ -60,35 +60,35 @@ redirectOnUninstalledExtension('mailid');
 redirectOnUninstalledExtension('other');
 
 // Init variables
-$url_userid = '0';
-$url_bid = '0';
-$url_mid = '0';
+$userId = '0';
+$bonusId = '0';
+$mailId = '0';
 $code = '0';
 $mode = '';
 
 // Secure all data
-if (isGetRequestParameterSet('userid'))  $url_userid = bigintval(getRequestParameter('userid'));
-if (isGetRequestParameterSet('mailid'))  $url_mid    = bigintval(getRequestParameter('mailid'));
-if (isGetRequestParameterSet('bonusid')) $url_bid    = bigintval(getRequestParameter('bonusid'));
+if (isGetRequestParameterSet('userid'))  $userId = bigintval(getRequestParameter('userid'));
+if (isGetRequestParameterSet('mailid'))  $mailId    = bigintval(getRequestParameter('mailid'));
+if (isGetRequestParameterSet('bonusid')) $bonusId    = bigintval(getRequestParameter('bonusid'));
 if (isGetRequestParameterSet('code'))    $code       = bigintval(getRequestParameter('code'));
 if (isGetRequestParameterSet('mode'))    $mode       = getRequestParameter('mode');
 
 // 01           1        12            2    2            21    1                   22     10
-if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
        // No image? Then output header
        if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
        // Maybe he wants to confirm an email?
-       if ($url_mid > 0) {
+       if ($mailId > 0) {
                $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
-                       array($url_mid, $url_userid), __FILE__, __LINE__);
+                       array($mailId, $userId), __FILE__, __LINE__);
                $type = 'mailid';
-               $urlId = $url_mid;
-       } elseif ($url_bid > 0) {
+               $urlId = $mailId;
+       } elseif ($bonusId > 0) {
                $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
-                       array($url_bid, $url_userid), __FILE__, __LINE__);
+                       array($bonusId, $userId), __FILE__, __LINE__);
                $type = 'bonusid';
-               $urlId = $url_bid;
+               $urlId = $bonusId;
        }
 
        if (SQL_NUMROWS($result_main) == 1) {
@@ -102,12 +102,12 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                switch ($ltype) {
                        case 'NORMAL':
                                $result_mailid = SQL_QUERY_ESC("SELECT `pool_id`, `userid`, `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
-                                       array($url_mid), __FILE__, __LINE__);
+                                       array($mailId), __FILE__, __LINE__);
                                break;
 
                        case 'BONUS':
                                $result_mailid = SQL_QUERY_ESC("SELECT `id`, `id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-                                       array($url_bid), __FILE__, __LINE__);
+                                       array($bonusId), __FILE__, __LINE__);
                                break;
 
                        default: // Unknown type
@@ -127,7 +127,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                        if ($ltype == 'BONUS') $sender = '0';
 
                        // Is the user id valid?
-                       if (fetchUserData($url_userid) === true) {
+                       if (fetchUserData($userId) === true) {
                                // Is the user status CONFIRMED?
                                if (getUserData('status') == 'CONFIRMED') {
                                        // User has confirmed his account so we can procede...
@@ -175,7 +175,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                        $img_code = '0';
                                                        if (!empty($code)) {
                                                                // Generate code
-                                                               $img_code = generateRandomCode(getConfig('code_length'), $code, $url_userid, $urlId);
+                                                               $img_code = generateRandomCode(getConfig('code_length'), $code, $userId, $urlId);
                                                        } // END - if
 
                                                        // @TODO Rewrite this to a filter
@@ -189,26 +189,26 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                        switch ($ltype) {
                                                                                case 'NORMAL':
                                                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
-                                                                                               array($url_mid), __FILE__, __LINE__);
+                                                                                               array($mailId), __FILE__, __LINE__);
 
                                                                                        // Update mediadata as well
                                                                                        if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                                                // Update database
                                                                                                updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'add', 1);
                                                                                        } // END - if
-                                                                                       $stats_data = $url_mid;
+                                                                                       $stats_data = $mailId;
                                                                                        break;
 
                                                                                case 'BONUS':
                                                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
-                                                                                               array($url_bid), __FILE__, __LINE__);
+                                                                                               array($bonusId), __FILE__, __LINE__);
 
                                                                                        // Update mediadata as well
                                                                                        if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                                                // Update database
                                                                                                updateMediadataEntry(array('total_clicks', 'bonus_clicks'), 'add', 1);
                                                                                        } // END - if
-                                                                                       $stats_data = $url_bid;
+                                                                                       $stats_data = $bonusId;
                                                                                        break;
 
                                                                                default: // Unknown type
@@ -224,18 +224,18 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                        if (isExtensionInstalledAndNewer('user', '0.1.2')) {
                                                                                // Update counter
                                                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE `userid`=%s LIMIT 1",
-                                                                                       array($url_userid), __FILE__, __LINE__);
+                                                                                       array($userId), __FILE__, __LINE__);
 
                                                                                // Update random confirmed as well?
                                                                                if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                                                                                        // Update second counter
                                                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=`rand_confirmed` + 1 WHERE `userid`=%s LIMIT 1",
-                                                                                               array($url_userid), __FILE__, __LINE__);
+                                                                                               array($userId), __FILE__, __LINE__);
                                                                                } // END - if
                                                                        } // END - if
 
                                                                        // Insert stats record
-                                                                       insertUserStatsRecord($url_userid, $type, $stats_data);
+                                                                       insertUserStatsRecord($userId, $type, $stats_data);
 
                                                                        // Right code entered?
                                                                        if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
@@ -250,26 +250,26 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
 
                                                                                // Count down ref_payout value
                                                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=`ref_payout`-1 WHERE `userid`=%s AND `ref_payout` > 0 LIMIT 1",
-                                                                                       array($url_userid), __FILE__, __LINE__);
+                                                                                       array($userId), __FILE__, __LINE__);
 
                                                                                // Add points
                                                                                // @TODO Try to rewrite the following unset()
                                                                                unset($GLOBALS['ref_level']);
-                                                                               addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment);
+                                                                               addPointsThroughReferalSystem('mailid_okay', $userId, $payment);
 
                                                                                // Shall I add bonus points for "turbo clickers" ?
                                                                                if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
                                                                                        // Is an active-rallye running and this is not a notification mail?
                                                                                        if ((isBonusRallyeActive()) && ($notify != 'Y')) {
                                                                                                // Shall I exclude the webmaster's own userid from the active-rallye?
-                                                                                               if ((((getBonusUserId() == $url_userid) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $url_userid)) && (getConfig('def_refid') != $url_userid)) {
+                                                                                               if ((((getBonusUserId() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $userId)) && (getConfig('def_refid') != $userId)) {
                                                                                                        // Add points and remember ranking are done in this function....
-                                                                                                       addTurboBonus($urlId, $url_userid, $type);
+                                                                                                       addTurboBonus($urlId, $userId, $type);
 
                                                                                                        // Set template to mailid_points_done2 which contains a link to the ranking list
                                                                                                        $template = 'mailid_points_done2';
                                                                                                        if ($locked) $template = 'mailid_points_locked2';
-                                                                                                       $content['userid']  = $url_userid;
+                                                                                                       $content['userid']  = $userId;
                                                                                                        $content['type']    = $type;
                                                                                                        $content['data']    = $urlId;
                                                                                                } // END - if
@@ -277,7 +277,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                                } // END - if
 
                                                                                // Load total points
-                                                                               $content['total'] = getTotalPoints($url_userid);
+                                                                               $content['total'] = getTotalPoints($userId);
 
                                                                                // Load template
                                                                                loadTemplate($template, false, $content);
@@ -302,13 +302,13 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                        if ($code > 0) {
                                                                                // Export data into constants for the template
                                                                                $content['code']   = $code;
-                                                                               $content['userid'] = $url_userid;
+                                                                               $content['userid'] = $userId;
                                                                                $content['type']   = $type;
                                                                                $content['data']   = $urlId;
                                                                                $content['banner'] = loadTemplate('mailid_banner', true);
                                                                                if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
-                                                                                       $content['image'] = generateCaptchaCode($code, $type, $urlId, $url_userid);
+                                                                                       $content['image'] = generateCaptchaCode($code, $type, $urlId, $userId);
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
@@ -329,7 +329,7 @@ if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFa
                                                                        // Export data into constants for the template
                                                                        $content['time']   = $time;
                                                                        $content['tim2']   = strlen($time);
-                                                                       $content['userid'] = $url_userid;
+                                                                       $content['userid'] = $userId;
                                                                        $content['type']   = $type;
                                                                        $content['data']   = $urlId;
                                                                        $content['rand']   = mt_rand(0, 99999);