X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fsession.php;h=f3b02711625248d411212863a9e373eda9a167b8;hb=0e500eb441c95d3128835dfabab1de1f528caed2;hp=b0420aa12d9ef849f36d6b47ff008dc72ce9521e;hpb=58b29a924c48e7c1ce38c435c92e541b53984c56;p=mailer.git diff --git a/inc/session.php b/inc/session.php index b0420aa12d..f3b0271162 100644 --- a/inc/session.php +++ b/inc/session.php @@ -56,9 +56,7 @@ set_session("mx_lang", $mx_lang); if ((!empty($_GET['user'])) && ($CLICK == 1) && ($_SERVER['PHP_SELF'] == "click.php")) { // The variable user comes from the click-counter script click.php and we only accept this here $GLOBALS['refid'] = bigintval($_GET['user']); -} - -if (!empty($_POST['refid'])) { +} elseif (!empty($_POST['refid'])) { // Get referral id from variable refid (so I hope this makes my script more compatible to other scripts) $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid'])); } elseif (!empty($_GET['refid'])) { @@ -67,10 +65,10 @@ if (!empty($_POST['refid'])) { } elseif (!empty($_GET['ref'])) { // Set refid=ref (the referral link uses such variable) $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref'])); -} elseif (!empty($_SESSION['refid'])) { +} elseif (isSessionVariableSet('refid')) { // Set session refid als global - $GLOBALS['refid'] = bigintval($_SESSION['refid']); -} elseif (GET_EXT_VERSION("sql_patches") != "") { + $GLOBALS['refid'] = bigintval(get_session('refid')); +} elseif (GET_EXT_VERSION("sql_patches") != '') { // Set default refid as refid in URL $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']); } else { @@ -79,7 +77,7 @@ if (!empty($_POST['refid'])) { } // Set cookie when default refid > 0 -if (empty($_SESSION['refid']) || (!empty($GLOBALS['refid'])) || (($_SESSION['refid'] == "0") && ($_CONFIG['def_refid'] > 0))) { +if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && ($_CONFIG['def_refid'] > 0))) { // Set cookie set_session("refid", $GLOBALS['refid']); }