X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_points.php;h=113adcf5b15c81bb4061bae2efeacc59a9de9f9c;hb=ad30a667fd8abeb576c04026b62c2e8a29d86f52;hp=b8a62ba74702ebddcd371654021f89dd444a8380;hpb=93cd46744c402fa7b140e5f1d6b07281fc5558bf;p=mailer.git
diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php
index b8a62ba747..113adcf5b1 100644
--- a/inc/modules/admin/what-config_points.php
+++ b/inc/modules/admin/what-config_points.php
@@ -1,7 +1,7 @@
$value) {
- // Secure ID
+ foreach (postRequestParameter('level') as $id => $value) {
+ // Secure id
$id = bigintval($id);
// Revert german commata
- setRequestPostElement('percents', array($id => convertCommaToDot(postRequestElement('percents', $id))));
+ setPostRequestParameter('percents', array($id => convertCommaToDot(postRequestParameter('percents', $id))));
// Update entry
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refdepths` SET `level`='%s', `percents`='%s' WHERE `id`=%s LIMIT 1",
- array(bigintval($value), postRequestElement('percents', $id), $id), __FILE__, __LINE__);
+ array(bigintval($value), postRequestParameter('percents', $id), $id), __FILE__, __LINE__);
}
$message = getMessage('REF_DEPTHS_SAVED');
break;
case 'del':
- foreach (postRequestElement('id') as $id => $value) {
+ foreach (postRequestParameter('id') as $id => $value) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
@@ -109,22 +110,23 @@ if (isFormSent()) {
}
// Update cache file
- if (getExtensionVersion('cache') >= '0.1.2') {
+ // @TODO Rewrite this to a filter
+ if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
if ($GLOBALS['cache_instance']->loadCacheFile('refdepths')) $GLOBALS['cache_instance']->removeCacheFile();
- }
+ } // END - if
break;
case 'settings':
- $REF = bigintval(postRequestElement('ref_payout'));
+ $REF = bigintval(postRequestParameter('ref_payout'));
updateConfiguration(
array('allow_direct_pay', 'reg_points_mode', 'ref_payout'),
- array(postRequestElement('allow_direct_pay'), postRequestElement('reg_points_mode'), $REF)
+ array(postRequestParameter('allow_direct_pay'), postRequestParameter('reg_points_mode'), $REF)
);
- if ((getConfig('ref_payout') == 0) && (postRequestElement('ref_payout') > 0)) {
+ if ((getConfig('ref_payout') == '0') && (postRequestParameter('ref_payout') > 0)) {
// Update account's ref_payout for "must-confirm"
addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
WHERE `mails_confirmed` < %s", $REF, $REF));
- } elseif ((getConfig('ref_payout') > 0) && (postRequestElement('ref_payout') == 0)) {
+ } elseif ((getConfig('ref_payout') > 0) && (postRequestParameter('ref_payout') == '0')) {
// Update account's ref_payout for "not-must-confirm"
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `points`=`points`+`locked_points` WHERE `locked_points` > 0");
@@ -135,8 +137,8 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
if ((isSqlsValid()) && (isSqlsValid())) {
if (strpos($GLOBALS['sqls'][0], 'INSERT') > -1) {
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE level='%s' LIMIT 1",
- array(bigintval(postRequestElement('level'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level`='%s' LIMIT 1",
+ array(bigintval(postRequestParameter('level'))), __FILE__, __LINE__);
SQL_FREERESULT($result);
} // END - if
@@ -148,10 +150,10 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
$message = getMessage('SETTINGS_SAVED');
// Destroy config cache file here...
- rebuildCacheFile('config', 'config');
+ rebuildCache('config', 'config');
} else {
// Prepare failed-message
- $message = "{--SETTINGS_NOT_SAVED--}";
+ $message = '{--SETTINGS_NOT_SAVED--}';
}
// Remove SQL queries
@@ -163,7 +165,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// When do so...
loadTemplate('admin_settings_saved', false, $message);
}
-} elseif (getRequestElement('sub') == 'settings') {
+} elseif (getRequestParameter('sub') == 'settings') {
// Setup some settings like direct pay and so on
// Including new add-mode for one-time referal bonus
foreach (array('allow_direct_pay') as $entry) {
@@ -180,12 +182,12 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Load template
loadTemplate('admin_config_point_settings', false, $content);
-} elseif (getRequestElement('sub') == 'ref') {
+} elseif (getRequestParameter('sub') == 'ref') {
// 12 3 32 2 3 32 2 3 4 43 21
- if ((isPostRequestElementSet('del')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
+ if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Delete entries
$OUT = ''; $SW = 2;
- foreach (postRequestElement('sel') as $id => $value) {
+ foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$content = SQL_FETCHARRAY($result);
@@ -206,10 +208,10 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Load main template
loadTemplate('admin_points_del', false, $OUT);
- } elseif ((isPostRequestElementSet('edit')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
+ } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Edit entries
$OUT = ''; $SW = 2;
- foreach (postRequestElement('sel') as $id => $value) {
+ foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$content = SQL_FETCHARRAY($result);
@@ -258,7 +260,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Form for adding new referal levels
loadTemplate('admin_add_reflevel');
}
-} elseif (getRequestElement('sub') == 'points') {
+} elseif (getRequestParameter('sub') == 'points') {
// Load template
loadTemplate('admin_config_sub_points');
} else {