$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
$search = "CFG: ".$comment;
$tmp = $file.".tmp";
$fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
$search = "CFG: ".$comment;
$tmp = $file.".tmp";
$fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
// Auto-detect URL
$burl = "http://".$SERVER_NAME.$_SERVER['PHP_SELF'];
$burl = substr($burl, 0, strpos($burl, "install.php"));
// Auto-detect URL
$burl = "http://".$SERVER_NAME.$_SERVER['PHP_SELF'];
$burl = substr($burl, 0, strpos($burl, "install.php"));
if ((empty($_POST['smtp_pass1'])) && (!empty($_POST['smtp_pass2']))) {
// Password is empty
OUTPUT_HTML(INSTALL_SMTP_PASS1_EMPTY."<br />");
$_GET['page'] = 3;
if ((empty($_POST['smtp_pass1'])) && (!empty($_POST['smtp_pass2']))) {
// Password is empty
OUTPUT_HTML(INSTALL_SMTP_PASS1_EMPTY."<br />");
$_GET['page'] = 3;
if ((!empty($_POST['smtp_pass1'])) && (empty($_POST['smtp_pass2']))) {
// Password repeat is empty
OUTPUT_HTML(INSTALL_SMTP_PASS2_EMPTY."<br />");
$_GET['page'] = 3;
if ((!empty($_POST['smtp_pass1'])) && (empty($_POST['smtp_pass2']))) {
// Password repeat is empty
OUTPUT_HTML(INSTALL_SMTP_PASS2_EMPTY."<br />");
$_GET['page'] = 3;
if ($_POST['smtp_pass1'] != $_POST['smtp_pass1']) {
// Passwords are not matching
OUTPUT_HTML(INSTALL_SMTP_PASS_MISMATCH."<br />");
$_GET['page'] = 3;
if ($_POST['smtp_pass1'] != $_POST['smtp_pass1']) {
// Passwords are not matching
OUTPUT_HTML(INSTALL_SMTP_PASS_MISMATCH."<br />");
$_GET['page'] = 3;
// Is MXChange installed or no admin registered so far?
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
// Is MXChange installed or no admin registered so far?
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange_";
if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) {
OUTPUT_HTML("<SPAN class=\"install_fatal\">");
if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange_";
if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) {
OUTPUT_HTML("<SPAN class=\"install_fatal\">");
OUTPUT_HTML(" <STRONG>·</STRONG> ".FATAL_NO.($key + 1).": ".$err."<br />");
}
OUTPUT_HTML("</SPAN><br />");
OUTPUT_HTML(" <STRONG>·</STRONG> ".FATAL_NO.($key + 1).": ".$err."<br />");
}
OUTPUT_HTML("</SPAN><br />");
if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\"> </TD></TR>
<TR>
<TD colspan=\"2\" align=\"center\">");
<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\"> </TD></TR>
<TR>
<TD colspan=\"2\" align=\"center\">");
OUTPUT_HTML(" <INPUT type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\">");
}
OUTPUT_HTML(" <INPUT type=\"hidden\" name=\"spath\" value=\"".__SPATH_VALUE."\">
OUTPUT_HTML(" <INPUT type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\">");
}
OUTPUT_HTML(" <INPUT type=\"hidden\" name=\"spath\" value=\"".__SPATH_VALUE."\">
$db = SQL_SELECT_DB($mysql['dbase'], $link, __FILE__, __LINE__);
if ($db) {
// Automatically run install.sql
$db = SQL_SELECT_DB($mysql['dbase'], $link, __FILE__, __LINE__);
if ($db) {
// Automatically run install.sql
// Both exists so import them
foreach (array("tables.sql", "menu-".GET_LANGUAGE().".sql") as $dump) {
// Should be save here because file_exists() is there but we check it again. :)
$file = secureString($_POST['spath']) . "install/" . $dump;
// Both exists so import them
foreach (array("tables.sql", "menu-".GET_LANGUAGE().".sql") as $dump) {
// Should be save here because file_exists() is there but we check it again. :)
$file = secureString($_POST['spath']) . "install/" . $dump;
$sql = str_replace("\n\n", "\n", $sql);
// And split it up against ;\n ...
$sql = str_replace("\n\n", "\n", $sql);
// And split it up against ;\n ...
// Now run all queries through and try to keep out empty or comment queries
foreach ($SQLs as $sql) {
// Now run all queries through and try to keep out empty or comment queries
foreach ($SQLs as $sql) {
if ((!empty($sql)) && (substr($sql, 0, 2) != "--") && (substr($sql, 0, 1) != "#")) {
// Then run it!
SQL_QUERY($sql, __FILE__, __LINE__);
if ((!empty($sql)) && (substr($sql, 0, 2) != "--") && (substr($sql, 0, 1) != "#")) {
// Then run it!
SQL_QUERY($sql, __FILE__, __LINE__);
// 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);
// 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);
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);
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);
define('__MYSQL_DATA' , $OUT);
define('__SPATH_VALUE' , $_POST['spath']);
define('__BURL_VALUE' , $_POST['burl']);
define('__MYSQL_DATA' , $OUT);
define('__SPATH_VALUE' , $_POST['spath']);
define('__BURL_VALUE' , $_POST['burl']);
// Something goes wrong during installation! :-(
ADD_FATAL(INSTALL_FINALIZER_FAILED);
include ("inc/fatal_errors.php");
// Something goes wrong during installation! :-(
ADD_FATAL(INSTALL_FINALIZER_FAILED);
include ("inc/fatal_errors.php");