X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_payouts.php;h=2c5e9ee051f41c803982418b1593b7a1e48bd321;hb=0a69b4e17157eda9b6e1c70ff494292ccf8cbbd0;hp=ec39c96dd5c8cbf6ad6bc73f5ea10109685cc1c7;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git
diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php
index ec39c96dd5..2c5e9ee051 100644
--- a/inc/modules/admin/what-list_payouts.php
+++ b/inc/modules/admin/what-list_payouts.php
@@ -1,7 +1,7 @@
0)) {
- // Get task ID from database
+ if (!isGetRequestParameterSet(('task')) && (!empty($userid)) && ($userid > 0)) {
+ // Get task id from database
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `userid`=%s AND `task_type`='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
array(bigintval($userid)), __FILE__, __LINE__);
list($task) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (empty($task)) $task = 0;
+ if (empty($task)) $task = '0';
} elseif ((empty($userid)) || ($userid == '0')) {
- // Cannot obtain member ID!
+ // Cannot obtain member id!
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
} else {
- // Get task ID from URL
- $task = getRequestElement('task');
+ // Get task id from URL
+ $task = getRequestParameter('task');
}
if ((!empty($task)) && (!empty($userid)) && ($userid > 0)) {
// Load user's data
- $result = SQL_QUERY_ESC("SELECT `email`, `gender`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
- array(bigintval($userid)), __FILE__, __LINE__);
- list($email, $gender, $surname, $family) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ if (!fetchUserData($userid)) {
+ // Abort here because it is not valid!
+ debug_report_bug('No user account ' . $userid . ' found.');
+ } // END - if
- if ((getRequestElement('do') == 'accept') && (!empty($email))) {
+ if ((getRequestParameter('do') == 'accept') && (!empty(getUserData('email')))) {
// Ok, now we can output the form or execute accepting
if (isFormSent()) {
// 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(getRequestElement('pid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
list($ptype) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
@@ -97,7 +97,6 @@ LIMIT 1",
if (!empty($eurl)) {
// Ok, run URL...
- $eurl = compileCode($eurl);
switch ($eenc) {
case 'md5':
$fpass = md5($fpass);
@@ -133,10 +132,10 @@ LIMIT 1",
// Clear payout request
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='ACCEPTED' WHERE `id`=%s LIMIT 1",
- array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
// Send out mail
- $message = loadEmailTemplate('member_payout_accepted', postRequestElement('text'), $userid);
+ $message = loadEmailTemplate('member_payout_accepted', postRequestParameter('text'), $userid);
// Output message
if ($allow == 'Y') {
@@ -148,7 +147,7 @@ LIMIT 1",
}
// Finally send mail
- sendEmail($email, getMessage('PAYOUT_ACCEPTED_SUBJECT'), $message);
+ sendEmail(getUserData('email'), getMessage('PAYOUT_ACCEPTED_SUBJECT'), $message);
} else {
// Something goes wrong... :-(
$content = implode("
", $ret);
@@ -156,20 +155,20 @@ LIMIT 1",
}
} else {
// Cannot load payout id
- loadTemplate('admin_settings_saved', false, "