Naming inconsistencies for userid fixed
authorRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 08:30:49 +0000 (08:30 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 08:30:49 +0000 (08:30 +0000)
42 files changed:
inc/filters.php
inc/functions.php
inc/libs/online_functions.php
inc/libs/primera_functions.php
inc/libs/refback_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/libs/wernis_functions.php
inc/modules/chk_login.php
inc/modules/frametester.php
inc/modules/guest/what-login.php
inc/modules/guest/what-rallyes.php
inc/modules/member/what-beg.php
inc/modules/member/what-categories.php
inc/modules/member/what-doubler.php
inc/modules/member/what-holiday.php
inc/modules/member/what-html_mail.php
inc/modules/member/what-logout.php
inc/modules/member/what-mydata.php
inc/modules/member/what-nickname.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php
inc/modules/member/what-primera.php
inc/modules/member/what-rallyes.php
inc/modules/member/what-refback.php
inc/modules/member/what-reflinks.php
inc/modules/member/what-reflist.php
inc/modules/member/what-stats.php
inc/modules/member/what-support.php
inc/modules/member/what-themes.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/modules/member/what-welcome.php
inc/modules/member/what-wernis.php
inc/modules/order.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/session-functions.php
inc/session.php
mailid_top.php
surfbar.php

index 431b5ac367a4b21f71e9f67f895416827fb3aa3a..4426a95aa66ce611a60ba19814e5edac3a55e83d 100644 (file)
@@ -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('<em>{--USERNAME_UNKNOWN--}</em>');
 
                        // 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));
index 7908206a7c6e5af7b92335a8f34e52c5faad74a0..6848f87e4f82bebf81ecbb52f3f89f2376592436 100644 (file)
@@ -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
index 95643bc0cd474b3ef85e4d0e14af0017eb95a604..125f4a38a70821e9069b015fd2b56eab616eb120 100644 (file)
@@ -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
 
index 54c5929a051c2ef155d76962ffc8aedb468f4b1a..1082695af8c4adf3bbd45e3c2f6f6fda8dbcc53b 100644 (file)
@@ -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);
index 8dbae40a98b95c6d649c7468dce79484887989c7..1c499387538523d1fddbadb81a9d12fdd452d170 100644 (file)
@@ -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;
index 1fc4d35ca50341717937e26ca9ba81e1f2315205..dd17a102a7a9406f41607c1dac1861d5b6d654da 100644 (file)
@@ -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__
                );
        }
 
index 1fdb5105002af5de754c12ea0b394be5a8f137d3..9ab8d984f3853504d2f3973a7cd65c80a6d1caed 100644 (file)
@@ -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']))) {
index be5acd5de2d79c2d2405fe5103f5072f99e28fff..468a0db29c80989611c960d0a4fdfa32ac67c931 100644 (file)
@@ -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}<br />");
        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
 
index 3014e87d8d85c3bbf9e6589e4cb5f270e78eabf1..e87de7dbf4912673cb6acfc985f13657caf62eaf 100644 (file)
@@ -44,13 +44,13 @@ if (!defined('__SECURITY')) {
 // Initial message part
 $message = "<strong>{--VALIDATING_LOGIN--}</strong>";
 
-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__
                );
index 6bf21086fcb7c664995396f67341579e50fdf74a..aed13dad847e43730355748b158739f6682f0e8c 100644 (file)
@@ -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) {
index b8bc4b148bec3b39d90ddf3945674250ef30ff7a..d711852a584b67dbc8bb3b6dcf1e3df9f673cc44 100644 (file)
@@ -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')))) {
index 26417389b94f979e1fd73c131f5dd7011a9bb0af..66bbac8df33ee905680116dd2d5f672c933fbc2d 100644 (file)
@@ -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');
        }
 
index 7790719a610da3d0dd07f12ea8646fc85cea3010..bb0fe4ad0c6db40f914d65176efd71c75663fb6e 100644 (file)
@@ -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;
index c6674511b9ebb259c71f5de9deac71333594a4ef..66f6981b8c64e25d65e489d91414d3b65c74ef21 100644 (file)
@@ -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 = '';
 
index 8ed0af52760b92bef353090545fc7123b37e5896..364261fd4f0e53143fe51db8ebfc8d8875a0f6c8 100644 (file)
@@ -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'));
index c7fdc9d51b2b8b9ea3507c25a93d3adf52769047..e9ec739204e1c4da2c43f43b196b5146fa58e312 100644 (file)
@@ -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&amp;what=holiday');
                                        return;
                                }
index 278e8b865ba67154420e79bbe51d9af6edce427b..a558191a21fd5be8facb90227895448c2aa7e0e2 100644 (file)
@@ -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
index 5f3c4ce5637ee987ff98813096b0dd24b65474b4..4108e31a46c7cf65c7bd1fcb0aa7233a2d25c154 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 // Base URL for redirection (both cases)
 $URL = 'modules.php?module=index&amp;code=';
 
-if (destroyUserSession()) {
+if (destroyMemberSession()) {
        // Remove theme cookie as well
        setTheme('');
 
index ba473bdc915d1c2b0c777e21cc864b4252d53ef3..3ae5495f1ff970340eda9e3f82eaa1a2d5ea618a 100644 (file)
@@ -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&amp;what=welcome&amp;code=' . urlencode(getMessage('PROFILE_UPDATED'));
                break;
 } // END - switch
index dcdf230e122244efb0ce054af2ce62c94b0bd276..9589728a3a85f9089b6681255465dce676b6333e 100644 (file)
@@ -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]
index 820d092bd00663f3c235d21615a92b077d833055..a9b269896d66e50e85eefbe9cd9f84a791b98c4e 100644 (file)
@@ -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
index 624d8e1d5c385a5549a944cfdb55509462a964c5..763187ed6a25ceb31657524be57323d2a3a976fb 100644 (file)
@@ -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'));
index 4df5afb32fb45f4b6b6bd966f83aba98dbeaeabb..14023d575e169c89c66bcd3642ac70bb66a9eae9 100644 (file)
@@ -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
index b602530b3bace7210e1108e8a79229f734af06da..77bcf6455b7ae910f25a2356a100ef4115675937 100644 (file)
@@ -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'));
index 7664ad0656a9ea7e3da887e7da934c3910e73e83..0ba1b7e4c57b54300099dbc5c9c1ff44d68ec6a0 100644 (file)
@@ -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');
        }
 
index 1c0f3442ba2e9cadca70a36543c608053e198493..be8f0301587f2cc2cd8eabaf6e5818e0e169b500 100644 (file)
@@ -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;
index d4838a47fd337ad03c0977a2b25151d1f64abf0d..aa806b1237e147eb3dc9adab69d9bbf622d638d4 100644 (file)
@@ -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);
index b49e0bd75161b353b12da40c23480e374d981425..ecd52bb0599f4487412c3506b22caaaa09f12015 100644 (file)
@@ -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']);
index ef5959e75020cb81ea7d71f36e450abe4f1eaf46..65a9a51674414cbd2391587d67140c9ff292f8ec 100644 (file)
@@ -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
index b6c9d742c6b53cb85abc84bf188e517538b5aabd..71f468964e7f7e24a96dbdbe0d4b2d6d6cc74766 100644 (file)
@@ -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');
index bc4276c120d13fbdf3e417a72dd40b62d60bf884..1edafa3648f26c9b50d9e8d50905c5af6479bbbf 100644 (file)
@@ -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'));
index 2bbc1eeee18add4d0906cca71ea9261e59bc5a99..777d43cc00ac54f2b309b9dcfcb78264a3c9b8e7 100644 (file)
@@ -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'] = "<input type=\"hidden\" name=\"code_chk\" value=\"".$rand."\" /><input type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".$content['to_disabled']." />&nbsp;" . $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'] = "<a href=\"{?URL?}/modules.php?module=login&amp;what=transfer&amp;mode=list_in\">".$total."</a>";
                } // 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?
index 287077856b2ce8c3cc74c7f312bdecf947d2f97f..1e7e55cb04c0128f5dc38bfbe0640803bde2916f 100644 (file)
@@ -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,
index 0bf919b65c8b20c2a9509e5ea129cc1dcc580f26..a17d4214f4f6e6a119339d3566f50c94291d2ad2 100644 (file)
@@ -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
index 8eec7984815a7ec1312332fe13a1b236b0111ba3..2006833362a2c715b87b0115b3b7459209c867dc 100644 (file)
@@ -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'));
index d26647bff32841bc7670dcb4f6053d50a268d982..35ddce0afe6d5c313082042e8fbf751add33883a 100644 (file)
@@ -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--}',
-                       '<pre>'.loadEmailTemplate('order-admin', $content, getUserId()).'</pre>',
+                       '<pre>'.loadEmailTemplate('order-admin', $content, getMemberId()).'</pre>',
                        'MEMBER_ORDER',
-                       getUserId(),
+                       getMemberId(),
                        0,
                        false
                );
index 11ed8a13e4e5e58c2af4f47abd1ceae91a0ec957..61353a29839085000f57eb50b25079fd603eb42b 100644 (file)
@@ -59,6 +59,9 @@ initErrorHandler();
 // Init request
 initRequest();
 
+// Init userid
+initMemberId();
+
 // Set important header_sent
 if (!isset($GLOBALS['header_sent'])) $GLOBALS['header_sent'] = 0;
 
index e1f912c95f6c9bf33c12dba11e2e974c75dfcd02..9c0e40109c51376d3086e06529441b1641349167 100644 (file)
@@ -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__."!!!<br />");
-                               destroyUserSession();
+                               destroyMemberSession();
                        }
                } else {
                        // Cookie data is invalid!
                        //* DEBUG: */ print(__LINE__."***<br />");
-                       destroyUserSession();
+                       destroyMemberSession();
                }
        } else {
                // Cookie data is invalid!
                //* DEBUG: */ print(__LINE__."///<br />");
-               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?
index 9b9aa1f6d411a8bbc4daf6efe0f692da66f9624b..1c4fc7bbeb2c421330196fd407f03e7c71bd046b 100644 (file)
@@ -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', '')));
index 79428ddbba7ba2321db6fe1c8083c2fd8abd6bf3..a90234a9c3c28796cac13d81cb8d1a38d4b26869 100644 (file)
@@ -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
 
index 6a4e32f4a5430ae5b546c96d2062b8a0bfbc24be..080fc732011db534bf73e15de08824a46ce6848b 100644 (file)
@@ -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...
index e0163e4ea5c1478d3c4a69d0025f8fe2c729c90f..8194064e4a21c565c488c4665abb0440eead29e0 100644 (file)
@@ -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(