X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_payouts.php;h=ec39c96dd5c8cbf6ad6bc73f5ea10109685cc1c7;hb=eb301334eb0960dd060cc0d59e6021260a41f835;hp=2c3400b8290850450553d720479a0bd48305cc42;hpb=debaac55fafff501de5077f3672623c0d738a5b2;p=mailer.git
diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php
index 2c3400b829..ec39c96dd5 100644
--- a/inc/modules/admin/what-list_payouts.php
+++ b/inc/modules/admin/what-list_payouts.php
@@ -10,14 +10,14 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Auflistung der Auszahlungsanfragen *
* -------------------------------------------------------------------- *
- * $Revision:: 856 $ *
- * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009) $ *
+ * $Revision:: $ *
+ * $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
- * $Author:: stelzi $ *
+ * $Author:: $ *
* Needs to be in all Files and every File needs "svn propset *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -37,77 +37,77 @@
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
}
// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addMenuDescription('admin', __FILE__);
-if (REQUEST_ISSET_GET(('pid'))) {
+if (isGetRequestElementSet(('pid'))) {
// First let's get the member's ID
- $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1",
- array(REQUEST_GET('pid')), __FILE__, __LINE__);
- list($uid, $tuid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
+ $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
+ array(getRequestElement('pid')), __FILE__, __LINE__);
+ list($userid, $tuserid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Obtain some data
- if (!REQUEST_ISSET_GET(('task')) && (!empty($uid)) && ($uid > 0)) {
+ if (!isGetRequestElementSet(('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($uid)), __FILE__, __LINE__);
+ $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;
- } elseif ((empty($uid)) || ($uid == "0")) {
+ } elseif ((empty($userid)) || ($userid == '0')) {
// Cannot obtain member ID!
- LOAD_TEMPLATE("admin_settings_saved", false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
+ loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
} else {
// Get task ID from URL
- $task = REQUEST_GET('task');
+ $task = getRequestElement('task');
}
- if ((!empty($task)) && (!empty($uid)) && ($uid > 0)) {
+ 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($uid)), __FILE__, __LINE__);
+ $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);
- // Konstante bauen
- define('PAYOUT_USERDATA_VALUE', "".TRANSLATE_GENDER($gender)." ".$surname." ".$family."");
-
- if ((REQUEST_GET('do') == "accept") && (!empty($email))) {
+ if ((getRequestElement('do') == 'accept') && (!empty($email))) {
// Ok, now we can output the form or execute accepting
- if (IS_FORM_SENT()) {
+ 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(REQUEST_GET('pid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `payout_id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
+ array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
list($ptype) = SQL_FETCHROW($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 FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1",
- array(bigintval($ptype)), __FILE__, __LINE__);
- list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
+ $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);
SQL_FREERESULT($result);
if (!empty($eurl)) {
// Ok, run URL...
- $eurl = COMPILE_CODE($eurl);
- switch ($eenc)
- {
- case "md5":
- $fpass = md5($fpass);
- $tpass = md5($tpass);
- break;
-
- case "base64":
- $fpass = base64_encode($fpass);
- $tpass = base64_encode($tpass);
- break;
+ $eurl = compileCode($eurl);
+ switch ($eenc) {
+ case 'md5':
+ $fpass = md5($fpass);
+ $tpass = md5($tpass);
+ break;
+
+ case 'base64':
+ $fpass = base64_encode($fpass);
+ $tpass = base64_encode($tpass);
+ break;
}
// Transfer variables...
@@ -115,10 +115,11 @@ if (REQUEST_ISSET_GET(('pid'))) {
$reason = encodeString(getMessage('PAYOUT_REASON_PAYOUT'), false);
// Run code...
+ // @TODO Do we need this time-consuming eval() here?
eval($eval);
// Execute transfer
- $ret = GET_URL($URL);
+ $ret = sendGetRequest($URL);
} else {
// No URL to run
$ret[0] = $eok;
@@ -131,152 +132,163 @@ if (REQUEST_ISSET_GET(('pid'))) {
}
// Clear payout request
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='ACCEPTED' WHERE id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_payouts` SET `status`='ACCEPTED' WHERE `id`=%s LIMIT 1",
+ array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
// Send out mail
- $msg = LOAD_EMAIL_TEMPLATE("member_payout_accepted", REQUEST_POST('text'), $uid);
+ $message = loadEmailTemplate('member_payout_accepted', postRequestElement('text'), $userid);
// Output message
- if ($allow == "Y") {
+ if ($allow == 'Y') {
// Banner / Textlink request
- LOAD_TEMPLATE("admin_settings_saved", false, getMessage('PAYOUT_BANNER_ACCEPTED_NOTIFIED'));
+ loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_BANNER_ACCEPTED_NOTIFIED'));
} else {
// Normal request
- LOAD_TEMPLATE("admin_settings_saved", false, getMessage('PAYOUT_ACCEPTED_NOTIFIED'));
+ loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_ACCEPTED_NOTIFIED'));
}
// Finally send mail
- SEND_EMAIL($email, PAYOUT_ACCEPTED_SUBJECT, $msg);
+ sendEmail($email, getMessage('PAYOUT_ACCEPTED_SUBJECT'), $message);
} else {
// Something goes wrong... :-(
$content = implode("
", $ret);
- LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content);
+ loadTemplate('admin_payout_failed_transfer', false, $content);
}
} else {
// Cannot load payout id
- LOAD_TEMPLATE("admin_settings_saved", false, "