************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
//
function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0) {
- $done = false; $sneak++;
- if (file_exists($file)) {
+ // Initialize all and count up the "seak" value
+ $done = false;
+ $next = 0;
+ $sneak++;
+ if ((file_exists($file)) && (is_readable($file))) {
$search = "CFG: ".$comment;
$tmp = $file.".tmp";
- $fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<BR>");
+ $fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
if (is_resource($fp)) {
- $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<STRONG>WRITE:</STRONG> ".$tmp."<BR>");
+ $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<STRONG>WRITE:</STRONG> ".$tmp."<br />");
if (is_resource($fp_tmp)) {
while (!feof($fp)) {
$line = fgets ($fp, 10240);
fputs($fp_tmp, $line);
}
fclose($fp_tmp);
+
// Finished writing tmp file
$done = true;
}
}
}
} else {
- OUTPUT_HTML("<STRONG>404:</STRONG> ".$file."<BR>");
+ OUTPUT_HTML("<STRONG>404:</STRONG> ".$file."<br />");
}
}
}
// Is MXChange installed or no admin registered so far?
-if ((!mxchange_installed) || (!admin_registered))
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
{
// Set URL for FORM actions
define('__BURL_ACTION', $burl);
if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) {
OUTPUT_HTML("<SPAN class=\"install_fatal\">");
foreach ($FATAL as $key=>$err) {
- OUTPUT_HTML(" <STRONG>·</STRONG> ".FATAL_NO.($key + 1).": ".$err."<BR>\n");
+ OUTPUT_HTML(" <STRONG>·</STRONG> ".FATAL_NO.($key + 1).": ".$err."<br />");
}
- OUTPUT_HTML("</SPAN><BR>");
+ OUTPUT_HTML("</SPAN><br />");
}
define('__MYSQL_HOST' , $mysql['host']);
define('__MYSQL_DBASE' , $mysql['dbase']);
<TD>
<SELECT name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
<OPTION value=\"true\"");
- if (warn_no_pass) OUTPUT_HTML(" selected=\"selected\"");
+ if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
- if (!warn_no_pass) OUTPUT_HTML(" selected=\"selected\"");
+ if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".NO."</OPTION>
</SELECT>
</TD>
<TD>
<SELECT name=\"wfooter\" size=\"1\" class=\"install_select\">
<OPTION value=\"true\"");
- if (WRITE_FOOTER) OUTPUT_HTML(" selected=\"selected\"");
- OUTPUT_HTML(">".YES."</OPTION>
- <OPTION value=\"false\"");
- if (!WRITE_FOOTER) OUTPUT_HTML(" selected=\"selected\"");
- OUTPUT_HTML(">".NO."</OPTION>
- </SELECT>
- </TD>
-</TR>
-<TR><TD colspan=\"2\" height=\"10\" class=\"seperator\"> </TD></TR>
-<TR>
- <TD class=\"install\" align=\"right\">".LANG_FRAMESET_ACTIVE.": </TD>
- <TD>
- <SELECT name=\"frameset\" size=\"1\" class=\"install_select\">
- <OPTION value=\"true\"");
- if (frameset_active) OUTPUT_HTML(" selected=\"selected\"");
+ if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
- if (!frameset_active) OUTPUT_HTML(" selected=\"selected\"");
+ if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".NO."</OPTION>
</SELECT>
</TD>
break;
case "finalize": // Write captured data to files
- if ((!empty($_POST['finalize'])) && (!mxchange_installed)) {
+ if ((!empty($_POST['finalize'])) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
// You have submitted data then we have to reset the fatal messages
$FATAL = array(); $SQLs = array();
install_WriteData($_POST['spath']."inc/config.php", "NULLPASS-WARNING", "define ('warn_no_pass', ", ");", $_POST['warn_no_pass'], 0);
install_WriteData($_POST['spath']."inc/config.php", "WRITE-FOOTER", "define ('WRITE_FOOTER', ", ");", $_POST['wfooter'], 0);
install_WriteData($_POST['spath']."inc/config.php", "BACKLINK", "define ('ENABLE_BACKLINK', ", ");", $_POST['blink'], 0);
- // install_WriteData($_POST['spath']."inc/config.php", "FRAMESET", "define ('frameset_active', ", ");", $_POST['frameset'], 0);
// install_WriteData($_POST['spath']."inc/config.php", "OUTPUT-MODE", "define ('OUTPUT_MODE', \"", "\");", $_POST['omode'], 0);
install_WriteData($_POST['spath']."inc/config.php", "MYSQL-HOST", " 'host' => \"", "\",", $mysql['host'], 0);
install_WriteData($_POST['spath']."inc/config.php", "MYSQL-DBASE", " 'dbase' => \"", "\",", $mysql['dbase'], 0);
}
}
}
- if ((sizeof($FATAL) > 0) || ($FATAL[0] != ""))
+ if ((sizeof($FATAL) > 0) || ($FATAL[0] != ''))
{
$OUT = "";
foreach ($FATAL as $value)
LOAD_URL($URL);
}
}
- elseif (mxchange_installed)
+ elseif (isBooleanConstantAndTrue('mxchange_installed'))
{
// Redirection after writing data... :-)
LOAD_TEMPLATE("install_finished");