More rewrites of constants and fix for loading mass-included scripts by GET_DIR_AS_AR...
[mailer.git] / inc / install-inc.php
index a6fbd91f2b21ac8c7951b2bc015e29537ec90989..065726a9d276ca44e3bd7bc80caefb4e1059c565 100644 (file)
@@ -74,7 +74,7 @@ if ((REQUEST_ISSET_GET(('page')) && (REQUEST_GET('page') == 5))) {
 } // END - if
 
 // Is MXChange installed or no admin registered so far?
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
+if ((!isInstalled()) || (!isAdminRegistered()))
 {
        // Set URL for FORM actions
        define('__BURL_ACTION', constant('URL'));
@@ -99,7 +99,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange_";
                if (getTotalFatalErrors() > 0) {
                        OUTPUT_HTML("<span class=\"install_fatal\">");
-                       foreach ($FATAL as $key => $err) {
+                       foreach (getFatalArray() as $key => $err) {
                                OUTPUT_HTML("  <strong>&middot;</strong>&nbsp;{--FATAL_NO--}".($key + 1).":&nbsp;".$err."<br />");
                        }
                        OUTPUT_HTML("</span><br />");
@@ -264,7 +264,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                break;
 
        case "finalize": // Write captured data to files
-               if ((REQUEST_ISSET_POST(('finalize'))) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
+               if ((REQUEST_ISSET_POST(('finalize'))) && (!isInstalled())) {
                        // You have submitted data then we have to reset the fatal messages
                        $SQLs = array();
 
@@ -281,10 +281,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                                        $FQFN = secureString(REQUEST_POST('spath')) . "install/" . $dump;
                                                        if (FILE_READABLE($FQFN)) {
                                                                // Read the file
-                                                               $SQLs = READ_FILE($FQFN, true);
+                                                               $fileContent = READ_FILE($FQFN, true);
 
                                                                // And split it up against ;\n ...
-                                                               $SQLs = merge_array($SQLs, explode(";\n", $sql));
+                                                               $SQLs = merge_array($SQLs, explode(";\n", $fileContent));
                                                        } else {
                                                                // Not readable!
                                                                debug_report_bug(sprintf("SQL dump %s is not readable!", $dump));
@@ -338,7 +338,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
 
                        if (getTotalFatalErrors() > 0) {
                                $OUT = "";
-                               foreach ($FATAL as $value) {
+                               foreach (getFatalArray() as $value) {
                                        $OUT .= "    <li>".$value."</li>\n";
                                } // END foreach
                                define('__FATAL_ERROR_LI', $OUT);
@@ -360,7 +360,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                // Installation is done!
                                LOAD_URL("install.php?page=finalize");
                        }
-               } elseif (isBooleanConstantAndTrue('mxchange_installed')) {
+               } elseif (isInstalled()) {
                        // Redirection after writing data... :-)
                        LOAD_TEMPLATE("install_finished");
                } else {