} } foreach ($_POST as $key => $val) { $_SESSION[$key] = $val; } } if (!isset($_SESSION['step'])) { $_SESSION['step'] = 1; } else { if ($_SESSION['step'] > count($_SESSION)) { $_SESSION['step'] = 1; } } if ($_SESSION['step'] == 1) { if (file_exists(CMS_FILE_SITE)) { $_SESSION = $set->grab(); $_SESSION['step'] = 1; } } $next = '<button tabindex="2" style="float: left;" id="nothing" class="btn btn-primary" type="submit" name="submit_n" value="' . ($_SESSION['step'] + 1) . '" title="Click once to go to the next page">Next</button>'; $previous = '<button tabindex="3" id="nothing" class="btn" type="submit" name="submit_p" value="' . ($_SESSION['step'] - 1) . '" title="Click once to go to the previous page">Previous</button>'; $over = '<button tabindex="4" style="float: right;" id="nothing" class="btn btn-danger" type="submit" name="start_over" title="Click once to start over">Start Over</button>'; $new_db = '<div class="buttons"><button tabindex="4" style="float: right;" id="nothing" class="btn btn-success" type="submit" name="new_db" title="Click once to create a new database">New Database</button></div><br />'; $finish = ''; switch ($_SESSION['step']) { case 1: if ($set->get('setup') !== false) { $mysqli = @new mysqli($_SESSION['db_host'], $_SESSION['db_root_username'], $_SESSION['db_root_password'], $_SESSION['db_database']); if ($mysqli->connect_error) { $msg = ''; } else {
function initial_setup() { $set = new file_array(CMS_FILE_SITE); $check = $set->get('recorded_root'); if ($check != $_SERVER['DOCUMENT_ROOT']) { if (!file_exists(CMS_ROOT . DIR_SEP . 'setup.php')) { copy(CMS_HIDDEN . DIR_SEP . 'php_script' . DIR_SEP . 'setup.php', CMS_ROOT . DIR_SEP . 'setup.php'); } header("Location: setup.php"); exit; } else { if (file_exists(CMS_ROOT . DIR_SEP . 'setup.php')) { unlink(CMS_ROOT . DIR_SEP . 'setup.php'); if (file_exists(CMS_FILE_INCLUDE)) { unlink(CMS_FILE_INCLUDE); } } } $arr = $set->grab(); foreach ($arr as $key => $val) { if (!defined(strtoupper($key))) { define(strtoupper($key), $val); } } }