} if (empty($error_message)) { $next_step = 6; WriteConfigurationFile(); $process_title = "Prepare Database"; $message = ShowFormSQL(); } else { $next_step = 5; $process_title = "Application Setting"; $message = ShowForm(); } } elseif ($_POST['s'] == 6) { if (!empty($_POST['sql_select'])) { $next_step = 7; $process_title = "Prepare Database"; $message = ExecuteSQL($_POST['sql_select']); } else { $next_bt = ""; $process_title = "Installation Complete"; $message = Finish(); } } elseif ($_POST['s'] == 7) { $next_bt = ""; $process_title = "Installation Complete"; $message = Finish(); } include "_install.html.php"; /************************************* function *************************************/ function CheckServerReq()
function Step2B() { global $dbConn; // Connect to database. list($aDBInfo, $strError) = InitDatabase(); // Return any errors. if ($strError) { return $strError; } // Execute the upgrade SQL script. if (!$_SESSION["upgrade.{$aDBInfo['type']}"]) { if (ExecuteSQL("./includes/upgrade.{$aDBInfo['type']}")) { // Mark us as having executed the SQL script. $_SESSION["upgrade.{$aDBInfo['type']}"] = TRUE; } else { // Couldn't execute install.sql. return "Could not execute <code>upgrade.{$aDBInfo['type']}</code>.<br /><b>Database says</b>: " . $dbConn->geterror(); } } // Load the current configuration settings. $dbConn->query("SELECT content FROM configuration WHERE name='settings'"); list($aConfig) = $dbConn->getresult(); $aConfig = unserialize($aConfig); // Update settings. $aConfig['version'] = '0.16a'; // Sanitize it for the database. $strSettings = $dbConn->sanitize(serialize($aConfig)); $dbConn->query("DELETE FROM configuration WHERE name='settings'"); $dbConn->query("INSERT INTO configuration(name, content) VALUES('settings', '{$strSettings}')"); // What is the address of their forums? $strForums = substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], 'setup/index.php')) . 'index.php'; // Delete old cookies. $path = substr(pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME), 0, strpos(pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME), 'setup')); setcookie('activeuserid', '', time(), $path); setcookie('activepassword', '', time(), $path); setcookie('s', '', time(), $path); // Destroy the session. session_unset(); session_destroy(); // Tell the user it was a success. PrintHeader(); ?> <h1>Upgrade Successful!</h1> <p>Your forums have been successfully upgraded from V0.15a to V0.16a. <b>You should delete the <code>setup</code> directory in your forums' path before continuing, as it is now a security risk.</b></p> <p>You can visit your upgraded forums at this address:</p> <blockquote><a href="<?php echo $strForums; ?> "><?php echo htmlspecialchars("{$_SERVER['HTTP_HOST']}{$strForums}"); ?> </a></blockquote> <p>If you or your users have any problems while using your upgraded community, stop by the <a href="http://www.ovbb.org/forums/forumdisplay.php?forumid=3">OvBB Project Forums</a> to seek support.</p> <?php PrintFooter(); }
function Step2B() { // Connect to database. list($aDBInfo, $strError) = InitDatabase(); // Return any errors. if ($strError) { return $strError; } // Execute the installation SQL script. if (!$_SESSION["install.{$aDBInfo['type']}"]) { if (ExecuteSQL("./includes/install.{$aDBInfo['type']}")) { // Mark us as having executed the SQL script. $_SESSION["install.{$aDBInfo['type']}"] = TRUE; } else { // Couldn't execute install.sql. return "Could not execute <code>install.{$aDBInfo['type']}</code>.<br /><b>Database says</b>: " . $dbConn->geterror(); } } // Store the default configuration settings. $aSettings['avatars'] = array('aAvatars', 'avatars.inc.php'); $aSettings['posticons'] = array('aPostIcons', 'posticons.inc.php'); $aSettings['smilies'] = array('aSmilies', 'smilies.inc.php'); $aSettings['usergroups'] = array('aGroup', 'usergroups.inc.php'); $aSettings['skins'] = array('aSkins', 'skins.inc.php'); foreach ($aSettings as $strKey => $aSetting) { WriteSetting($strKey, $aSetting[0], $aSetting[1]); } // Tell the user it was a success. PrintHeader(); $_SESSION['step']++; echo 'Your database has been setup successfully. Click <a href="index.php">here</a> to continue the installation process.'; PrintFooter(); }