]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Fix for wrong variable name
[mailer.git] / inc / libs / user_functions.php
index f4558fa77f05bdbdbc22191fa51f07fcfb41f626..b305181ace1ca0ac88b985075a47c5240c736fb6 100644 (file)
@@ -339,7 +339,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                } // END - if
 
                                // Is the timeout reached?
-                               if ($probe >= getConfig('login_timeout')) {
+                               if ($probe >= getLoginTimeout()) {
                                        // Add login bonus to user's account
                                        $add = ',`login_bonus`=`login_bonus`+{?login_bonus?}';
                                        $GLOBALS['bonus_payed'] = TRUE;
@@ -436,7 +436,7 @@ function doNewUserPassword ($email, $userid) {
        } elseif ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) {
                // Nickname entered
                $accountFound = fetchUserData($userid, 'nickname');
-       } elseif ((isValidUserId($userid)) && (empty($email))) {
+       } elseif ((isValidId($userid)) && (empty($email))) {
                // Direct userid entered
                $accountFound = fetchUserData($userid);
        } elseif (isDebugModeEnabled()) {
@@ -449,19 +449,19 @@ function doNewUserPassword ($email, $userid) {
                // Is the account confirmed
                if (getUserData('status') == 'CONFIRMED') {
                        // Generate new password
-                       $NEW_PASS = generatePassword();
+                       $newPassword = generatePassword();
 
                        // Update database
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `password`='%s' WHERE `userid`=%s LIMIT 1",
                                array(
-                                       generateHash($NEW_PASS),
+                                       generateHash($newPassword),
                                        getUserData('userid')
                                ), __FUNCTION__, __LINE__);
 
                        // Prepare data and message for email
                        $message = loadEmailTemplate('guest_new_password',
                                array(
-                                       'new_pass' => $NEW_PASS,
+                                       'new_pass' => $newPassword,
                                        'nickname' => $userid
                                ), getUserData('userid'));
 
@@ -505,7 +505,7 @@ function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = NULL) {
 
        // Try to find the entry
        $result = SQL_QUERY_ESC("SELECT
-       UNIX_TIMESTAMP(`inserted`) AS inserted
+       UNIX_TIMESTAMP(`inserted`) AS `inserted`
 FROM
        `{?_MYSQL_PREFIX?}_user_stats_data`
 WHERE
@@ -612,7 +612,7 @@ LIMIT 1",
                        sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
 
                        // Maybe he got "referraled"?
-                       if ((isValidUserId($refid)) && ($refid != $userid)) {
+                       if ((isValidId($refid)) && ($refid != $userid)) {
                                // Select the referral userid
                                if (fetchUserData($refid)) {
                                        // Update ref counter...
@@ -625,7 +625,7 @@ LIMIT 1",
                                                        array(bigintval($refid)), __FILE__, __LINE__);
 
                                                // Subtract points from system
-                                               handleBonusPoints(getConfig('bonus_ref'), $refid);
+                                               handleBonusPoints(getBonusRef(), $refid);
                                        } // END - if
 
                                        // Add one-time referral bonus over referral system or directly
@@ -759,7 +759,7 @@ function getNextFreeTesterUserNumber () {
        $nextTester = getTotalTesterUsers();
 
        // Prepend zeros
-       $nextTester = prependZeros($nextTester, 6);
+       $nextTester = padLeftZero($nextTester, 6);
 
        // Return it
        return $nextTester;
@@ -867,11 +867,11 @@ function isUserSubIdAssignedToMember ($subId, $userid = NULL) {
                $GLOBALS[__FUNCTION__][$subId][$userid] = (
                        (
                                // Is a userid set or current set?
-                               (isValidUserId($userid)) || (isMember())
+                               (isValidId($userid)) || (isMember())
                        ) && (
                                // .. and it assigned with subid's id?
                                countSumTotalData(
-                                       (isValidUserId($userid) ? $userid : getMemberId()),
+                                       (isValidId($userid) ? $userid : getMemberId()),
                                                'user_subids',
                                                'id',
                                                'userid',
@@ -995,7 +995,7 @@ function doTemplateAdminListUserTitle ($template, $clear = FALSE) {
 // Template call-back function for displaying "username"
 function doTemplateDisplayUsername ($template, $clear = FALSE, $userid = NULL) {
        // Is a userid set?
-       if (!isValidUserId($userid)) {
+       if (!isValidId($userid)) {
                // Please don't call this without a valid userid
                reportBug(__FUNCTION__, __LINE__, 'template=' . $template . ',clear=' . intval($clear) . ',userid[' . gettype($userid) . ']=' . intval($userid) . ' - Invalid userid provided.');
        } // END - if
@@ -1169,5 +1169,53 @@ function getTesterUserEmail () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for 'ap_subids' config entry
+function getApSubids () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('ap_subids');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines whether 'ap_subids' is set to 'Y'
+function isApSubidsEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getApSubids() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'ap_subids_since' config entry
+function getApSubidsSince () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('ap_subids_since');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'select_user_zero_refid' config entry
+function getSelectUserZeroRefid () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('select_user_zero_refid');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>