require_once "includes/html_functions.php"; require_once CONFIG_FILE; // Connect to the database server and select database. $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix); $settings = $db->getSettings(); @($GLOBALS['panel_language'] = $settings['panel_language']); // Load languages. include_once "includes/lang.php"; ogpLang(); require_once "includes/view.php"; $view = new OGPView(); $view->setCharset(get_lang('lang_charset')); $view->setTimeZone($settings['time_zone']); if (isset($_GET['type']) && $_GET['type'] == 'cleared') { heading(true); $view->printView(true); } else { ogpHome(); $view->printView(); } function heading() { global $db, $view, $settings; if (!file_exists(CONFIG_FILE)) { print_failure(get_lang('failed_to_read_config')); $view->refresh("index.php"); return; } // Start Output Buffering if (!isset($_SESSION['users_login'])) { print_failure(get_lang('invalid_login_information'));
if (!preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $email)) { print_failure(get_lang('invalid_email_address')); echo "<p><a href='?step=2'>" . get_lang('back') . "</a></p>"; return; } //detect nighly builds, if not its SVN if (file_exists("version.txt")) { $file = "version.txt"; $contents = file($file); $nversion = implode($contents); $nversion2 = substr($nversion, 60); $nversion2 = trim($nversion2); $site_settings = array("title" => "Open Game Panel", "slogan" => "" . get_lang('slogan') . "", "ogp_version" => "{$nversion2}", "version_type" => "SVN", "theme" => "Revolution", "welcome_title" => "1", "welcome_title_message" => "<h0>" . get_lang('welcome_title_message') . "</h0>", "page_auto_refresh" => "1"); unlink('version.txt'); } else { $site_settings = array("title" => "Open Game Panel", "slogan" => "" . get_lang('slogan') . "", "ogp_version" => "0", "version_type" => "SVN", "theme" => "Revolution", "welcome_title" => "1", "welcome_title_message" => "<h0>" . get_lang('welcome_title_message') . "</h0>", "page_auto_refresh" => "1"); } $result = $db->setSettings($site_settings); $result = $db->addUser($username, $password1, "admin", $email); print_success(get_lang('setup_complete')); echo "<p class='note'>" . get_lang('remove_install_and_secure_config') . "</p>"; echo "<p class='note'><a href='index.php'>" . get_lang('go_to_panel') . "</a></p>"; echo "</td></tr></table>\n"; echo "</div>\n"; } } } } } $view->printView();