Further fixes for installation phase and endless loop
[mailer.git] / inc / install-inc.php
index d4afebe..e8304bb 100644 (file)
@@ -47,7 +47,10 @@ if (!defined('__SECURITY')) {
 
 // Init variables
 $mysql = array();
-if ((isPostRequestElementSet('mysql')) && (is_array(postRequestElement('mysql')))) $mysql = postRequestElement('mysql');
+if ((isPostRequestElementSet('mysql')) && (is_array(postRequestElement('mysql')))) {
+       // Transfer 'mysql' array
+       $mysql = postRequestElement('mysql');
+} // END - if
 
 // Check if both passwords from SMTP are matching
 if ((isGetRequestElementSet('page') && (getRequestElement('page') == 5))) {
@@ -115,7 +118,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        $content['email']        = postRequestElement('email');
 
                        // Load template
-                       addTemplateToInstallContent('install_page2', false, $content);
+                       addTemplateToInstallContent('install_page2', $content);
                        break;
 
                case '3':
@@ -156,7 +159,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        $content['smtp_pass2'] = $smtpPass2;
 
                        // Load template
-                       addTemplateToInstallContent('install_page3', false, $content);
+                       addTemplateToInstallContent('install_page3', $content);
                        break;
 
                case '5': // Misc settings
@@ -167,13 +170,6 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        $content['slogan'] = postRequestElement('slogan');
                        $content['email']  = postRequestElement('email');
 
-                       // MySQL settings
-                       $content['mysql_host']   = $mysql['host'];
-                       $content['mysql_dbase']  = $mysql['dbase'];
-                       $content['mysql_prefix'] = $mysql['prefix'];
-                       $content['mysql_login']  = $mysql['login'];
-                       $content['table_type']   = $mysql['type'];
-
                        // SMTP settings
                        $content['smtp_host'] = postRequestElement('smtp_host');
                        $content['smtp_user'] = postRequestElement('smtp_user');
@@ -183,11 +179,11 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        $OUT = '';
                        foreach ($mysql as $key => $value) {
                                $OUT .= "    <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
-                       }
+                       } // END - foreach
                        $content['mysql_hidden'] = $OUT;
 
                        // Load template
-                       addTemplateToInstallContent('install_page5', false, $content);
+                       addTemplateToInstallContent('install_page5', $content);
                        break;
 
                case 'finalize': // Write captured data to files
@@ -268,7 +264,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                        $content['smtp_pass']  = postRequestElement('smtp_pass1');
 
                                        // Load template
-                                       addTemplateToInstallContent('install_fatal_errors', false, $content);
+                                       addTemplateToInstallContent('install_fatal_errors', $content);
                                } else {
                                        // Installation is done!
                                        redirectToUrl('install.php?page=finished');