} // 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;
} 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);
- } else {
+ } elseif (isDebugModeEnabled()) {
// Userid not set!
logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',email=' . $email . ': Important variables are empty.');
}
// 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), getUserData('userid')), __FUNCTION__, __LINE__);
+ array(
+ 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
- ), bigintval(getUserData('userid')));
+ ), getUserData('userid'));
// ... and send it away
sendEmail(bigintval(getUserData('userid')), '{--GUEST_NEW_PASSWORD--}', $message);
// 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
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...
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
$nextTester = getTotalTesterUsers();
// Prepend zeros
- $nextTester = prependZeros($nextTester, 6);
+ $nextTester = padLeftZero($nextTester, 6);
// Return it
return $nextTester;
$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',
// 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
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]
?>