- case "settings":
- $REF = bigintval($_POST['ref_payout']);
- $SQLs[] = 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 ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0)) {
- // Update account's ref_payout for "must-confirm"
- $SQLs[] = sprintf("UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=(%s - mails_confirmed)
-WHERE mails_confirmed < %s", $REF, $REF);
- } elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0)) {
- // Update account's ref_payout for "not-must-confirm"
- $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=0 WHERE ref_payout > 0";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_points SET points=points+locked_points WHERE locked_points>0";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_points SET locked_points=0 WHERE locked_points>0";
- }
- break;
- }
-
- if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) {
- if (strpos($SQLs[0], "INSERT") > -1) {
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
- array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
- SQL_FREERESULT($result);
- } // END - if