************************************************************************/
// 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 />");
fputs($fp_tmp, $line);
}
fclose($fp_tmp);
+
// Finished writing tmp file
$done = true;
}
}
// 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);
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();
LOAD_URL($URL);
}
}
- elseif (mxchange_installed)
+ elseif (isBooleanConstantAndTrue('mxchange_installed'))
{
// Redirection after writing data... :-)
LOAD_TEMPLATE("install_finished");