// Obtain payout type and other data
$result = SQL_QUERY_ESC("SELECT `payout_id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
+
+ // Load ptype (id)
list($ptype) = SQL_FETCHROW($result);
+
+ // Free result
SQL_FREERESULT($result);
if (!empty($ptype)) {
// Obtain data from payout type
- $result = SQL_QUERY_ESC("SELECT `from_account`, `from_pass`, `engine_url`, `engine_ret_ok`, `engine_ret_failed`, `pass_enc`, `allow_url`
+ $result = SQL_QUERY_ESC("SELECT
+ `from_account`, `from_pass`, `engine_url`, `engine_ret_ok`, `engine_ret_failed`, `pass_enc`, `allow_url`
FROM
`{?_MYSQL_PREFIX?}_payout_types`
WHERE
`id`=%s
LIMIT 1",
array(bigintval($ptype)), __FILE__, __LINE__);
- list($fuserid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
+
+ // Load data
+ $data = SQL_FETCHARRAY($result);
+
+ // Free result
SQL_FREERESULT($result);
- if (!empty($eurl)) {
+ if (!empty($data['engine_url'])) {
// Ok, run URL...
- switch ($eenc) {
+ switch ($data['pass_enc']) {
case 'md5':
- $fpass = md5($fpass);
+ $data['from_pass'] = md5($data['from_pass']);
$tpass = md5($tpass);
break;
case 'base64':
- $fpass = base64_encode($fpass);
+ $data['from_pass'] = base64_encode($data['from_pass']);
$tpass = base64_encode($tpass);
break;
}
// Transfer variables...
- $eval = '$url = "' . $eurl . '";';
$reason = encodeString(getMessage('PAYOUT_REASON_PAYOUT'), false);
- // Run code...
- // @TODO Do we need this time-consuming eval() here?
- eval($eval);
-
// Execute transfer
- $ret = sendGetRequest($url);
+ $ret = sendGetRequest($data['engine_url']);
} else {
// No URL to run
- $ret[0] = $eok;
+ $ret[0] = $data['engine_ret_ok'];
}
- if ($ret[0] == $eok) {
+ if ($ret[0] == $data['engine_ret_ok']) {
// Clear task
if ($task > 0) {
runFilterChain('solve_task', $task);
$message = loadEmailTemplate('member_payout_accepted', postRequestParameter('text'), $userid);
// Output message
- if ($allow == 'Y') {
+ if ($data['allow_url'] == 'Y') {
// Banner / Textlink request
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_BANNER_ACCEPTED_NOTIFIED'));
} else {