Even more constants/language strings rewritten, merge_array() now logs debug messages
[mailer.git] / inc / install-inc.php
index fb50b71..c24f262 100644 (file)
@@ -115,22 +115,22 @@ if ((isset($_GET['page']) && ($_GET['page'] == 5))) {
        // Okay, we have to check it
        if (!empty($_POST['smtp_user']) && (empty($_POST['smtp_host']))) {
                // Hostname not set
-               OUTPUT_HTML(INSTALL_SMTP_HOSTNAME_EMPTY."<br />");
+               OUTPUT_HTML(getMessage('INSTALL_SMTP_HOSTNAME_EMPTY')."<br />");
                $_GET['page'] = 3;
        } // END - if
        if ((empty($_POST['smtp_pass1'])) && (!empty($_POST['smtp_pass2']))) {
                // Password is empty
-               OUTPUT_HTML(INSTALL_SMTP_PASS1_EMPTY."<br />");
+               OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS1_EMPTY')."<br />");
                $_GET['page'] = 3;
        } // END - if
        if ((!empty($_POST['smtp_pass1'])) && (empty($_POST['smtp_pass2']))) {
                // Password repeat is empty
-               OUTPUT_HTML(INSTALL_SMTP_PASS2_EMPTY."<br />");
+               OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS2_EMPTY')."<br />");
                $_GET['page'] = 3;
        } // END - if
        if ($_POST['smtp_pass1'] != $_POST['smtp_pass1']) {
                // Passwords are not matching
-               OUTPUT_HTML(INSTALL_SMTP_PASS_MISMATCH."<br />");
+               OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS_MISMATCH')."<br />");
                $_GET['page'] = 3;
        } // END - if
 } // END - if
@@ -194,10 +194,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                define('__EMAIL_VALUE'  , $_POST['email']);
 
                // Use default SMTP data
-               $smtpHost  = SMTP_HOSTNAME;
-               $smtpUser  = SMTP_USER;
-               $smtpPass1 = SMTP_PASSWORD;
-               $smtpPass2 = SMTP_PASSWORD;
+               $smtpHost  = constant('SMTP_HOSTNAME');
+               $smtpUser  = constant('SMTP_USER');
+               $smtpPass1 = constant('SMTP_PASSWORD');
+               $smtpPass2 = constant('SMTP_PASSWORD');
 
                // Overwrite it with the data from sent (failed) form
                if (!empty($_POST['smtp_host'])) $smtpHost = $_POST['smtp_host'];
@@ -275,7 +275,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!YES!}</option>
       <option value=\"false\"");
-               if (!defined('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
+               if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!NO!}</option>
     </select>
   </td>
@@ -289,7 +289,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!YES!}</option>
       <option value=\"false\"");
-               if (!defined('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
+               if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!NO!}</option>
     </select>
   </td>
@@ -300,10 +300,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
   <td>
     <select name=\"blink\" size=\"1\" class=\"install_select\">
       <option value=\"true\"");
-               if (ENABLE_BACKLINK) OUTPUT_HTML(" selected=\"selected\"");
+               if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!YES!}</option>
       <option value=\"false\"");
-               if (!ENABLE_BACKLINK) OUTPUT_HTML(" selected=\"selected\"");
+               if (!isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">{!NO!}</option>
     </select>
   </td>
@@ -359,7 +359,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                                // Are some SQLs found?
                                                if (count($SQLs) == 0) {
                                                        // Abort here
-                                                       addFatalMessage(INSTALL_SQL_IMPORT_FAILED);
+                                                       addFatalMessage(getMessage('INSTALL_SQL_IMPORT_FAILED'));
                                                        return;
                                                } // END - if
 
@@ -376,8 +376,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                                } // END - foreach
 
                                                // Ok, all done. So we can write the config data to the php files
-                                               if ($_POST['spath'] != PATH) install_WriteData($_POST['spath']."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", $_POST['spath'], 0);
-                                               if ($_POST['burl']  != URL)  install_WriteData($_POST['spath']."inc/config.php", "HOST-URL", "define('URL', \"", "\");", $_POST['burl'], 0);
+                                               if ($_POST['spath'] != constant('PATH')) install_WriteData($_POST['spath']."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", $_POST['spath'], 0);
+                                               if ($_POST['burl']  != constant('URL'))  install_WriteData($_POST['spath']."inc/config.php", "HOST-URL", "define('URL', \"", "\");", $_POST['burl'], 0);
                                                install_WriteData($_POST['spath']."inc/config.php", "MAIN_TITLE", "define('MAIN_TITLE', \"", "\");", $_POST['title'], 0);
                                                install_WriteData($_POST['spath']."inc/config.php", "SLOGAN", "define('SLOGAN', \"", "\");", $_POST['slogan'], 0);
                                                install_WriteData($_POST['spath']."inc/config.php", "WEBMASTER", "define('WEBMASTER', \"", "\");", $_POST['email'], 0);
@@ -396,7 +396,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                                install_WriteData($_POST['spath']."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0);
                                        } else {
                                                // Installation area not found!
-                                               addFatalMessage(INSTALL_MISSING_DUMPS);
+                                               addFatalMessage(getMessage('INSTALL_MISSING_DUMPS'));
                                        }
                                } // END - if
                        } // END - if
@@ -430,7 +430,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                        LOAD_TEMPLATE("install_finished");
                } else {
                        // Something goes wrong during installation! :-(
-                       addFatalMessage(INSTALL_FINALIZER_FAILED);
+                       addFatalMessage(getMessage('INSTALL_FINALIZER_FAILED'));
                        LOAD_INC("inc/fatal_errors.php");
                }
                break;