function ImportDataFile($szFileName) { global $content, $totaldbdefs; // Lets read the table definitions :) $handle = @fopen($szFileName, "r"); if ($handle === false) { RevertOneStep($content['INSTALL_STEP'] - 1, GetAndReplaceLangStr($content['LN_INSTALL_ERRORREADINGDBFILE'], $szFileName)); } else { while (!feof($handle)) { $buffer = fgets($handle, 4096); $pos = strpos($buffer, "--"); if ($pos === false) { $totaldbdefs .= $buffer; } else { if ($pos > 2 && strlen(trim($buffer)) > 1) { $totaldbdefs .= $buffer; } } } fclose($handle); } }
function LoadDataFile($szFileName) { global $content; // Lets read the table definitions :) $buffer = ""; $handle = @fopen($szFileName, "r"); if ($handle === false) { RevertOneStep($content['INSTALL_STEP'] - 1, GetAndReplaceLangStr($content['LN_INSTALL_FAILEDREADINGFILE'], $szFileName)); } else { while (!feof($handle)) { $buffer .= fgets($handle, 4096); } fclose($handle); } // return file buffer! return $buffer; }
$_SESSION['MAIN_Username'] = DB_RemoveBadChars($_POST['username']); } else { RevertOneStep($content['CONVERT_STEP'] - 1, $content['LN_INSTALL_MISSINGUSERNAME']); } if (isset($_POST['password1'])) { $_SESSION['MAIN_Password1'] = DB_RemoveBadChars($_POST['password1']); } else { $_SESSION['MAIN_Password1'] = ""; } if (isset($_POST['password2'])) { $_SESSION['MAIN_Password2'] = DB_RemoveBadChars($_POST['password2']); } else { $_SESSION['MAIN_Password2'] = ""; } if (strlen($_SESSION['MAIN_Password1']) < 4 || $_SESSION['MAIN_Password1'] != $_SESSION['MAIN_Password2']) { RevertOneStep($content['CONVERT_STEP'] - 1, $content['LN_INSTALL_PASSWORDNOTMATCH']); } // --- Now execute all commands ini_set('error_reporting', E_WARNING); // Enable Warnings! // Establish DB Connection DB_Connect(); // Everything is fine, lets go create the User! CreateUserName($_SESSION['MAIN_Username'], $_SESSION['MAIN_Password1'], 1); // Show User success! $content['MAIN_Username'] = $_SESSION['MAIN_Username']; $content['createduser'] = true; } else { if ($content['CONVERT_STEP'] == 6) { // To be on the save side, establish DB Connection DB_Connect();