]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-refback.php
Direct registration added, typo fixed, admin session on missing/failed login fixed...
[mailer.git] / inc / modules / member / what-refback.php
index db6fdcd5d239c32d36f3b8741099dadb184d3035..d827e2e2ec2c7ace63ccd9b96c9a8d3fb2b82c60 100644 (file)
@@ -59,8 +59,11 @@ ADD_DESCR("member", __FILE__);
 if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
        // Okay, has the user entered some values?
        if (isset($_POST['percents'])) {
+               // Revert german commta for testing
+               $percents = REVERT_COMMA($_POST['percents']);
+
                // Validate percents
-               if (($_POST['percents'] >= $_CONFIG['refback_min_percents']) || ($_POST['percents'] == 0)) && ($_POST['percents'] <= $_CONFIG['refback_max_percents'])) {
+               if ((($percents >= $_CONFIG['refback_min_perc']) || (round($percents) == 0)) && ($percents <= $_CONFIG['refback_max_perc'])) {
                        // Change ref-back for this direct id
                        $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
 
@@ -77,7 +80,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
                        }
                } else {
                        // 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']));
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, $_CONFIG['refback_min_perc'], $_CONFIG['refback_max_perc']));
                }
 
                // Insert line
@@ -88,6 +91,8 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
 
                // Translate comma
                $content['refback'] = TRANSLATE_COMMA($content['refback']);
+               $content['min']     = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0", true, 1);
+               $content['max']     = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0", true, 1);
 
                // Load form for editing
                LOAD_TEMPLATE("member_refback_edit", false, $content);