X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-transfer.php;h=56a3b14ebe3b9d9ae82f99596d35f8b47ca2b18a;hb=8202991f32bfb2056e94a11746c0b5308fe4a273;hp=cd9e8a25edae03538bbafb524c4b5ea6df90eabf;hpb=bbadc7614e0bc296f49a8b9eff5418412dae441e;p=mailer.git diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index cd9e8a25ed..56a3b14ebe 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -53,8 +53,8 @@ if ((!isExtensionActive('transfer')) && (!isAdmin())) { // Check for mode in GET $mode = ''; -if (isGetRequestParameterSet('mode')) { - $mode = getRequestParameter('mode'); +if (isGetRequestElementSet('do')) { + $mode = getRequestElement('do'); } // END - if // Check for "faker" @@ -74,30 +74,30 @@ switch ($mode) { // Add new transfer if (getTransferCode() > 0) { // Check for code - $code = generateRandomCode(getTransferCode(), postRequestParameter('code_chk'), getMemberId(), $content['max_transferable']); - $valid_code = ($code == postRequestParameter('code')); + $code = generateRandomCode(getTransferCode(), postRequestElement('code_chk'), getMemberId(), $content['max_transferable']); + $valid_code = ($code == postRequestElement('code')); } else { // Zero length (= disabled) is always valid! $valid_code = true; } // Test password - $valid_pass = ($pass == generateHash(postRequestParameter('password'), $pass)); + $valid_pass = ($pass == generateHash(postRequestElement('password'), $pass)); // Test transfer amount - $valid_amount = ((isPostRequestParameterSet('points')) && (postRequestParameter('points') <= $content['max_transferable'])); + $valid_amount = ((isPostRequestElementSet('points')) && (postRequestElement('points') <= $content['max_transferable'])); // Test reason for transfer - $valid_reason = (isPostRequestParameterSet('reason')); + $valid_reason = (isPostRequestElementSet('reason')); // Test if a recipient is selected - $valid_recipient = isValidUserId(postRequestParameter('to_userid')); + $valid_recipient = isValidUserId(postRequestElement('to_userid')); // Re-check receivers and own personal data $result = SQL_QUERY_ESC("SELECT `userid`,`gender`,`surname`,`family`,`email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid` IN ('%s','%s') AND `status`='CONFIRMED' LIMIT 2", array( getMemberId(), - bigintval(postRequestParameter('to_userid')) + bigintval(postRequestElement('to_userid')) ), __FILE__, __LINE__); // Do we have two entries? @@ -122,7 +122,7 @@ switch ($mode) { // Default is userids for subject line $SENDER = getMemberId(); - $RECIPIENT = bigintval(postRequestParameter('to_userid')); + $RECIPIENT = bigintval(postRequestElement('to_userid')); // If nickname is installed we can set the nickname // @TODO Rewrite this to a filter @@ -131,44 +131,44 @@ switch ($mode) { $SENDER = $content['sender']['nickname']; } // END - if - if (($TEST_NICK_REC != postRequestParameter('to_userid')) && (!empty($TEST_NICK_REC))) { + if (($TEST_NICK_REC != postRequestElement('to_userid')) && (!empty($TEST_NICK_REC))) { $RECIPIENT = $content['recipient']['nickname']; } // END - if } // END - if // Remember transfer reason - $content['reason'] = postRequestParameter('reason'); + $content['reason'] = postRequestElement('reason'); // Generate tranafer id - $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getMemberId(), postRequestParameter('reason'))); + $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getMemberId(), postRequestElement('reason'))); // Add entries to both tables SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`,`from_userid`,`points`,`reason`,`time_trans`,`trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)", array( - bigintval(postRequestParameter('to_userid')), + bigintval(postRequestElement('to_userid')), getMemberId(), - bigintval(postRequestParameter('points')), - postRequestParameter('reason'), + bigintval(postRequestElement('points')), + postRequestElement('reason'), $content['trans_id'] ), __FILE__, __LINE__); SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`,`to_userid`,`points`,`reason`,`time_trans`,`trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)", array( getMemberId(), - bigintval(postRequestParameter('to_userid')), - bigintval(postRequestParameter('points')), - postRequestParameter('reason'), + bigintval(postRequestElement('to_userid')), + bigintval(postRequestElement('points')), + postRequestElement('reason'), $content['trans_id'] ), __FILE__, __LINE__); // Add points to account *directly* ... - initReferalSystem(); - addPointsThroughReferalSystem('transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points'))); + initReferralSystem(); + addPointsThroughReferralSystem('transfer', bigintval(postRequestElement('to_userid')), bigintval(postRequestElement('points'))); // ... and add it to current user's used points and ignore return status - subtractPoints('transfer', getMemberId(), postRequestParameter('points')); + subtractPoints('transfer', getMemberId(), postRequestElement('points')); // First send email to recipient - $message = loadEmailTemplate('member_transfer_recipient', $content, postRequestParameter('to_userid')); + $message = loadEmailTemplate('member_transfer_recipient', $content, postRequestElement('to_userid')); sendEmail($content['recipient']['userid'], '{--TRANSFER_MEMBER_RECIPIENT_SUBJECT--}' . ': ' . $SENDER, $message); // Second send email to sender @@ -184,27 +184,27 @@ switch ($mode) { } elseif ($valid_code === false) { // Invalid Touring code! loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_CODE--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } elseif ($valid_pass === false) { // Wrong password entered loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_PASSWORD--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } elseif ($valid_amount === false) { // Too much points entered loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_POINTS--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } elseif ($valid_reason === false) { // No transfer reason entered loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_REASON--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } elseif ($valid_recipient === false) { // No recipient selected loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_RECIPIENT--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } elseif ($valid_data === false) { // No recipient/sender selected loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_DATA--}'); - unsetPostRequestParameter('ok'); + unsetPostRequestElement('ok'); } // Free result @@ -222,10 +222,10 @@ switch ($mode) { '; while (list($userid) = SQL_FETCHROW($result)) { $OUT .= ' '; } // END - while $OUT .= ''; $content['to_disabled'] = ''; @@ -264,10 +264,10 @@ switch ($mode) { $content['reason'] = ''; // Transfer maybe already entered valued' - if (isPostRequestParameterSet('ok')) { + if (isPostRequestElementSet('ok')) { // Get values from form - $content['points'] = postRequestParameter('points'); - $content['reason'] = postRequestParameter('reason'); + $content['points'] = postRequestElement('points'); + $content['reason'] = postRequestElement('reason'); } // END - if // Output form @@ -281,14 +281,14 @@ switch ($mode) { $nothingMessage = ''; switch ($mode) { case 'list_in': - $sql = 'SELECT `trans_id`,`from_userid` AS party_userid, `points`,`reason`,`time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}'; + $sql = 'SELECT `trans_id`,`from_userid` AS party_userid,`points`,`reason`,`time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}'; $nothingMessage = '{--TRANSFER_NO_INCOMING_TRANSFERS--}'; $content['balance'] = '{--TRANSFER_TOTAL_INCOMING--}'; $content['title'] = '{--TRANSFER_LIST_INCOMING--}'; break; case 'list_out': - $sql = 'SELECT `trans_id`,`to_userid` AS party_userid, `points`,`reason`,`time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}'; + $sql = 'SELECT `trans_id`,`to_userid` AS party_userid,`points`,`reason`,`time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}'; $nothingMessage = '{--TRANSFER_NO_OUTGOING_TRANSFERS--}'; $content['balance'] = '{--TRANSFER_TOTAL_OUTGOING--}'; $content['title'] = '{--TRANSFER_LIST_OUTGOING--}'; @@ -443,7 +443,7 @@ INDEX (`party_userid`) $totalIn = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', true); $content['in_link'] = $totalIn; if ($totalIn > 0) { - $content['in_link'] = '' . $totalIn . ''; + $content['in_link'] = '' . $totalIn . ''; } // END - if // Check outgoing transfers @@ -451,7 +451,7 @@ INDEX (`party_userid`) $content['out_link'] = $totalOut; if ($totalOut > 0) { - $content['out_link'] = '' . $totalOut . ''; + $content['out_link'] = '' . $totalOut . ''; } // END - if // Add all to total amount @@ -460,13 +460,13 @@ INDEX (`party_userid`) // Total transactions $content['all_link'] = $total; if ($total > 0) { - $content['all_link'] = '{%pipe,translateComma=' . $total . '%}'; + $content['all_link'] = '{%pipe,translateComma=' . $total . '%}'; } // END - if if (isFormSent()) { // Save settings SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `opt_in`='%s' WHERE `userid`=%s LIMIT 1", - array(postRequestParameter('opt_in'), getMemberId()), __FILE__, __LINE__); + array(postRequestElement('opt_in'), getMemberId()), __FILE__, __LINE__); // "Settings saved..." displayMessage('{--SETTINGS_SAVED--}'); @@ -483,7 +483,7 @@ INDEX (`party_userid`) // Set 'new transfer' link according to above option switch (getUserData('opt_in')) { case 'Y': - $content['new_link'] = '{--TRANSFER_NOW_LINK--}'; + $content['new_link'] = '{--TRANSFER_NOW_LINK--}'; break; case 'N':