X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Finstall-inc.php;h=5768d4807b22dc8bc1490d9b2e3e492afa492102;hb=3a9723e159b1d9621c8a62927c9b911d6b484286;hp=552956e9a6683588bf8b98c332e2bce73c2f8e79;hpb=dc1d66c49b8cb1e4fb8056d46b9c7e3fecd0ffdd;p=mailer.git
diff --git a/inc/install-inc.php b/inc/install-inc.php
index 552956e9a6..5768d4807b 100644
--- a/inc/install-inc.php
+++ b/inc/install-inc.php
@@ -71,15 +71,15 @@ function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0)
} else {
$next++;
}
- }
+ } // END - if
//* DEBUG: */ echo "WRITE: ".htmlentities($line)."
\n";
fputs($fp_tmp, $line);
- }
+ } // END - while
fclose($fp_tmp);
// Finished writing tmp file
$done = true;
- }
+ } // END - if
// Close source directory
fclose($fp);
@@ -91,7 +91,7 @@ function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0)
} else {
OUTPUT_HTML("TMP: UNDONE!");
}
- }
+ } // END - if
} else {
OUTPUT_HTML("404: ".$file."
");
}
@@ -117,23 +117,23 @@ if ((isset($_GET['page']) && ($_GET['page'] == 5))) {
// Hostname not set
OUTPUT_HTML(INSTALL_SMTP_HOSTNAME_EMPTY."
");
$_GET['page'] = 3;
- }
+ } // END - if
if ((empty($_POST['smtp_pass1'])) && (!empty($_POST['smtp_pass2']))) {
// Password is empty
OUTPUT_HTML(INSTALL_SMTP_PASS1_EMPTY."
");
$_GET['page'] = 3;
- }
+ } // END - if
if ((!empty($_POST['smtp_pass1'])) && (empty($_POST['smtp_pass2']))) {
// Password repeat is empty
OUTPUT_HTML(INSTALL_SMTP_PASS2_EMPTY."
");
$_GET['page'] = 3;
- }
+ } // END - if
if ($_POST['smtp_pass1'] != $_POST['smtp_pass1']) {
// Passwords are not matching
OUTPUT_HTML(INSTALL_SMTP_PASS_MISMATCH."
");
$_GET['page'] = 3;
- }
-}
+ } // END - if
+} // END - if
// Is MXChange installed or no admin registered so far?
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
@@ -356,16 +356,16 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
$sql = str_replace("\n\n", "\n", $sql);
// And split it up against ;\n ...
- $SQLs = array_merge($SQLs, explode(";\n", $sql));
- }
- }
+ $SQLs = merge_array($SQLs, explode(";\n", $sql));
+ } // END - if
+ } // END - foreach
// Are some SQLs found?
if (count($SQLs) == 0) {
// Abort here
ADD_FATAL(INSTALL_SQL_IMPORT_FAILED);
return;
- }
+ } // END - if
// Now run all queries through and try to keep out empty or comment queries
foreach ($SQLs as $sql) {
@@ -376,8 +376,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
if ((!empty($sql)) && (substr($sql, 0, 2) != "--") && (substr($sql, 0, 1) != "#")) {
// Then run it!
SQL_QUERY($sql, __FILE__, __LINE__);
- }
- }
+ } // END - if
+ } // 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);
@@ -398,30 +398,23 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
install_WriteData($_POST['spath']."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", $_POST['smtp_user'], 0);
install_WriteData($_POST['spath']."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", $_POST['smtp_pass'], 0);
install_WriteData($_POST['spath']."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0);
-
- // Close the link
- SQL_CLOSE($link, __FILE__, __LINE__);
- }
- else
- {
+ } else {
// Installation area not found!
ADD_FATAL(INSTALL_MISSING_DUMPS);
}
- }
- }
- if ((sizeof($FATAL) > 0) || ($FATAL[0] != ''))
- {
+ } // END - if
+ } // END - if
+
+ if ((sizeof($FATAL) > 0) || ((isset($FATAL[0])) && ($FATAL[0] != ''))) {
$OUT = "";
- foreach ($FATAL as $value)
- {
+ foreach ($FATAL as $value) {
$OUT .= "