From: Roland Häder Date: Wed, 4 Nov 2009 08:30:49 +0000 (+0000) Subject: Naming inconsistencies for userid fixed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=916bba4f00ee924f0d88b8fc273dee5bfb798aed;p=mailer.git Naming inconsistencies for userid fixed --- diff --git a/inc/filters.php b/inc/filters.php index 431b5ac367..4426a95aa6 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -283,10 +283,10 @@ function FILTER_UPDATE_LOGIN_DATA () { if (!isMember()) return false; // Secure user id - setUserId(getSession('userid')); + setMemberId(getSession('userid')); // Found a userid? - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Load last module and online time $content = getUserDataArray(); @@ -311,11 +311,11 @@ function FILTER_UPDATE_LOGIN_DATA () { array( getWhat(), detectRemoteAddr(), - getUserId() + getMemberId() ), __FUNCTION__, __LINE__); } else { // Destroy session, we cannot update! - destroyUserSession(); + destroyMemberSession(); } } @@ -366,7 +366,7 @@ function FILTER_DETERMINE_USERNAME () { // Check if logged in if (isMember()) { // Is still logged in so we welcome him with his name - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Load surname and family's name and build the username $content = getUserDataArray(); @@ -383,10 +383,7 @@ function FILTER_DETERMINE_USERNAME () { setUsername('{--USERNAME_UNKNOWN--}'); // Destroy session - destroyUserSession(); - - // Kill userid - setUserId(0); + destroyMemberSession(); } } elseif (isAdmin()) { // Admin is there @@ -720,7 +717,7 @@ function FILTER_INIT_RANDOM_NUMBER () { // Is the extension sql_patches installed and at least 0.3.6? if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && (isExtensionInstalledAndNewer('other', '0.2.5'))) { // Generate random number - setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getUserId(), '')); + setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getMemberId(), '')); } else { // Generate weak (!!!) code setConfigEntry('RAND_NUMBER', mt_rand(1000000, 9999999)); diff --git a/inc/functions.php b/inc/functions.php index 7908206a7c..6848f87e4f 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1286,7 +1286,7 @@ function generateRandomCode ($length, $code, $userid, $DATA = '') { $data .= getConfig('ENCRYPT_SEPERATOR') . determineReferalId(); $data .= getConfig('ENCRYPT_SEPERATOR') . getLanguage(); $data .= getConfig('ENCRYPT_SEPERATOR') . getCurrentTheme(); - $data .= getConfig('ENCRYPT_SEPERATOR') . getUserId(); + $data .= getConfig('ENCRYPT_SEPERATOR') . getMemberId(); // Calculate number for generating the code $a = $code + getConfig('_ADD') - 1; @@ -3252,33 +3252,38 @@ function shutdown () { exit; } -// Setter for userid -function setUserId ($userid) { - // We should not set userid to zero - if ($userid == 0) debug_report_bug('Userid should not be set zero.'); +// Init member id +function initMemberId () { + $GLOBALS['member_id'] = 0; +} + +// Setter for member id +function setMemberId ($memberid) { + // We should not set member id to zero + if ($memberid == 0) debug_report_bug('Userid should not be set zero.'); // Set it secured - $GLOBALS['userid'] = bigintval($userid); + $GLOBALS['member_id'] = bigintval($memberid); } -// Getter for userid or returns zero -function getUserId () { - // Default userid - $userid = 0; +// Getter for member id or returns zero +function getMemberId () { + // Default member id + $memberid = 0; - // Is the userid set? - if (isUserIdSet()) { + // Is the member id set? + if (isMemberIdSet()) { // Then use it - $userid = $GLOBALS['userid']; + $memberid = $GLOBALS['member_id']; } // END - if // Return it - return $userid; + return $memberid; } -// Checks ether the userid is set -function isUserIdSet () { - return (isset($GLOBALS['userid'])); +// Checks ether the member id is set +function isMemberIdSet () { + return (isset($GLOBALS['member_id'])); } // Handle message codes from URL diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 95643bc0cd..125f4a38a7 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -58,9 +58,9 @@ function FILTER_UPDATE_ONLINE_LIST () { $ADMIN = 'N'; // Valid userid? - if ((isUserIdSet()) && (getUserId() > 0) && (isMember())) { + if ((isMemberIdSet()) && (getMemberId() > 0) && (isMember())) { // Is valid user - $userid = getUserId(); + $userid = getMemberId(); $MEM = 'Y'; } // END - if diff --git a/inc/libs/primera_functions.php b/inc/libs/primera_functions.php index 54c5929a05..1082695af8 100644 --- a/inc/libs/primera_functions.php +++ b/inc/libs/primera_functions.php @@ -269,7 +269,7 @@ function executePrimeraPayout ($primusNick, $userMd5, $amount) { $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5')); // Prepare purpose - eval("\$purpose = \"".compileRawCode(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), getUserId()))."\";"); + eval("\$purpose = \"".compileRawCode(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), getMemberId()))."\";"); // Pay the Primera return $api->payPrimera($primusNick, $amount, $purpose); diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 8dbae40a98..1c49938753 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -329,7 +329,7 @@ function getArrayFromUserRefbackData ($id) { // Get entry from database $result = SQL_QUERY_ESC("SELECT `id`, `refid`, `refback`, `level` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `id`=%s AND `userid`=%s LIMIT 1", - array($id, getUserId()), __FUNCTION__, __LINE__); + array($id, getMemberId()), __FUNCTION__, __LINE__); // Is there an entry? if (SQL_NUMROWS($result) == 1) { @@ -381,7 +381,7 @@ function updateMemberRefbackPercents ($id, $percents) { // Update entry SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_refs` SET `refback`='%s' WHERE `id`=%s AND `userid`=%s LIMIT 1", - array($percents, $id, getUserId()), __FUNCTION__, __LINE__); + array($percents, $id, getMemberId()), __FUNCTION__, __LINE__); // Entry updated? if (SQL_AFFECTEDROWS() < 1) { @@ -398,13 +398,13 @@ function updateMemberRefbackPercents ($id, $percents) { ); // Load member email template - $mail = loadEmailTemplate('member_refback', $content, getUserId()); + $mail = loadEmailTemplate('member_refback', $content, getMemberId()); // Send email to user sendEmail($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail); // Send admin notification - sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), 'admin_refback', $content, getUserId()); + sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), 'admin_refback', $content, getMemberId()); // All fine! $status['ok'] = true; diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 1fc4d35ca5..dd17a102a7 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -167,10 +167,10 @@ function SURFBAR_MEMBER_ADD_URL ($url, $limit) { } elseif ((!isUrlValid($url)) && (!isAdmin())) { // URL invalid return false; - } elseif (SURFBAR_LOOKUP_BY_URL($url, getUserId())) { + } elseif (SURFBAR_LOOKUP_BY_URL($url, getMemberId())) { // URL already found in surfbar! return false; - } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS(getUserId())) { + } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS(getMemberId())) { // No more allowed! return false; } elseif (''.($limit + 0).'' != ''.$limit.'') { @@ -179,7 +179,7 @@ function SURFBAR_MEMBER_ADD_URL ($url, $limit) { } // Register the new URL - return SURFBAR_REGISTER_URL($url, getUserId(), 'PENDING', 'reg', array('limit' => $limit)); + return SURFBAR_REGISTER_URL($url, getMemberId(), 'PENDING', 'reg', array('limit' => $limit)); } // Create list of actions depending on status for the user @@ -843,7 +843,7 @@ ON WHERE l.userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND (((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR u.fixed_reload = 0) LIMIT 1", - array(getUserId()), __FUNCTION__, __LINE__ + array(getMemberId()), __FUNCTION__, __LINE__ ); // Fetch row @@ -914,7 +914,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($userid = 0, $status = '',$exclude = '') { // Is the user 0 and user is logged in? if (($userid == 0) && (isMember())) { // Then use this userid - $userid = getUserId(); + $userid = getMemberId(); } elseif ($userid == 0) { // Error! return (getConfig('surfbar_max_order') + 1); @@ -971,7 +971,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt = '') { } // ... and now the validation code - $valCode = generateRandomCode($length, sha1(SURFBAR_GET_SALT().':'.$urlId), getUserId()); + $valCode = generateRandomCode($length, sha1(SURFBAR_GET_SALT().':'.$urlId), getMemberId()); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valCode='.valCode.'', false); } // END - while @@ -1006,11 +1006,11 @@ function SURFBAR_LOCKDOWN_ID ($urlId) { ///* DEBUG: */ return; // Just add it to the database SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_locks` (`userid`, `url_id`) VALUES (%s, %s)", - array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__); + array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__); // Remove the salt from database SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_surfbar_salts` WHERE `url_id`=%s AND `userid`=%s LIMIT 1", - array(bigintval($urlId), getUserId()), __FUNCTION__, __LINE__); + array(bigintval($urlId), getMemberId()), __FUNCTION__, __LINE__); } // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf" @@ -1022,8 +1022,8 @@ function SURFBAR_PAY_POINTS () { } // END - if // Book it to the user - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getUserId().',reward='.SURFBAR_GET_REWARD().'', false); - addPointsThroughReferalSystem(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), getUserId(), SURFBAR_GET_DATA('reward')); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getMemberId().',reward='.SURFBAR_GET_REWARD().'', false); + addPointsThroughReferalSystem(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), getMemberId(), SURFBAR_GET_DATA('reward')); } // Updates the statistics of current URL/userid @@ -1046,13 +1046,13 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () { // Update the stats entry SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_stats` SET `count`=`count`+1 WHERE `userid`=%s AND `url_id`=%s LIMIT 1", - array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__); + array(getMemberId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__); // Was that update okay? if (SQL_AFFECTEDROWS() < 1) { // No, then insert entry SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)", - array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__); + array(getMemberId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__); } // END - if // Update total/daily/weekly/monthly counter @@ -1072,16 +1072,16 @@ function SURFBAR_UPDATE_SALT_STATS () { // Simply store the salt from cache away in database... SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_salts` SET `last_salt`='%s' WHERE `url_id`=%s AND `userid`=%s LIMIT 1", - array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getUserId()), __FUNCTION__, __LINE__); + array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getMemberId()), __FUNCTION__, __LINE__); // Debug message - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'salt='.SURFBAR_GET_SALT().',id='.SURFBAR_GET_ID().',userid='.getUserId().'', false); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'salt='.SURFBAR_GET_SALT().',id='.SURFBAR_GET_ID().',userid='.getMemberId().'', false); // Was that okay? if (SQL_AFFECTEDROWS() < 1) { // Insert missing entry! SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_salts` (`url_id`, `userid`, `last_salt`) VALUES (%s, %s, '%s')", - array(SURFBAR_GET_ID(), getUserId(), SURFBAR_GET_SALT()), __FUNCTION__, __LINE__); + array(SURFBAR_GET_ID(), getMemberId(), SURFBAR_GET_SALT()), __FUNCTION__, __LINE__); } // END - if // Debug message @@ -1103,7 +1103,7 @@ WHERE ORDER BY `last_surfed` ASC LIMIT 1", - array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__ + array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__ ); // Fetch counter @@ -1129,9 +1129,9 @@ function SURFBAR_DETERMINE_DEPLETED_USERIDS ($limit=0) { // Do we have a current user id? if ((isMember()) && ($limit == 0)) { // Then add this as well - $UIDs['userid'][getUserId()] = getUserId(); - $UIDs['points'][getUserId()] = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); - $UIDs['notified'][getUserId()] = 0; + $UIDs['userid'][getMemberId()] = getMemberId(); + $UIDs['points'][getMemberId()] = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); + $UIDs['notified'][getMemberId()] = 0; // Get all userid except logged in one $result = SQL_QUERY_ESC("SELECT @@ -1148,7 +1148,7 @@ GROUP BY u.userid ORDER BY u.userid ASC", - array(getUserId()), __FUNCTION__, __LINE__); + array(getMemberId()), __FUNCTION__, __LINE__); } else { // Get all userid $result = SQL_QUERY("SELECT @@ -1187,7 +1187,7 @@ ORDER BY SQL_FREERESULT($result); // Debug message - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getUserId().')', false); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getMemberId().')', false); // Return result return $UIDs; @@ -1389,7 +1389,7 @@ FROM WHERE `userid`=%s ORDER BY - `id` ASC", array(getUserId()), + `id` ASC", array(getMemberId()), __FUNCTION__, __LINE__); // Load all entries @@ -1464,7 +1464,7 @@ function SURFBAR_GET_USER_URLS () { FROM `{?_MYSQL_PREFIX?}_surfbar_urls` AS u WHERE u.userid=%s AND u.status != 'DELETED' ORDER BY u.id ASC", - array(getUserId()), __FUNCTION__, __LINE__); + array(getMemberId()), __FUNCTION__, __LINE__); // Are there entries? if (SQL_NUMROWS($result) > 0) { @@ -1581,7 +1581,7 @@ LEFT JOIN `{?_MYSQL_PREFIX?}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid != %s AND sbu.`status`='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) LIMIT 1", - array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__ + array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__ ); } diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 1fdb510500..9ab8d984f3 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -334,7 +334,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p // Update global array // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); - setUserId($userid); + setMemberId($userid); // Try to set session data (which shall normally always work!) if ((setSession('userid', $userid )) && (setSession('u_hash', $content['hash']))) { diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index be5acd5de2..468a0db29c 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -238,7 +238,7 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { $result = false; // Prepare the purpose - eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_WITHDRAW'), getUserId()))."\";"); + eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_WITHDRAW'), getMemberId()))."\";"); // Prepare the request data $requestData = array( @@ -278,7 +278,7 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) { $result = false; // Prepare the purpose - eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_PAYOUT'), getUserId()))."\";"); + eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_PAYOUT'), getMemberId()))."\";"); // Prepare the request data $requestData = array( @@ -337,7 +337,7 @@ function WERNIS_TRANSFER_STATUS ($status) { function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') { // Register this wernis movement SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_wernis` (`userid`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type`,`wernis_api_message`,`wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", - array(getUserId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__); + array(getMemberId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__); } // Take fees and factor @@ -346,7 +346,7 @@ function WERNIS_TAKE_FEE ($points, $mode) { //* DEBUG: */ outputHtml("mode={$mode},points={$points}
"); if (!in_array($mode, array('payout', 'withdraw'))) { // Log error and abort - logDebugMessage(__FUNCTION__, __LINE__, "userid={getUserId()},mode={$mode},points={$points}"); + logDebugMessage(__FUNCTION__, __LINE__, "userid={getMemberId()},mode={$mode},points={$points}"); return false; } // END - if diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 3014e87d8d..e87de7dbf4 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -44,13 +44,13 @@ if (!defined('__SECURITY')) { // Initial message part $message = "{--VALIDATING_LOGIN--}"; -if (isUserIdSet() && (isSessionVariableSet('u_hash'))) { +if (isMemberIdSet() && (isSessionVariableSet('u_hash'))) { // Is 'theme' installed and activated? if (isExtensionActive('theme')) { // Get theme from profile - if (!fetchUserData(getUserId())) { + if (!fetchUserData(getMemberId())) { // Userid is not valid - debug_report_bug('User id '.getUserId() . ' is invalid.'); + debug_report_bug('User id '.getMemberId() . ' is invalid.'); } // END - if // Load data @@ -70,7 +70,7 @@ SET WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Store it in session setSession('mxchange_member_failures', $data['login_failures']); @@ -91,7 +91,7 @@ WHERE `last_login` < (UNIX_TIMESTAMP() - %s) LIMIT 1", array( - getUserId(), + getMemberId(), getConfig('login_timeout') ), __FILE__, __LINE__ ); diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index 6bf21086fc..aed13dad84 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -48,7 +48,7 @@ if (isGetRequestElementSet('order')) { if (isMember()) { // Ok, test passed... :) $result = SQL_QUERY_ESC("SELECT `subject`, `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1", - array(bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__); + array(bigintval(getRequestElement('order')), getMemberId()), __FILE__, __LINE__); // Finally is the entry valid? if (SQL_NUMROWS($result) == 1) { diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index b8bc4b148b..d711852a58 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -58,9 +58,9 @@ $URL = ''; $add = ''; // Already logged in? -if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) { +if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { // Maybe, then continue with it - $userid = getUserId(); + $userid = getMemberId(); } elseif ((isPostRequestElementSet('id')) && (isPostRequestElementSet('password')) && (isFormSent())) { // Set userid and crypt password when login data was submitted if ((isExtensionActive('nickname')) && (isNicknameOrUserid(postRequestElement('id')))) { diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 26417389b9..66bbac8df3 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -117,7 +117,7 @@ if (SQL_NUMROWS($result) == 1) { $content['can_win_this'] = getMessage('RALLYE_OUR_WINNERS_ARE'); } else { $content['prices'] = addReferalRallyePrices($id, 'html'); - $content['top_users'] = addReferalRallyeTopUsers($id, getUserId()); + $content['top_users'] = addReferalRallyeTopUsers($id, getMemberId()); $content['can_win_this'] = getMessage('RALLYE_YOU_CAN_WIN'); } diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index 7790719a61..bb0fe4ad0c 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -52,7 +52,7 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) { } // END - if // Get userid -$userid = getUserId(); +$userid = getMemberId(); if (isExtensionActive('nickname')) { // Load nickname @@ -78,7 +78,7 @@ SQL_FREERESULT($result); // Set user id when no nickname was found $nickname = true; -if (empty($userid)) { $userid = getUserId(); $nickname = false; } +if (empty($userid)) { $userid = getMemberId(); $nickname = false; } // Prepare constants $content['userid'] = $userid; diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index c6674511b9..66f6981b8c 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { // Add description as navigation point addMenuDescription('member', __FILE__); -$UID = getUserId(); +$UID = getMemberId(); $whereStatement = " WHERE `visible`='Y'"; if (isAdmin()) $whereStatement = ''; diff --git a/inc/modules/member/what-doubler.php b/inc/modules/member/what-doubler.php index 8ed0af5276..364261fd4f 100644 --- a/inc/modules/member/what-doubler.php +++ b/inc/modules/member/what-doubler.php @@ -59,12 +59,12 @@ $content['min'] = translateComma(getConfig('doubler_min')); $content['max'] = translateComma(getConfig('doubler_max')); // Default refid is the userid -$content['userid'] = getUserId(); +$content['userid'] = getMemberId(); // Transfer referal id if (isExtensionActive('nickname')) { // Load nickname from DB - $nick = getNickname(getUserId()); + $nick = getNickname(getMemberId()); if (!empty($nick)) { // Set nickname @@ -76,13 +76,13 @@ if (isExtensionActive('nickname')) { $content['payout_time'] = getMessage('DOUBLER_PAYOUT_TIME_' . getConfig('doubler_send_mode')); // Generate table with already payed out doubles -$content['payout_history'] = generateDoublerTable(getUserId(), 'Y', 'N', 'DESC'); +$content['payout_history'] = generateDoublerTable(getMemberId(), 'Y', 'N', 'DESC'); // Generate table with next-to-run payouts -$content['next_table'] = generateDoublerTable(getUserId()); +$content['next_table'] = generateDoublerTable(getMemberId()); // Generate table with refferal payouts -$content['payout_ref'] = generateDoublerTable(getUserId(), 'N', 'Y', 'DESC'); +$content['payout_ref'] = generateDoublerTable(getMemberId(), 'N', 'Y', 'DESC'); // Generate timemark $content['timeout_mark'] = createFancyTime(getConfig('doubler_timeout')); diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index c7fdc9d51b..e9ec739204 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -63,7 +63,7 @@ WHERE `sender`=%s ORDER BY `timestamp` DESC -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); // Check for sent mail orders in stats $result2 = SQL_QUERY_ESC("SELECT @@ -74,7 +74,7 @@ WHERE `userid`=%s ORDER BY `timestamp_ordered` DESC -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) { // Mail order found! @@ -121,7 +121,7 @@ if (isFormSent()) { } else { // Everything went okay so let's store his request and send mails SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')", - array(getUserId(), $START, $content['holiday_end'], postRequestElement('comments')), __FILE__, __LINE__); + array(getMemberId(), $START, $content['holiday_end'], postRequestElement('comments')), __FILE__, __LINE__); // Activate holiday system SQL_QUERY_ESC("UPDATE @@ -131,7 +131,7 @@ SET WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Prepare constants $content['start_day'] = bigintval(postRequestElement('start_day')); @@ -143,14 +143,14 @@ LIMIT 1", $content['comments'] = secureString(postRequestElement('comments')); // Send mail to member - $message = loadEmailTemplate('member_holiday_request', $content, getUserId()); - sendEmail(getUserId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $message); + $message = loadEmailTemplate('member_holiday_request', $content, getMemberId()); + sendEmail(getMemberId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $message); // Send mail to all admins - sendAdminNotification(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', $content, getUserId()); + sendAdminNotification(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', $content, getMemberId()); // Create task - createNewTask('{--HOLIDAY_ADMIN_SUBJECT--}', $message, 'HOLIDAY_REQUEST', getUserId()); + createNewTask('{--HOLIDAY_ADMIN_SUBJECT--}', $message, 'HOLIDAY_REQUEST', getMemberId()); // Display message loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_IS_ACTIVATED_NOW')); @@ -166,7 +166,7 @@ FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); $content = merge_array($content, SQL_FETCHARRAY($result)); SQL_FREERESULT($result); @@ -178,7 +178,7 @@ FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Data was found $content = merge_array($content, SQL_FETCHARRAY($result)); @@ -196,7 +196,7 @@ SET WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Remove entry SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM @@ -204,10 +204,10 @@ LIMIT 1", WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Send email to admin - sendAdminNotification(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', $content, getUserId()); + sendAdminNotification(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', $content, getMemberId()); // Display message to user loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_MEMBER_DEACTIVATED_NOW')); @@ -230,7 +230,7 @@ FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); $content = SQL_FETCHARRAY($result); SQL_FREERESULT($result); @@ -247,7 +247,7 @@ FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Data was found $content = merge_array($content, SQL_FETCHARRAY($result)); @@ -271,7 +271,7 @@ SET `holiday_active`='N' WHERE `userid`=%s -LIMIT 1", array(getUserId()), __FILE__, __LINE__); +LIMIT 1", array(getMemberId()), __FILE__, __LINE__); redirectToUrl('modules.php?module=login&what=holiday'); return; } diff --git a/inc/modules/member/what-html_mail.php b/inc/modules/member/what-html_mail.php index 278e8b865b..a558191a21 100644 --- a/inc/modules/member/what-html_mail.php +++ b/inc/modules/member/what-html_mail.php @@ -55,13 +55,13 @@ if ((!isExtensionActive('html_mail')) && (!isAdmin())) { if (isFormSent()) { // Save settings SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `html`='%s' WHERE `userid`=%s LIMIT 1", - array(postRequestElement('html'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('html'), getMemberId()), __FILE__, __LINE__); loadTemplate('admin_settings_saved', false, getMessage('MEMBER_SETTINGS_SAVED')); } else { // Load template for changing settings - if (!fetchUserData(getUserId())) { + if (!fetchUserData(getMemberId())) { // Something really bad happened - debug_report_bug('No user account ' . getUserId() . ' found.'); + debug_report_bug('No user account ' . getMemberId() . ' found.'); } // END - if // Prepare it diff --git a/inc/modules/member/what-logout.php b/inc/modules/member/what-logout.php index 5f3c4ce563..4108e31a46 100644 --- a/inc/modules/member/what-logout.php +++ b/inc/modules/member/what-logout.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { // Base URL for redirection (both cases) $URL = 'modules.php?module=index&code='; -if (destroyUserSession()) { +if (destroyMemberSession()) { // Remove theme cookie as well setTheme(''); diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index ba473bdc91..3ae5495f1f 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -53,7 +53,7 @@ if ((!isExtensionActive('mydata')) && (!isAdmin())) { // Add userid $content = array( - 'userid' => getUserId() + 'userid' => getMemberId() ); // Init variable to prevent notices @@ -68,9 +68,9 @@ if (isPostRequestElementSet('notify')) $mode = 'notify'; // Switch off notificat switch ($mode) { case 'show': // Show his data // Get user data - if (!fetchUserData(getUserId())) { + if (!fetchUserData(getMemberId())) { // Something really bad happended - debug_report_bug('No user account ' . getUserId() . ' found.'); + debug_report_bug('No user account ' . getMemberId() . ' found.'); } // END - if // Get line @@ -115,7 +115,7 @@ FROM WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } else { // Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13 $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `street_nr`, `country`, `zip`, `city`, `email`, `birth_day`, `birth_month`, `birth_year`, `gender`, `max_mails`, `receive_mails`, `last_update` @@ -124,7 +124,7 @@ FROM WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } // Get line @@ -196,9 +196,9 @@ LIMIT 1", case 'save': // Save entered data // Load old email / password - if (!fetchUserData(getUserId())) { + if (!fetchUserData(getMemberId())) { // Something really bad happened - debug_report_bug('No user account ' . getUserId() . ' found.'); + debug_report_bug('No user account ' . getMemberId() . ' found.'); } // END - if // Get line @@ -267,7 +267,7 @@ LIMIT 1", bigintval(postRequestElement('month')), bigintval(postRequestElement('year')), bigintval(postRequestElement('max_mails')), - getUserId() + getMemberId() ), __FILE__, __LINE__); } else { // Old way @@ -299,7 +299,7 @@ LIMIT 1", bigintval(postRequestElement('month')), bigintval(postRequestElement('year')), bigintval(postRequestElement('max_mails')), - getUserId() + getMemberId() ), __FILE__, __LINE__); } @@ -323,7 +323,7 @@ LIMIT 1", case 'notify': // Switch off notfication SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `notified`='N', `last_update`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); $URL = 'modules.php?module=login&what=welcome&code=' . urlencode(getMessage('PROFILE_UPDATED')); break; } // END - switch diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index dcdf230e12..9589728a3a 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -68,11 +68,11 @@ if (isFormSent()) { if ($isValid === true) { // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !) $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' AND `userid` != '%s' LIMIT 1", - array(postRequestElement('nickname'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('nickname'), getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Nickname not in use, so set it now SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1", - array(postRequestElement('nickname'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('nickname'), getMemberId()), __FILE__, __LINE__); $content = getMessage('NICKNAME_SAVED'); } else { // Free result @@ -91,7 +91,7 @@ if ($isValid === true) { } // END - if // Load Template - loadTemplate('member_nickname_form', false, getNickname(getUserId())); + loadTemplate('member_nickname_form', false, getNickname(getMemberId())); } // [EOF] diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 820d092bd0..a9b269896d 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -58,7 +58,7 @@ $whereStatement = " WHERE `visible`='Y'"; if (isAdmin()) $whereStatement = ''; // Count unconfirmed mails -$links = countSumTotalData(getUserId(), 'user_links', 'id', 'userid', true); +$links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true); // Do we have ext-holiday installed? $HOLIDAY = 'serid'; @@ -70,7 +70,7 @@ if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3' $result_mmails = SQL_QUERY_ESC("SELECT `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s AND `max_mails` > 0 LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); $mmails = SQL_NUMROWS($result_mmails); list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails); @@ -85,7 +85,7 @@ $ALLOWED = $MAXI - $ORDERS; if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI; // Now check his points amount -$total = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');; +$total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');; if (($HOLIDAY == 'Y') && (getExtensionVersion('holiday') >= '0.1.3')) { // Holiday is active! @@ -103,7 +103,7 @@ WHERE `timestamp` > (UNIX_TIMESTAMP() - %s) LIMIT 1", array( - getUserId(), + getMemberId(), postRequestElement('url'), getConfig('url_tlock') ), __FILE__, __LINE__); @@ -221,7 +221,7 @@ ORDER BY d.%s %s", array( bigintval(postRequestElement('cat')), - getUserId(), + getMemberId(), getConfig('order_select'), getConfig('order_mode'), ), __FILE__, __LINE__); @@ -294,7 +294,7 @@ LIMIT 1", SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`, `html_msg`) VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')", array( - getUserId(), + getMemberId(), postRequestElement('subject'), postRequestElement('text'), $RECEIVER, @@ -310,7 +310,7 @@ LIMIT 1", SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`) VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s')", array( - getUserId(), + getMemberId(), postRequestElement('subject'), postRequestElement('text'), $RECEIVER, @@ -389,7 +389,7 @@ LIMIT 1", // Order is placed as temporary. We need to get it's id for the frametester $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s AND `subject`='%s' AND `payment_id`=%s AND `data_type`='TEMP' AND `timestamp`=UNIX_TIMESTAMP() LIMIT 1", array( - getUserId(), + getMemberId(), postRequestElement('subject'), bigintval(postRequestElement('type')) ), __FILE__, __LINE__); @@ -455,7 +455,7 @@ ORDER BY // Select users in current category $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC", - array(bigintval($categoriesContent['id']), getUserId()), __FILE__, __LINE__); + array(bigintval($categoriesContent['id']), getMemberId()), __FILE__, __LINE__); $userid_cnt = 0; while (list($ucat) = SQL_FETCHROW($result_userids)) { @@ -574,7 +574,7 @@ WHERE `sender`=%s AND `data_type`='TEMP' LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Old order found diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 624d8e1d5c..763187ed6a 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -58,7 +58,7 @@ $totalPoints = 0; while ($content = SQL_FETCHARRAY($result_depths)) { // Load referal points $result_points = SQL_QUERY_ESC("SELECT `points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1", - array(getUserId(), bigintval($content['level'])), __FILE__, __LINE__); + array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__); // Entry found? if (SQL_NUMROWS($result_points) == 1) { @@ -77,7 +77,7 @@ while ($content = SQL_FETCHARRAY($result_depths)) { SQL_FREERESULT($result_depths); // Get used points -$usedPoints = countSumTotalData(getUserId(), 'user_data', 'used_points'); +$usedPoints = countSumTotalData(getMemberId(), 'user_data', 'used_points'); // Translate point into comma $totalPoints = ($totalPoints - $usedPoints); @@ -113,7 +113,7 @@ WHERE p.userid = %s ORDER BY p.payout_timestamp DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result_payouts) > 0) { // List all his requests $OUT = ''; $SW = 2; @@ -197,7 +197,7 @@ ORDER BY setRequestPostElement('type' , $content['type']); // Subtract points from member's account - subtractPoints('payout', getUserId(), $points); + subtractPoints('payout', getMemberId(), $points); // Add entry to his tranfer history if ($content['allow'] == 'Y') { @@ -205,7 +205,7 @@ ORDER BY SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`, `payout_total`, `payout_id`, `payout_timestamp`, `status`, `target_url`, `link_text`, `banner_url`) VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')", array( - getUserId(), + getMemberId(), bigintval(postRequestElement('payout')), bigintval(getRequestElement('payout')), postRequestElement('turl'), @@ -214,18 +214,18 @@ VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')", ), __FILE__, __LINE__); // Load templates - $message_mem = loadEmailTemplate('member_payout_request_banner', postRequestArray(), getUserId()); + $message_mem = loadEmailTemplate('member_payout_request_banner', postRequestArray(), getMemberId()); if (getExtensionVersion('admins') >= '0.4.1') { $adm_tpl = 'admin_payout_request_banner'; } else { - $message_adm = loadEmailTemplate('admin_payout_request_banner', postRequestArray(), getUserId()); + $message_adm = loadEmailTemplate('admin_payout_request_banner', postRequestArray(), getMemberId()); } } else { // e-currency payout requested SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_payouts` (`userid`, `payout_total`, `target_account`, `target_bank`, `payout_id`, `payout_timestamp`, `status`, `password`) VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')", array( - getUserId(), + getMemberId(), bigintval(postRequestElement('payout')), bigintval(postRequestElement('account')), postRequestElement('bank'), @@ -234,8 +234,8 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')", ), __FILE__, __LINE__); // Load templates - $message_mem = loadEmailTemplate('member_payout_request', postRequestArray(), getUserId()); - $message_adm = loadEmailTemplate('admin_payout_request', postRequestArray(), getUserId()); + $message_mem = loadEmailTemplate('member_payout_request', postRequestArray(), getMemberId()); + $message_adm = loadEmailTemplate('admin_payout_request', postRequestArray(), getMemberId()); $admin_tpl = ''; // @TODO Rewrite this to a filter @@ -245,13 +245,13 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')", } // Generate task - createNewTask('[payout:] {--PAYOUT_REQUEST_ADMIN--}', $message_adm, 'PAYOUT_REQUEST', getUserId()); + createNewTask('[payout:] {--PAYOUT_REQUEST_ADMIN--}', $message_adm, 'PAYOUT_REQUEST', getMemberId()); // Send out mails - sendEmail(getUserId(), getMessage('PAYOUT_REQUEST_MEMBER'), $message_mem); + sendEmail(getMemberId(), getMessage('PAYOUT_REQUEST_MEMBER'), $message_mem); // To admin(s) - sendAdminNotification(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, postRequestArray(), getUserId()); + sendAdminNotification(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, postRequestArray(), getMemberId()); // Load template and output it loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_REQUEST_SENT')); diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 4df5afb32f..14023d575e 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -71,7 +71,7 @@ while ($data = SQL_FETCHARRAY($result_depths)) { $REFS = 0; // Load referal points - $result_points = SQL_QUERY_ESC("SELECT `points`, `locked_points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1", array(getUserId(), bigintval($content['level'])), __FILE__, __LINE__); + $result_points = SQL_QUERY_ESC("SELECT `points`, `locked_points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1", array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__); if (SQL_NUMROWS($result_points) == 1) { list($points, $locked) = SQL_FETCHROW($result_points); // Also count locked points @@ -85,7 +85,7 @@ while ($data = SQL_FETCHARRAY($result_depths)) { // Load referal counts $result_refs = SQL_QUERY_ESC("SELECT `counter` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s AND `level`='%s' LIMIT 1", - array(getUserId(), bigintval($content['level'])), __FILE__, __LINE__); + array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__); if (SQL_NUMROWS($result_refs) == 1) { list($REFS) = SQL_FETCHROW($result_refs); $TREF += $REFS; @@ -115,9 +115,9 @@ SQL_FREERESULT($result_depths); $content['rows'] = $OUT; // Fetch user account -if (!fetchUserData(getUserId())) { +if (!fetchUserData(getMemberId())) { // Something really bad happened - debug_report_bug('User account ' . getUserId() . ' not found.'); + debug_report_bug('User account ' . getMemberId() . ' not found.'); } // END - if // Initialize variables diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index b602530b3b..77bcf6455b 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -70,7 +70,7 @@ if (!isGetRequestElementSet('mode')) { $content['refid'] = getConfig(('primera_refid')); // Are there some entries? - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Fetch id $content['primera_nickname'] = getUserData('primera_nickname'); } // END - if @@ -82,7 +82,7 @@ if (!isGetRequestElementSet('mode')) { // And load all rows! $result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{?_MYSQL_PREFIX?}_user_primera` WHERE `userid`=%s ORDER BY `primera_timestamp` DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Load all rows $content['rows'] = ''; $SW = 2; @@ -112,7 +112,7 @@ if (!isGetRequestElementSet('mode')) { if (getRequestElement('mode') == 'pay') { // Get total points and check if the user can request a payout - $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); + $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); // No dots here... $points = explode('.', $points); @@ -136,7 +136,7 @@ if (getRequestElement('mode') == 'pay') { $content['primera_nickname'] = ''; // Do we have a user account? (should be!) - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Fetch id $content['primera_nickname'] = getUserData('primera_nickname'); } // END - if @@ -184,11 +184,11 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) { } // END - if // Remove points from account - subtractPoints('primera_payout', getUserId(), postRequestElement('amount')); + subtractPoints('primera_payout', getMemberId(), postRequestElement('amount')); // Update primera nickname SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `primera_nickname`=%s WHERE `userid`=%s LIMIT 1", - array(postRequestElement('primera_nickname'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__); // All done! loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_PAYOUT_DONE')); diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 7664ad0656..0ba1b7e4c5 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -108,7 +108,7 @@ if (SQL_NUMROWS($result) == 1) { $content['can_win_this'] = getMessage('RALLYE_OUR_WINNERS_ARE'); } else { $content['prices'] = addReferalRallyePrices($content['id'], 'html'); - $content['top_users'] = addReferalRallyeTopUsers($content['id'], getUserId()); + $content['top_users'] = addReferalRallyeTopUsers($content['id'], getMemberId()); $content['can_win_this'] = getMessage('RALLYE_YOU_CAN_WIN'); } diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php index 1c0f3442ba..be8f030158 100644 --- a/inc/modules/member/what-refback.php +++ b/inc/modules/member/what-refback.php @@ -108,7 +108,7 @@ $result = SQL_QUERY_ESC("SELECT r.level, r.percents FROM `{?_MYSQL_PREFIX?}_refdepths` AS r WHERE r.level > 0 ORDER BY r.level ASC", -array(getUserId()), __FILE__, __LINE__); +array(getMemberId()), __FILE__, __LINE__); // Are there some entries? (Shall be!) if (SQL_NUMROWS($result) > 0) { @@ -121,7 +121,7 @@ if (SQL_NUMROWS($result) > 0) { $SW = 2; // Check for users ref in this level - foreach (getArrayFromRefbackUserRefs(getUserId(), $content['level']) as $refRow) { + foreach (getArrayFromRefbackUserRefs(getMemberId(), $content['level']) as $refRow) { // Not-deleted account is default $deleted = false; if (is_null($refRow['status'])) $deleted = true; diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index d4838a47fd..aa806b1237 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -47,19 +47,19 @@ if (!defined('__SECURITY')) { addMenuDescription('member', __FILE__); // Load current referal clicks -if (!fetchUserData(getUserId())) { +if (!fetchUserData(getMemberId())) { // Something really bad happened - debug_report_bug('No user account ' . getUserId() . ' found.'); + debug_report_bug('No user account ' . getMemberId() . ' found.'); } // END - if // Prepare some data $content['ref_clicks'] = getUserData('ref_clicks'); -$content['userid'] = getUserId(); +$content['userid'] = getMemberId(); // @TODO Move this into a filter if (isExtensionActive('nickname')) { // Add nickname link when nickname is entered - $nick = getNickname(getUserId()); + $nick = getNickname(getMemberId()); if (!empty($nick)) { // Display nickname link @@ -104,7 +104,7 @@ if (SQL_NUMROWS($result) > 0) { // Add some more data $row['sw'] = $SW; - $row['userid'] = getUserId(); + $row['userid'] = getMemberId(); // Add row $OUT .= loadTemplate('member_reflinks_row', true, $row); diff --git a/inc/modules/member/what-reflist.php b/inc/modules/member/what-reflist.php index b49e0bd751..ecd52bb059 100644 --- a/inc/modules/member/what-reflist.php +++ b/inc/modules/member/what-reflist.php @@ -52,7 +52,7 @@ $result = SQL_QUERY_ESC("SELECT r.level, r.percents FROM `{?_MYSQL_PREFIX?}_refdepths` AS r WHERE r.level > 0 ORDER BY r.level ASC", -array(getUserId()), __FILE__, __LINE__); +array(getMemberId()), __FILE__, __LINE__); // Are there some entries? (Shall be!) if (SQL_NUMROWS($result) > 0) { @@ -65,7 +65,7 @@ if (SQL_NUMROWS($result) > 0) { $SW = 2; // Check for users ref in this level - foreach (getUserReferalPoints(getUserId(), $content['level']) as $refRow) { + foreach (getUserReferalPoints(getMemberId(), $content['level']) as $refRow) { // Add/"translate" more content $refRow['sw'] = $SW; $refRow['points'] = translateComma($refRow['points']); diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index ef5959e750..65a9a51674 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -58,7 +58,7 @@ WHERE `sender`=%s AND `data_type` != 'SEND' ORDER BY `timestamp` DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Are there mails left in pool? if (SQL_NUMROWS($result) > 0) { @@ -108,7 +108,7 @@ WHERE `userid`=%s ORDER BY `timestamp_ordered` DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Mail orders are in pool so we can display them diff --git a/inc/modules/member/what-support.php b/inc/modules/member/what-support.php index b6c9d742c6..71f468964e 100644 --- a/inc/modules/member/what-support.php +++ b/inc/modules/member/what-support.php @@ -59,9 +59,9 @@ if ((!isFormSent()) || (!isPostRequestElementSet(('qsummary')))) { if (getExtensionVersion('admins') >= '0.4.1') { $a_tpl = 'admin_support-' . postRequestElement('qsummary'); } else { - $message_a = loadEmailTemplate('admin_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId()); + $message_a = loadEmailTemplate('admin_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getMemberId()); } - $message_m = loadEmailTemplate('member_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId()); + $message_m = loadEmailTemplate('member_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getMemberId()); // Select right subject switch (postRequestElement('qsummary')) { @@ -82,13 +82,13 @@ if ((!isFormSent()) || (!isPostRequestElementSet(('qsummary')))) { } // END - switch // Send mail to admin - sendAdminNotification($subj_a, $a_tpl, array('text' => postRequestElement('qdetails')), getUserId()); + sendAdminNotification($subj_a, $a_tpl, array('text' => postRequestElement('qdetails')), getMemberId()); // Send mail to user - sendEmail(getUserId(), $subj_m, $message_m); + sendEmail(getMemberId(), $subj_m, $message_m); // Drop a message in the admin's area - createNewTask($subj_a, postRequestElement('qsummary') . ' : ' . postRequestElement('qdetails'), 'SUPPORT_MEMBER', getUserId()); + createNewTask($subj_a, postRequestElement('qsummary') . ' : ' . postRequestElement('qdetails'), 'SUPPORT_MEMBER', getMemberId()); // Form sent loadTemplate('member_support_contcted'); diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index bc4276c120..1edafa3648 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -54,7 +54,7 @@ if ((!isExtensionActive('theme')) && (!isAdmin())) { if (isPostRequestElementSet('member_theme')) { // Save theme to member's profile SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `curr_theme`='%s' WHERE `userid`=%s LIMIT 1", - array(postRequestElement('member_theme'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('member_theme'), getMemberId()), __FILE__, __LINE__); // Set new theme for guests $newTheme = SQL_ESCAPE(postRequestElement('member_theme')); diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 2bbc1eeee1..777d43cc00 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -52,9 +52,9 @@ if ((!isExtensionActive('transfer')) && (!isAdmin())) { } // END - if // Load data -if (!fetchUserData(getUserId())) { +if (!fetchUserData(getMemberId())) { // Something really bad happened - debug_report_bug('No user account ' . getUserId() . ' found.'); + debug_report_bug('No user account ' . getMemberId() . ' found.'); } // END - if // Check for mode in GET @@ -67,7 +67,7 @@ if ((getUserData('opt_in') != 'Y') && ($mode == 'new')) $mode = ''; switch ($mode) { case 'new': // Start new transfer // Get total points and subtract the balance amount from it = maximum transferable points - $total = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); + $total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); // Remember maximum value for template $content['max_transferable'] = round($total - getConfig('transfer_balance') - 0.5); @@ -76,7 +76,7 @@ switch ($mode) { // Add new transfer if (getConfig('transfer_code') > 0) { // Check for code - $code = generateRandomCode(getConfig('transfer_code'), postRequestElement('code_chk'), getUserId(), $content['max_transferable']); + $code = generateRandomCode(getConfig('transfer_code'), postRequestElement('code_chk'), getMemberId(), $content['max_transferable']); $valid_code = ($code == postRequestElement('code')); } else { // Zero length (= disabled) is always valid! @@ -105,7 +105,7 @@ switch ($mode) { // Re-check receivers and own personal data $result = SQL_QUERY_ESC("SELECT `userid`, `gender`, `surname`, `family`, `email`".$add." FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid` IN ('%s','%s') AND `status`='CONFIRMED' LIMIT 2", array( - getUserId(), + getMemberId(), bigintval(postRequestElement('to_userid')) ), __FILE__, __LINE__); @@ -134,13 +134,13 @@ switch ($mode) { $TEST_NICK_REC = $content['recipient']['nickname']; // Default is userids for subject line - $SENDER = getUserId(); + $SENDER = getMemberId(); $RECIPIENT = bigintval(postRequestElement('to_userid')); // If nickname is installed we can set the nickname // @TODO Rewrite this to a filter if (isExtensionActive('nickname')) { - if (($TEST_NICK_SENDER != getUserId()) && (!empty($TEST_NICK_SENDER))) { + if (($TEST_NICK_SENDER != getMemberId()) && (!empty($TEST_NICK_SENDER))) { $SENDER = $content['sender']['nickname']; } @@ -154,26 +154,26 @@ switch ($mode) { $content['expires'] = createFancyTime(getConfig('transfer_age')); // Generate tranafer id - $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getUserId(), postRequestElement('reason'))); + $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getMemberId(), postRequestElement('reason'))); // Add entries to both tables SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`, `from_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", - array(bigintval(postRequestElement('to_userid')), getUserId(), bigintval(postRequestElement('points')), postRequestElement('reason'), $content['trans_id']), __FILE__, __LINE__); + array(bigintval(postRequestElement('to_userid')), getMemberId(), bigintval(postRequestElement('points')), postRequestElement('reason'), $content['trans_id']), __FILE__, __LINE__); SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`, `to_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", - array(getUserId(), bigintval(postRequestElement('to_userid')), bigintval(postRequestElement('points')), postRequestElement('reason'), $content['trans_id']), __FILE__, __LINE__); + array(getMemberId(), bigintval(postRequestElement('to_userid')), bigintval(postRequestElement('points')), postRequestElement('reason'), $content['trans_id']), __FILE__, __LINE__); // Add points to account *directly* ... addPointsDirectly('member_transfer', bigintval(postRequestElement('to_userid')), bigintval(postRequestElement('points'))); // ... and add it to current user's used points - subtractPoints('transfer', getUserId(), postRequestElement('points')); + subtractPoints('transfer', getMemberId(), postRequestElement('points')); // First send email to recipient $message = loadEmailTemplate('member_transfer_recipient', $content, postRequestElement('to_userid')); sendEmail($content['recipient']['email'], getMessage('TRANSFER_MEMBER_RECIPIENT_SUBJ') . ': ' . $SENDER, $message); // Second send email to sender - $message = loadEmailTemplate('member_transfer_sender', $content, getUserId()); + $message = loadEmailTemplate('member_transfer_sender', $content, getMemberId()); sendEmail($content['sender']['email'], getMessage('TRANSFER_MEMBER_SENDER_SUBJ') . ': ' . $RECIPIENT, $message); // At last send admin mail(s) @@ -217,11 +217,11 @@ switch ($mode) { if (isExtensionActive('nickname')) { // Load userid and nickname $result = SQL_QUERY_ESC("SELECT `userid`, `nickname` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } else { // Load only userid $result = SQL_QUERY_ESC("SELECT `userid`, `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } if (SQL_NUMROWS($result) > 0) { @@ -259,7 +259,7 @@ switch ($mode) { // Generate Code if (getConfig('transfer_code') > 0) { $rand = mt_rand(0, 99999); - $code = generateRandomCode(getConfig('transfer_code'), $rand, getUserId(), $content['max_transferable']); + $code = generateRandomCode(getConfig('transfer_code'), $rand, getMemberId(), $content['max_transferable']); $img = generateImageOrCode($code, false); $content['captcha_code'] = " " . $img; } else { @@ -308,7 +308,7 @@ switch ($mode) { // Run the SQL command and set total points to zero $totalPoints = 0; - $result = SQL_QUERY_ESC($sql, array(getUserId()), __FILE__, __LINE__); + $result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__); // Do we have entries? if (SQL_NUMROWS($result) > 0) { @@ -376,7 +376,7 @@ KEY (`party_userid`) // Let's begin with the incoming list $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT %s", - array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__); + array(getMemberId(), getConfig('transfer_max')), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = 'IN'; $DATA = implode("','", $DATA); @@ -388,7 +388,7 @@ KEY (`party_userid`) // As the last table transfer data from outgoing table to temporary $result = SQL_QUERY_ESC("SELECT `trans_id`, `to_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `id` LIMIT {?transfer_max?}", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = 'OUT'; $DATA = implode("','", $DATA); @@ -458,14 +458,14 @@ KEY (`party_userid`) default: // Overview page // Check incoming transfers - $total = countSumTotalData(getUserId(), 'user_transfers_in', 'id', 'userid', true); + $total = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', true); $content['in_link'] = $total; if ($total > 0) { $content['in_link'] = "".$total.""; } // END - if // Check outgoing transfers - $dmy = countSumTotalData(getUserId(), 'user_transfers_out', 'id', 'userid', true); + $dmy = countSumTotalData(getMemberId(), 'user_transfers_out', 'id', 'userid', true); // Add to total amount $total += $dmy; @@ -484,7 +484,7 @@ KEY (`party_userid`) if (isFormSent()) { // Save settings SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `opt_in`='%s' WHERE `userid`=%s LIMIT 1", - array(postRequestElement('opt_in'), getUserId()), __FILE__, __LINE__); + array(postRequestElement('opt_in'), getMemberId()), __FILE__, __LINE__); // Rember for next switch() command getUserData('opt_in') = substr(postRequestElement('opt_in'), 0, 1); @@ -524,7 +524,7 @@ ORDER BY LIMIT 1", array( getConfig('transfer_timeout'), - getUserId() + getMemberId() ), __FILE__, __LINE__); // Do we have an entry? diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 287077856b..1e7e55cb04 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -70,7 +70,7 @@ LIMIT 1", $content['is_notify'] = translateYesNo($content['is_notify']); $content['sender'] = getMessage('USERNAME_ADMIN_SHORT'); $content['time'] = createFancyTime($content['time']); - $content['userid'] = getUserId(); + $content['userid'] = getMemberId(); // Get timestamp from insert $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'), @@ -109,7 +109,7 @@ LIMIT 1", $content['category'] = getCategory($content['cat_id']); $content['points'] = translateComma($content['points']); $content['time'] = createFancyTime($content['time']); - $content['userid'] = getUserId(); + $content['userid'] = getMemberId(); // Get timestamp from insert $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'), @@ -126,11 +126,11 @@ LIMIT 1", if (isExtensionActive('bonus')) { // Load bonus id $result = SQL_QUERY_ESC("SELECT `stats_id`, `bonus_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid`=%s ORDER BY `bonus_id` DESC, stats_id DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } else { // Don't load bonus id $result = SQL_QUERY_ESC("SELECT `stats_id`, `stats_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid`=%s ORDER BY `stats_id` DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); } // Mails left for confirmation? @@ -206,7 +206,7 @@ LIMIT 1", // Prepare data for template $content = array( 'sw' => $SW, - 'userid' => getUserId(), + 'userid' => getMemberId(), 'data' => bigintval($DATA), 'type' => $type, 'subject' => $subject, diff --git a/inc/modules/member/what-welcome.php b/inc/modules/member/what-welcome.php index 0bf919b65c..a17d4214f4 100644 --- a/inc/modules/member/what-welcome.php +++ b/inc/modules/member/what-welcome.php @@ -57,7 +57,7 @@ loadTemplate('member_welcome_header', false, $content); // Chedk if he is returning from a profile update notification $result = SQL_QUERY_ESC("SELECT userid FROM `{?_MYSQL_PREFIX?}_user_data` WHERE notified='Y' AND `userid`=%s LIMIT 1", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); if ((SQL_NUMROWS($result) == 1) && (isExtensionActive('profile'))) { // Yes, he is so let's place him his wanted buttons diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 8eec798481..2006833362 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -69,7 +69,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose') $content['wernis_userid'] = 0; // Are there some entries? - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Fetch id $content['wernis_userid'] = getUserData('wernis_userid'); } // END - if @@ -81,7 +81,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose') // And load all rows! $result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{?_MYSQL_PREFIX?}_user_wernis` WHERE `userid`=%s ORDER BY `wernis_timestamp` DESC", - array(getUserId()), __FILE__, __LINE__); + array(getMemberId()), __FILE__, __LINE__); // Load all rows $content['rows'] = ''; $SW = 2; @@ -125,7 +125,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose') } } elseif ((getRequestElement('mode') == 'payout') && (getConfig('wernis_payout_active') == 'Y')) { // Get total points and check if the user can request a payout - $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); + $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); // Remove the registration fee $points = $points - getConfig('points_register'); @@ -159,13 +159,13 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose') $content['wernis_userid'] = ''; // Are there some entries? - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Fetch id $content['wernis_userid'] = getUserData('wernis_userid'); } // END - if } elseif ((getRequestElement('mode') == 'withdraw') && (getConfig('wernis_withdraw_active') == 'Y')) { // Get total points for just displaying them - $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); + $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); // Prepare data for the template $content['points'] = translateComma($points); @@ -176,7 +176,7 @@ if ((!isGetRequestElementSet('mode')) || (getRequestElement('mode') == 'choose') WERNIS_ADD_FEES_TO_ARRAY($content); // Get WDS66 id - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Fetch id $content['wernis_userid'] = getUserData('wernis_userid'); } // END - if @@ -216,11 +216,11 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) { $success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), md5(postRequestElement('wds66_password')), postRequestElement('amount')); if ($success === true) { // Add it to this amount - addPointsDirectly('wernis_withdraw', getUserId(), bigintval(postRequestElement('amount'))); + addPointsDirectly('wernis_withdraw', getMemberId(), bigintval(postRequestElement('amount'))); // Update the user data as well.. SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `wernis_userid`=%s WHERE `userid`=%s LIMIT 1", - array(bigintval(postRequestElement('wernis_userid')), getUserId()), __FILE__, __LINE__); + array(bigintval(postRequestElement('wernis_userid')), getMemberId()), __FILE__, __LINE__); // All done! loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_DONE')); @@ -247,11 +247,11 @@ if ((isFormSent()) && (isGetRequestElementSet('mode'))) { $success = WERNIS_EXECUTE_PAYOUT(postRequestElement('wernis_userid'), postRequestElement('amount')); if ($success === true) { // Sub points - subtractPoints('wernis_payout', getUserId(), postRequestElement('amount')); + subtractPoints('wernis_payout', getMemberId(), postRequestElement('amount')); // Update WDS66 id SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `wernis_userid`=%s WHERE `userid`=%s LIMIT 1", - array(bigintval(postRequestElement('wernis_userid')), getUserId()), __FILE__, __LINE__); + array(bigintval(postRequestElement('wernis_userid')), getMemberId()), __FILE__, __LINE__); // All done! loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_DONE')); diff --git a/inc/modules/order.php b/inc/modules/order.php index d26647bff3..35ddce0afe 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -68,14 +68,14 @@ if (empty($URL)) { // Update sending pool SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='%s' WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1", - array($type, bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__); + array($type, bigintval(getRequestElement('order')), getMemberId()), __FILE__, __LINE__); // Finally is the entry valid? if (SQL_AFFECTEDROWS() == 1) { // @TODO Unused: 2,4 // Load mail again... 0 1 2 3 4 5 6 7 $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1", - array(bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__); + array(bigintval(getRequestElement('order')), getMemberId()), __FILE__, __LINE__); $content = merge_array($content, SQL_FETCHARRAY($result)); SQL_FREERESULT($result); if (empty($content['subject'])) $content['subject'] = getMessage('DEFAULT_SUBJECT_LINE'); @@ -86,25 +86,25 @@ if (empty($URL)) { // Update used points $add = ''; if (getConfig('order_max_full') == 'ORDER') $add = ', mail_orders=mail_orders+1'; - subtractPoints('order', getUserId(), $usedPoints); + subtractPoints('order', getMemberId(), $usedPoints); // Compile content $content['payment'] = getPaymentTitlePrice($content['payment_id']); $content['category'] = getCategory($content['cat_id']); // Send an email to the user - $message_mem = loadEmailTemplate('order-member', $content, getUserId()); - sendEmail(getUserId(), getMessage('MEMBER_NEW_QUEUE'), $message_mem); + $message_mem = loadEmailTemplate('order-member', $content, getMemberId()); + sendEmail(getMemberId(), getMessage('MEMBER_NEW_QUEUE'), $message_mem); // Notify admins about this - sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId()); + sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getMemberId()); // Create new task createNewTask( '{--ADMIN_NEW_QUEUE--}', - '
'.loadEmailTemplate('order-admin', $content, getUserId()).'
', + '
'.loadEmailTemplate('order-admin', $content, getMemberId()).'
', 'MEMBER_ORDER', - getUserId(), + getMemberId(), 0, false ); diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 11ed8a13e4..61353a2983 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -59,6 +59,9 @@ initErrorHandler(); // Init request initRequest(); +// Init userid +initMemberId(); + // Set important header_sent if (!isset($GLOBALS['header_sent'])) $GLOBALS['header_sent'] = 0; diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index e1f912c95f..9c0e40109c 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -580,12 +580,12 @@ function isMember () { if (isset($GLOBALS['is_member'])) { // Then return it return $GLOBALS['is_member']; - } elseif (getUserId() == 0) { + } elseif (getMemberId() == 0) { // No member return false; } else { // Transfer userid=>current - setCurrentUserid(getUserId()); + setCurrentUserid(getMemberId()); } // Init global user data array @@ -595,9 +595,9 @@ function isMember () { fixDeletedCookies(array('userid', 'u_hash')); // Are cookies set? - if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) { + if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { // Cookies are set with values, but are they valid? - if (fetchUserData(getUserId()) === true) { + if (fetchUserData(getMemberId()) === true) { // Validate password by created the difference of it and the secret key $valPass = generatePassString(getUserData('password')); @@ -612,17 +612,17 @@ function isMember () { } else { // Maybe got locked etc. //* DEBUG: */ print(__LINE__."!!!
"); - destroyUserSession(); + destroyMemberSession(); } } else { // Cookie data is invalid! //* DEBUG: */ print(__LINE__."***
"); - destroyUserSession(); + destroyMemberSession(); } } else { // Cookie data is invalid! //* DEBUG: */ print(__LINE__."///
"); - destroyUserSession(); + destroyMemberSession(); } // Cache status @@ -896,7 +896,7 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry=false) { // @TODO Lame description for this function function sendModeMails ($mod, $modes) { // Load hash - if (fetchUserData(getUserId())) { + if (fetchUserData(getMemberId())) { // Extract salt from cookie $salt = substr(getSession('u_hash'), 0, -40); @@ -907,7 +907,7 @@ function sendModeMails ($mod, $modes) { if (($hash == getSession('u_hash')) || (postRequestElement('pass1') == postRequestElement('pass2'))) { // Load user's data 0 1 2 3 4 5 6 7 $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s AND password='%s' LIMIT 1", - array(getUserId(), getUserData('password')), __FUNCTION__, __LINE__); + array(getMemberId(), getUserData('password')), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load the data $content = SQL_FETCHARRAY($result, 0, false); @@ -950,7 +950,7 @@ function sendModeMails ($mod, $modes) { $content = merge_array($content, postRequestArray()); // Load template - $message = loadEmailTemplate('member_mydata_notify', $content, getUserId()); + $message = loadEmailTemplate('member_mydata_notify', $content, getMemberId()); if (getConfig('admin_notify') == 'Y') { // The admin needs to be notified about a profile change @@ -997,7 +997,7 @@ function sendModeMails ($mod, $modes) { if (empty($content)) { if ((!empty($sub_adm)) && (!empty($message_admin))) { // Send admin mail - sendAdminNotification($sub_adm, $message_admin, $content, getUserId()); + sendAdminNotification($sub_adm, $message_admin, $content, getMemberId()); } elseif (getConfig('admin_notify') == 'Y') { // Cannot send mails to admin! $content = getMessage('CANNOT_SEND_ADMIN_MAILS'); @@ -2054,8 +2054,8 @@ function getTimestampFromUserStats ($type, $data, $userid = 0) { $stamp = 0; // User id set? - if ((isUserIdSet()) && ($userid == 0)) { - $userid = getUserId(); + if ((isMemberIdSet()) && ($userid == 0)) { + $userid = getMemberId(); } // END - if // Is the extension installed and updated? diff --git a/inc/session-functions.php b/inc/session-functions.php index 9b9aa1f6d4..1c4fc7bbeb 100644 --- a/inc/session-functions.php +++ b/inc/session-functions.php @@ -94,9 +94,9 @@ function getSession ($var) { } // Destroy user session -function destroyUserSession () { +function destroyMemberSession () { // Reset userid - setUserId(0); + initMemberId(); // Remove all user data from session return ((setSession('userid', '')) && (setSession('u_hash', ''))); diff --git a/inc/session.php b/inc/session.php index 79428ddbba..a90234a9c3 100644 --- a/inc/session.php +++ b/inc/session.php @@ -65,12 +65,12 @@ determineReferalId(); // Transfer userid from session and validate it if (isSessionVariableSet('userid')) { // Get it secured from session - setUserId(getSession('userid')); + setMemberId(getSession('userid')); // Is it valid? if (!isMember()) { // Then destroy the user id - destroyUserSession(); + destroyMemberSession(); } // END - if } // END - if diff --git a/mailid_top.php b/mailid_top.php index 6a4e32f4a5..080fc73201 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -128,7 +128,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr if ($ltype == 'BONUS') $sender = 0; // Is the user id valid? - if (fetchUserData($url_userId) === true) { + if (fetchUserData($url_userid) === true) { // Is the user status CONFIRMED? if (getUserData('status') == 'CONFIRMED') { // User has confirmed his account so we can procede... diff --git a/surfbar.php b/surfbar.php index e0163e4ea5..8194064e4a 100644 --- a/surfbar.php +++ b/surfbar.php @@ -122,7 +122,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestElementSet('frame')) && (in_a unsetGetRequestElement('frame'); } elseif ((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'stats')) { // Get total points amount - $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points'); + $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points'); // Prepare content $content = array(