]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Deprecated $DATA renamed:
[mailer.git] / inc / functions.php
index e65600e13e36994bee1d1796de5e7cea09bad849..0f96686c20698392812a06755c7db34096dde385 100644 (file)
@@ -295,7 +295,7 @@ function generateDateTime ($time, $mode = '0') {
                                default:
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                        break;
-                       }
+                       } // END - switch
                        break;
 
                default: // Default is the US date / time format!
@@ -1453,7 +1453,6 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
 
                                // Call the multi-parameter call-back
                                $ret = call_user_func_array($filterFunction, $args);
-                               die('filterFunction='.$filterFunction.',args=<pre>'.print_r($args,true).',ret=<pre>'.print_r($ret,true).'</pre>');
                        } else {
                                // One parameter call
                                $ret = call_user_func($filterFunction, $value);
@@ -1466,7 +1465,7 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
 }
 
 // Converts timestamp selections into a timestamp
-function convertSelectionsToEpocheTime (array &$postData, array &$DATA, &$id, &$skip) {
+function convertSelectionsToEpocheTime (array &$postData, array &$content, &$id, &$skip) {
        // Init test variable
        $skip  = false;
        $test2 = '';
@@ -1481,7 +1480,7 @@ function convertSelectionsToEpocheTime (array &$postData, array &$DATA, &$id, &$
                if ((isset($postData[$test.'_ye'])) && (isset($postData[$test.'_mo'])) && (isset($postData[$test.'_we'])) && (isset($postData[$test.'_da'])) && (isset($postData[$test.'_ho'])) && (isset($postData[$test.'_mi'])) && (isset($postData[$test.'_se'])) && ($test != $test2)) {
                        // Generate timestamp
                        $postData[$test] = createEpocheTimeFromSelections($test, $postData);
-                       $DATA[] = sprintf("`%s`='%s'", $test, $postData[$test]);
+                       $content[] = sprintf("`%s`='%s'", $test, $postData[$test]);
                        $GLOBALS['skip_config'][$test] = true;
 
                        // Remove data from array
@@ -1691,7 +1690,7 @@ function determineReferalId () {
        }
 
        // Set cookie when default refid > 0
-       if (!isSessionVariableSet('refid') || (!isValidUserId(getReferalId())) || ((!isValidUserId(getSession('refid'))) && (isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (isValidUserId(getDefRefid())))) {
+       if ((!isSessionVariableSet('refid')) || (!isValidUserId(getReferalId())) || ((!isValidUserId(getSession('refid'))) && (isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (isValidUserId(getDefRefid())))) {
                // Default is not found
                $found = false;
 
@@ -1722,11 +1721,12 @@ function determineReferalId () {
                // Set cookie
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Saving refid to session (' . getReferalId() . ') #1');
                setSession('refid', getReferalId());
-       } elseif (!isReferalIdValid()) {
+       } elseif ((!isReferalIdValid()) || (!fetchUserData(getReferalId()))) {
                // Not valid!
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Not valid referal id (' . getReferalId() . '), setting NULL in session');
+               setReferalId(NULL);
                setSession('refid', NULL);
-       } elseif ((!isSessionVariableSet('refid')) && (isValidUserId(getReferalId()))) {
+       } else {
                // Set it from GLOBALS array in session
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Saving refid to session (' . getReferalId() . ') #2');
                setSession('refid', getReferalId());