define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "494");
+define('CURR_SVN_REVISION', "495");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
define('MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE', "Prozentsatz ungültig. 0 bis 100 sind gültige Werte.");
define('MEMBER_REFBACK_ERROR_ID_MISMATCH', "Die ausgewählte Ref-Back ID gehört Ihnen nicht.");
define('MEMBER_REFBACK_ERROR_NOT_UPDATED', "Ref-Back nicht aktualisiert.");
+define('MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS', "Sie können nur mindestens <u>%s%</> und maximal <u>%s%</u> einstellen!");
define('MEMBER_REFBACK_DONE', "Ref-Back eingestellt. Dieser ist ab jetzt gültig.");
// Subject lines
if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
// Okay, has the user entered some values?
if (isset($_POST['percents'])) {
- // Change ref-back for this direct id
- $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
-
- // Check status
- if (isset($status['ok'])) {
- // No message found
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE);
- } elseif (isset($status['message'])) {
- // Something went wrong with error message
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message']));
+ // Validate percents
+ if (($_POST['percents'] >= $_CONFIG['refback_min_percents']) || ($_POST['percents'] == 0)) && ($_POST['percents'] <= $_CONFIG['refback_max_percents'])) {
+ // Change ref-back for this direct id
+ $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
+
+ // Check status
+ if (isset($status['ok'])) {
+ // No message found
+ LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE);
+ } elseif (isset($status['message'])) {
+ // Something went wrong with error message
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message']));
+ } else {
+ // No message found
+ LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE);
+ }
} else {
- // No message found
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE);
+ // Percents out-of-bounds ;-)
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, $_CONFIG['refback_min_percents'], $_CONFIG['refback_max_percents']));
}
// Insert line
// Remember the content
$content['counter'] = TRANSLATE_COMMA($counter);
- $content['percents'] = TRANSLATE_COMMA($content['percents']);
+ $content['percents'] = TRANSLATE_COMMA($content['percents'], true, 1);
$content['rows'] = $rows;
// Load level template