]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-refback.php
Several bugfixes, getMessage() introduced
[mailer.git] / inc / modules / member / what-refback.php
index 10ab231b58b6e7ef5f3c08bbfc9dcaef5b42b138..9563cf746ecef399bd91d81f9f14fff3b4e5ba1c 100644 (file)
@@ -39,13 +39,12 @@ if (!defined('__SECURITY')) {
        // User is not logged in
        LOAD_URL("modules.php?module=index");
 } elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
-       // Extension "refback" is not active
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "refback");
        return;
 }
 
 // Is the refback system enabled?
-if ($_CONFIG['refback_enabled'] == "N") {
+if (getConfig('refback_enabled') == "N") {
        // Output message
        LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED);
        // Abort here
@@ -59,8 +58,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_perc']) || ($_POST['percents'] == 0)) && ($_POST['percents'] <= $_CONFIG['refback_max_perc'])) {
+               if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
                        // Change ref-back for this direct id
                        $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
 
@@ -77,7 +79,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_perc'], $_CONFIG['refback_max_perc']));
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, getConfig('refback_min_perc'), getConfig('refback_max_perc')));
                }
 
                // Insert line
@@ -88,8 +90,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);
+               $content['min']     = TRANSLATE_COMMA(getConfig('refback_min_perc').".0");
+               $content['max']     = TRANSLATE_COMMA(getConfig('refback_max_perc').".0");
 
                // Load form for editing
                LOAD_TEMPLATE("member_refback_edit", false, $content);
@@ -140,7 +142,7 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Remember the content
                $content['counter']  = TRANSLATE_COMMA($counter);
-               $content['percents'] = TRANSLATE_COMMA($content['percents'], true, 1);
+               $content['percents'] = TRANSLATE_COMMA($content['percents']);
                $content['rows']     = $rows;
 
                // Load level template