From: Roland Häder Date: Fri, 19 Dec 2008 16:37:39 +0000 (+0000) Subject: Variable rewritten to ['ref_level'] to avoid trouble with referal system X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=22a33b87f9894a94efb71de7630f12129e34f83b;p=mailer.git Variable rewritten to ['ref_level'] to avoid trouble with referal system --- diff --git a/birthday_confirm.php b/birthday_confirm.php index a29859a8d6..69530f99f0 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -79,12 +79,12 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", if (($data['ref_payout'] > 0) && (getConfig('allow_direct_pay') == "N")) $locked = true; // Add points to account - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower(getConfig('birthday_mode'))); // Remove entry from table $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_birthday WHERE userid=%s AND chk_value='%s' LIMIT 1", - array($uid, $chk), __FILE__, __LINE__); + array($uid, $chk), __FILE__, __LINE__); // Update mediadata if version is 0.0.4 or newer if (GET_EXT_VERSION("mediadata") >= "0.0.4") { diff --git a/inc/databases.php b/inc/databases.php index f0e384bf4f..c348b3e7df 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -115,7 +115,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "662"); +define('CURR_SVN_REVISION', "663"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index 04db5702d1..7eeb42072a 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -52,7 +52,7 @@ function BEG_ADD_POINTS ($uid, $points) { array($points, $uid), __FILE__, __LINE__); } else { // Add points to account - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("beg", $uid, $points, false, "0", $locked, strtolower(getConfig('beg_mode'))); } diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 85722cdad7..cd8d0fb4de 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -40,10 +40,10 @@ if (!defined('__SECURITY')) { // Payback refback for refid and reduce it for current user function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 4937318b2e..1c30a49649 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -303,7 +303,7 @@ function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) { // function ADMIN_DO_ACTION($wht) { - global $menuDesription, $menuTitle, $_CONFIG, $cacheArray, $DATA, $DEPTH; + global $menuDesription, $menuTitle, $_CONFIG, $cacheArray, $DATA; //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*
\n"; if (EXT_IS_ACTIVE("cache")) { diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index 97c5c157b0..f96c1e1dc3 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -49,36 +49,24 @@ if ($_GET['u_id'] == "all") { define('__POINTS_VALUE', $_POST['points']); $result_main = SQL_QUERY("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__); while (list($uid) = SQL_FETCHROW($result_main)) { - // User ID found in URL so we use this give him some credits - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { - // Selected user does exist - list($sname, $fname, $email) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - - if ((isset($_POST['ok'])) && (!empty($_POST['points']))) { - global $DEPTH; - // Remove depth to prevent booking errors. This is a bad coding - // practice, thats also why we need to write this project from - // scratch... - unset($DEPTH); + // Remove depth to prevent booking errors. This is a bad coding + // practice, thats also why we need to write this project from + // scratch... + $GLOBALS['ref_level'] = -1; - // Ok, add points and send an email to him... - ADD_POINTS_REFSYSTEM("admin_all", $uid, bigintval($_POST['points']), false, "0", false, "direct"); + // Ok, add points and send an email to him... + ADD_POINTS_REFSYSTEM("admin_all", $uid, bigintval($_POST['points']), false, "0", false, "direct"); - // Prepare content - $content = array( - 'text' => SQL_ESCAPE($_POST['reason']), - 'points' => bigintval($_POST['points']) - ); + // Prepare content + $content = array( + 'text' => SQL_ESCAPE($_POST['reason']), + 'points' => bigintval($_POST['points']) + ); - // Load email template and send email away - $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($uid)); - SEND_EMAIL(bigintval($uid), ADMIN_ADD_SUBJ, $msg); - } - } - } + // Load email template and send email away + $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($uid)); + SEND_EMAIL(bigintval($uid), ADMIN_ADD_SUBJ, $msg); + } // END - while // Free memory SQL_FREERESULT($result_main); @@ -99,11 +87,10 @@ if ($_GET['u_id'] == "all") { SQL_FREERESULT($result); if ((isset($_POST['ok'])) && (!empty($_POST['points']))) { - global $DEPTH; // Remove depth to prevent booking errors. This is a bad coding // practice, thats also why we need to write this project from // scratch... - unset($DEPTH); + unset($GLOBALS['ref_level']); // Ok, add points and send an email to him... ADD_POINTS_REFSYSTEM("admin_single", bigintval($_GET['u_id']), bigintval($_POST['points']), false, "0", false, "direct"); diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php index 6f5a7cbe9d..902efb8165 100644 --- a/inc/modules/guest/what-confirm.php +++ b/inc/modules/guest/what-confirm.php @@ -70,7 +70,7 @@ if (!empty($_GET['hash'])) { UPDATE_REF_COUNTER($rid); // Ok, write the ref-points to this user and his parent-ref - unset($DEPTH); + unset($GLOBALS['ref_level']); // Shall I "pay" the referal points imidiately? if (getConfig('ref_payout') == "0") { @@ -92,7 +92,7 @@ if (!empty($_GET['hash'])) { } // END - if // Add one-time referal bonus over referal system or directly - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("referal_bonus", $rid, getConfig('points_ref'), true, bigintval($uid), $locked, getConfig('reg_points_mode')); } // END - if } // END - if diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index ae45f45c00..1773a61282 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -231,7 +231,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { $success = WERNIS_EXECUTE_WITHDRAW($_POST['wds66_id'], md5($_POST['wds66_password']), $_POST['amount']); if ($success) { // Add it to this amount - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("wernis_withdraw", $GLOBALS['userid'], bigintval($_POST['amount']), false, 0, false, "direct"); // Update the user data as well.. diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 4544a12929..1f261f4f3b 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1106,8 +1106,8 @@ function GET_REF_LEVEL_PERCENTS ($level) { * for default value will cause no referal will get points ever!!!) */ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; } // function UPDATE_REF_COUNTER ($uid) { @@ -1562,7 +1562,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); } // function META_DESCRIPTION ($mod, $wht) { - global $_CONFIG, $DEPTH; + global $_CONFIG; // Exclude admin and member's area if (($mod != "admin") && ($mod != "login")) { @@ -1574,7 +1574,7 @@ function META_DESCRIPTION ($mod, $wht) { } // END - if // Remove depth - unset($DEPTH); + unset($GLOBALS['ref_level']); } // function ADD_JACKPOT($points) { diff --git a/mailid_top.php b/mailid_top.php index 344bed250c..f95e1af07d 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -236,7 +236,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { array($url_uid), __FILE__, __LINE__); // Add points - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("mailid_okay", $url_uid, $payment, false, "0", $locked); // Shall I add bonus points for "turbo clickers" ? @@ -268,7 +268,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { LOAD_TEMPLATE($template); } else { // Wrong image code! So add points to sender's account - unset($DEPTH); + unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("mailid_payback", $sender, $payment, false, 0, false, "direct"); // Load template