- case "settings":
- $REF = bigintval($_POST['ref_payout']);
- $SQL[] = sprintf("UPDATE "._MYSQL_PREFIX."_config SET
-allow_direct_pay='%s',
-reg_points_mode='%s',
-ref_payout='%s'
-WHERE config=0 LIMIT 1",
- $_POST['allow_direct_pay'],
- $_POST['reg_points_mode'],
- $REF
- );
- if (($_CONFIG['ref_payout'] == 0) && ($_POST['ref_payout'] > 0))
- {
- // Update account's ref_payout for "must-confirm"
- $SQL[] = sprintf("UPDATE "._MYSQL_PREFIX."_user_data SET ref_payout=(%s - mails_confirmed)
-WHERE mails_confirmed < %s", $REF, $REF);
- }
- elseif (($_CONFIG['ref_payout'] > 0) && ($_POST['ref_payout'] == 0))
- {
- // Update account's ref_payout for "not-must-confirm"
- $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_data SET ref_payout=0 WHERE ref_payout > 0";
- $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_points SET points=points+locked_points WHERE locked_points>0";
- $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_points SET locked_points=0 WHERE locked_points>0";
- }
- break;
- }
- if ((isset($SQL)) && (is_array($SQL)) && (!empty($SQL[0])))
- {
- if (strpos($SQL[0], "INSERT") > -1)
- {
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
- array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
+ if ((isSqlsValid()) && (isSqlsValid())) {
+ if (strpos($GLOBALS['sqls'][0], 'INSERT') > -1) {
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level`='%s' LIMIT 1",
+ array(bigintval(postRequestParameter('level'))), __FILE__, __LINE__);