More rewrites of constants and fix for loading mass-included scripts by GET_DIR_AS_AR...
[mailer.git] / ref.php
diff --git a/ref.php b/ref.php
index 918e2ef68de13d86b8d7c92c00d8cdc4cd8d5d27..c26ce8bfde155334eabeb6ad31918cb9b0cad3be 100644 (file)
--- a/ref.php
+++ b/ref.php
 require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
-global $what, $action;
-$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
+$GLOBALS['what'] = "";
+$GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "ref"; $CSS = -1;
+$GLOBALS['module'] = "ref";
+$GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Redirect only to registration page when this script is installed
-if (isBooleanConstantAndTrue('mxchange_installed')) {
+if (isInstalled()) {
        // Base URL for redirection
        switch (getConfig('refid_target'))
        {
        case "register":
-               $URL = "modules.php?module=index&what=register&refid=";
+               $URL = "modules.php?module=index&what=register&refid=";
                break;
 
        case "index":
@@ -59,8 +60,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        }
 
        // Get referal ID from ref or refid variable
-       if (!empty($_GET['ref']))        $ref = secureString($_GET['ref']);
-        elseif (!empty($_GET['refid'])) $ref = secureString($_GET['refid']);
+       if (REQUEST_ISSET_GET(('ref')))        $ref = secureString(REQUEST_GET('ref'));
+        elseif (REQUEST_ISSET_GET(('refid'))) $ref = secureString(REQUEST_GET('refid'));
 
        if (!empty($ref)) {
                // Test if nickname or numeric id