} elseif (!IS_MEMBER()) {
// User is not logged in
LOAD_URL("modules.php?module=index");
-} elseif (!EXT_IS_ACTIVE("refback")) {
- // Extension "refback" is not active
+} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
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
$percents = REVERT_COMMA($_POST['percents']);
// Validate percents
- if ((($percents >= $_CONFIG['refback_min_perc']) || (round($percents) == 0)) && ($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']);
}
} 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
// Translate comma
$content['refback'] = TRANSLATE_COMMA($content['refback']);
- $content['min'] = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0");
- $content['max'] = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0");
+ $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);