]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Don't forget these... :(
[mailer.git] / inc / mysql-manager.php
index 8fadc7f8839f9effbf0c251c10cf632b34ac35e1..0d0e060d66efa7749ed7c4864c19990571811a2c 100644 (file)
@@ -371,10 +371,10 @@ function isMember () {
        if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) $GLOBALS['last_online'] = array();
 
        // is the cache entry there?
-       if (isset($GLOBALS['is_member'])) {
+       if (isset($GLOBALS[__FUNCTION__])) {
                // Then return it
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHED! (' . intval($GLOBALS['is_member']) . ')');
-               return $GLOBALS['is_member'];
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHED! (' . intval($GLOBALS[__FUNCTION__]) . ')');
+               return $GLOBALS[__FUNCTION__];
        } elseif ((!isSessionVariableSet('userid')) || (!isSessionVariableSet('u_hash'))) {
                // No member
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'No member set in cookie/session.');
@@ -424,7 +424,7 @@ function isMember () {
        }
 
        // Cache status
-       $GLOBALS['is_member'] = $ret;
+       $GLOBALS[__FUNCTION__] = $ret;
 
        // Return status
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . intval($ret));
@@ -442,7 +442,7 @@ function fetchUserData ($userid, $column = 'userid') {
                setCurrentUserId($userid);
 
                // Don't look for invalid userids...
-               if ($userid < 1) {
+               if (!isValidUserId($userid)) {
                        // Invalid, so abort here
                        debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $userid . ' is invalid.');
                } elseif (isUserDataValid()) {
@@ -540,9 +540,9 @@ function isAdmin () {
        } // END - if
 
        // Do we have cache?
-       if (!isset($GLOBALS['is_admin'][$adminId])) {
+       if (!isset($GLOBALS[__FUNCTION__][$adminId])) {
                // Init it with failed
-               $GLOBALS['is_admin'][$adminId] = false;
+               $GLOBALS[__FUNCTION__][$adminId] = false;
 
                // Search in array for entry
                if (isset($GLOBALS['admin_hash'])) {
@@ -568,12 +568,12 @@ function isAdmin () {
                if (!empty($valPass)) {
                        // Check if password is valid
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '(' . $valPass . '==' . $passCookie . ')='.intval($valPass == $passCookie));
-                       $GLOBALS['is_admin'][$adminId] = (($GLOBALS['admin_hash'] == $passCookie) || ((strlen($GLOBALS['admin_hash']) == 32) && ($GLOBALS['admin_hash'] == md5($passCookie))) || (($GLOBALS['admin_hash'] == '*FAILED*') && (!isExtensionActive('cache'))));
+                       $GLOBALS[__FUNCTION__][$adminId] = (($GLOBALS['admin_hash'] == $passCookie) || ((strlen($GLOBALS['admin_hash']) == 32) && ($GLOBALS['admin_hash'] == md5($passCookie))) || (($GLOBALS['admin_hash'] == '*FAILED*') && (!isExtensionActive('cache'))));
                } // END - if
        } // END - if
 
        // Return result of comparision
-       return $GLOBALS['is_admin'][$adminId];
+       return $GLOBALS[__FUNCTION__][$adminId];
 }
 
 // Generates a list of "max receiveable emails per day"
@@ -1063,7 +1063,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
 
                        // Determine wether the user has some mails to click before he/she gets the points
                        $locked = false;
-                       if ((getUserData('ref_payout') > 0) && (!isDirectPaymentAllowed())) $locked = true;
+                       if ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled())) $locked = true;
 
                        // Prepare data for the filter
                        $filterData = array(
@@ -1097,7 +1097,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        } elseif (($sendNotify === true) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) {
                                // Prepare content
                                $content = array(
-                                       'text'   => '{--REASON_DIRECT_PAYMENT--}',
+                                       'reason' => '{--REASON_DIRECT_PAYMENT--}',
                                        'points' => $ref_points
                                );