} else { if ($mime_types[$extension] != $each['type']) { die('Prevented an unwanted file upload attempt!'); } } } unset($file_info, $extension); } } unset($mime_types); } } $defender = new defender(); // Set admin login procedures Authenticate::setAdminLogin(); $defender->debug_notice = FALSE; // turn this off after beta. $defender->sniff_token(); $dynamic = new dynamics(); $dynamic->boot(); $fusion_page_head_tags =& \PHPFusion\OutputHandler::$pageHeadTags; $fusion_page_footer_tags =& \PHPFusion\OutputHandler::$pageFooterTags; $fusion_jquery_tags =& \PHPFusion\OutputHandler::$jqueryTags; // Set theme using $_GET as well. // Set theme if ($userdata['user_level'] == USER_LEVEL_SUPER_ADMIN && isset($_GET['themes']) && theme_exists($_GET['themes'])) { $newUserTheme = array("user_id" => $userdata['user_id'], "user_theme" => stripinput($_GET['themes'])); dbquery_insert(DB_USERS, $newUserTheme, "update"); redirect(clean_request("", array("themes"), FALSE)); } set_theme(empty($userdata['user_theme']) ? fusion_get_settings("theme") : $userdata['user_theme']);
dbconnect($db_host, $db_user, $db_pass, $db_name, FALSE); } $settings = fusion_get_settings(); if ($settings) { $userdata = Authenticate::validateAuthUser(); if (INSTALLATION_STEP != 8 and dbresult(dbquery('SELECT exists(SELECT * FROM ' . DB_PREFIX . 'users)'), 0) and intval($userdata['user_level']) !== USER_LEVEL_SUPER_ADMIN) { // TODO: handle this case better way exit('You are not superadmin.'); } } $localeset = filter_input(INPUT_GET, 'localeset') ?: (isset($settings['locale']) ? $settings['locale'] : 'English'); define('LANGUAGE', is_dir(LOCALE . $localeset) ? $localeset : 'English'); define("LOCALESET", LANGUAGE . "/"); include LOCALE . LOCALESET . "setup.php"; require_once LOCALE . LOCALESET . 'global.php'; $dynamics = new dynamics(); $dynamics->boot(); $system_apps = array('articles' => $locale['articles']['title'], 'blog' => $locale['blog']['title'], 'downloads' => $locale['downloads']['title'], 'eshop' => $locale['eshop']['title'], 'faqs' => $locale['faqs']['title'], 'forums' => $locale['forums']['title'], 'news' => $locale['news']['title'], 'photos' => $locale['photos']['title'], 'polls' => $locale['polls']['title'], 'weblinks' => $locale['weblinks']['title']); $buttons = array('next' => array('next', $locale['setup_0121']), 'finish' => array('next', $locale['setup_0123']), 'done' => array('done', $locale['setup_0120']), 'refresh' => array('next', $locale['setup_1105']), 'tryagain' => array('next', $locale['setup_0122']), 'back' => array('back', $locale['setup_0122'])); $buttonMode = NULL; $nextStep = STEP_INTRO; $content = ""; switch (INSTALLATION_STEP) { // Introduction case STEP_INTRO: default: // create htaccess file. if (isset($_POST['htaccess'])) { dbconnect($db_host, $db_user, $db_pass, $db_name, FALSE); /* * We need to include it to create DB_SETTINGS