]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
convertSelectionsToEpocheTimeInPostData() is a wrapper and only needs the POST field...
[mailer.git] / inc / libs / user_functions.php
index a8718292e43c448f0b280f646a970a85d3f2ca6e..41c52078e24b3e0dab20157c338c81b2bd6b0a9c 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;
@@ -439,7 +439,7 @@ function doNewUserPassword ($email, $userid) {
        } elseif ((isValidUserId($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.');
        }
@@ -449,18 +449,21 @@ 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), 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);
@@ -622,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
@@ -1166,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]
 ?>