- case "settings":
- $REF = bigintval(REQUEST_POST('ref_payout'));
- updateConfiguration(
- array('allow_direct_pay', 'reg_points_mode', 'ref_payout'),
- array(REQUEST_POST('allow_direct_pay'), REQUEST_POST('reg_points_mode'), $REF)
- );
- if ((getConfig('ref_payout') == 0) && (REQUEST_POST('ref_payout') > 0)) {
- // Update account's ref_payout for "must-confirm"
- ADD_SQL(sprintf("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
-WHERE `mails_confirmed` < %s", $REF, $REF));
- } elseif ((getConfig('ref_payout') > 0) && (REQUEST_POST('ref_payout') == 0)) {
- // Update account's ref_payout for "not-must-confirm"
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET `points`=`points`+`locked_points` WHERE `locked_points` > 0");
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET `locked_points`=0 WHERE `locked_points` > 0");
- }
- break;
- }
+ case 'settings':
+ $REF = bigintval(postRequestParameter('ref_payout'));
+ updateConfiguration(
+ array('allow_direct_pay', 'reg_points_mode', 'ref_payout'),
+ array(postRequestParameter('allow_direct_pay'), postRequestParameter('reg_points_mode'), $REF)
+ );
+ if ((getConfig('ref_payout') == '0') && (postRequestParameter('ref_payout') > 0)) {
+ // Update account's ref_payout for "must-confirm"
+ addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
+WHERE
+ `mails_confirmed` < %s", $REF, $REF));
+ } elseif ((getConfig('ref_payout') > 0) && (postRequestParameter('ref_payout') == '0')) {
+ // Update account's ref_payout for "not-must-confirm"
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `points`=`points`+`locked_points` WHERE `locked_points` > 0");
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `locked_points`=0 WHERE `locked_points` > 0");
+ }
+ break;
+ } // END - switch