* -------------------------------------------------------------------- *
* 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 *
$points = false;
// Is the mode set (payout only)
-if (!isGetRequestParameterSet('mode')) {
+if (!isGetRequestElementSet('do')) {
// Is there an id?
- if ((!empty($content['primera_nickname'])) && (!isGetRequestParameterSet('mode'))) {
- // Then use an other "mode"
- setGetRequestParameter('mode', 'list');
+ if ((!empty($content['primera_nickname'])) && (!isGetRequestElementSet('do'))) {
+ // Then list all entries
+ setGetRequestElement('do', 'list');
// And load all rows!
$result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{?_MYSQL_PREFIX?}_user_primera` WHERE `userid`=%s ORDER BY `primera_timestamp` DESC",
SQL_FREERESULT($result);
} else {
// Mode pay
- setGetRequestParameter('mode', 'pay');
+ setGetRequestElement('do', 'pay');
}
} // END - if
-if (getRequestParameter('mode') == 'pay') {
+if (getRequestElement('do') == 'pay') {
// Get total points and check if the user can request a payout
$points = getTotalPoints(getMemberId());
$content['points'] = $points;
} else {
// Invalid mode!
- displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestParameter('mode') . '%}');
+ displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestElement('do') . '%}');
return;
}
// Is the formular sent?
-if ((isFormSent()) && (isGetRequestParameterSet('mode'))) {
+if ((isFormSent()) && (isGetRequestElementSet('do'))) {
// Check input data depending on the mode and execute the requested mode
- switch (getRequestParameter('mode')) {
+ switch (getRequestElement('do')) {
case 'pay': // Payout this exchange -> Primus
// Is the user id and password set?
- if (!isPostRequestParameterSet('primera_nickname')) {
+ if (!isPostRequestElementSet('primera_nickname')) {
// Nothing entered in Primus nickname
displayMessage('{--MEMBER_PRIMERA_EMPTY_USERNAME--}');
- } elseif (!isPostRequestParameterSet('primera_password')) {
+ } elseif (!isPostRequestElementSet('primera_password')) {
// Nothing entered in Primera password
displayMessage('{--MEMBER_PRIMERA_EMPTY_PASSWORD--}');
- } elseif (!isPostRequestParameterSet('amount')) {
+ } elseif (!isPostRequestElementSet('amount')) {
// Nothing entered in amount
displayMessage('{--MEMBER_PRIMERA_EMPTY_AMOUNT--}');
- } elseif (postRequestParameter('amount') != bigintval(postRequestParameter('amount'))) {
+ } elseif (postRequestElement('amount') != bigintval(postRequestElement('amount'))) {
// Only numbers in amount!
displayMessage('{--MEMBER_PRIMERA_INVALID_AMOUNT--}');
- } elseif (postRequestParameter('amount') < getConfig('primera_min_payout')) {
+ } elseif (postRequestElement('amount') < getConfig('primera_min_payout')) {
// Not enougth entered!
displayMessage('{--MEMBER_PRIMERA_AMOUNT_SMALLER_MIN--}');
- } elseif (postRequestParameter('amount') > $points) {
+ } elseif (postRequestElement('amount') > $points) {
// Not enougth points left!
- displayMessage(sprintf(getMessage('MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestParameter('amount')), bigintval($points)));
+ displayMessage(sprintf(getMessage('MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points)));
} else {
// All is fine here so do the payout
- $success = executePrimeraPayout(postRequestParameter('primera_nickname'), md5(postRequestParameter('primera_password')), postRequestParameter('amount'));
+ $success = executePrimeraPayout(postRequestElement('primera_nickname'), md5(postRequestElement('primera_password')), postRequestElement('amount'));
if ($success) {
// Default is locked!
$locked = true;
- // Shall I 'pay' the referal points imidiately?
+ // Shall I 'pay' the referral points imidiately?
if (getConfig('ref_payout') == '0') {
// Yes, 'pay' it now
$locked = false;
} // END - if
// Subtract points from account and ignore return status
- subtractPoints('primera_payout', getMemberId(), postRequestParameter('amount'));
+ subtractPoints('primera_payout', getMemberId(), postRequestElement('amount'));
// Update primera nickname
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `primera_nickname`=%s WHERE `userid`=%s LIMIT 1",
- array(postRequestParameter('primera_nickname'), getMemberId()), __FILE__, __LINE__);
+ array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__);
// All done!
displayMessage('{--MEMBER_PRIMERA_PAYOUT_DONE--}');
break;
default: // Invalid mode!
- logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestParameter('mode')));
- displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestParameter('mode') . '%}');
+ logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestElement('do')));
+ displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestElement('do') . '%}');
return;
}
} // END - if
// Prepare mode for template name
-$mode = sprintf("member_primera_mode_%s", getRequestParameter('mode'));
+$mode = sprintf("member_primera_mode_%s", getRequestElement('do'));
// Load the template
loadTemplate($mode, false, $content);