]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Refback and referal points hopefully fixed:
[mailer.git] / inc / libs / user_functions.php
index 7ae54fa9ddb6bae93cf49b604697d05648e48b38..601ca42eb0d702991a8771d7b531677ebf809569 100644 (file)
@@ -472,7 +472,7 @@ function doNewUserPassword ($email, $userid) {
 }
 
 // Get timestamp for given stats type and data
-function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = '0') {
+function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = NULL) {
        // Default timestamp is zero
        $data['inserted'] = '0';
 
@@ -548,7 +548,7 @@ function doConfirmUserAccount ($hash) {
        );
 
        // Initialize the user id
-       $userid = '0';
+       $userid = NULL;
 
        // Search for an unconfirmed or confirmed account
        $result = SQL_QUERY_ESC("SELECT `userid`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
@@ -587,7 +587,7 @@ LIMIT 1",
                        sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
 
                        // Maybe he got "referaled"?
-                       if (($refid > 0) && ($refid != $userid)) {
+                       if ((isValidUserId($refid)) && ($refid != $userid)) {
                                // Select the referal userid
                                if (fetchUserData($refid)) {
                                        // Update ref counter...