Пример #1
0
     foreach ($key_order as $k => $key) {
         $file = $upgradescripts[$key];
         $upgradescript = file_get_contents(INSTALL_ROOT . "resources/{$file}");
         preg_match("#Upgrade Script:(.*)#i", $upgradescript, $verinfo);
         preg_match("#upgrade([0-9]+).php\$#i", $file, $keynum);
         if (trim($verinfo[1])) {
             if ($keynum[1] == $next_update_version) {
                 $vers .= "<option value=\"{$keynum['1']}\" selected=\"selected\">{$verinfo['1']}</option>\n";
             } else {
                 $vers .= "<option value=\"{$keynum['1']}\">{$verinfo['1']}</option>\n";
             }
         }
     }
     unset($upgradescripts);
     unset($upgradescript);
     $output->print_contents($lang->sprintf($lang->upgrade_welcome, $mybb->version) . "<p><select name=\"from\">{$vers}</select>" . $lang->upgrade_send_stats);
     $output->print_footer("doupgrade");
 } elseif ($mybb->input['action'] == "doupgrade") {
     add_upgrade_store("allow_anonymous_info", intval($mybb->input['allow_anonymous_info']));
     require_once INSTALL_ROOT . "resources/upgrade" . intval($mybb->input['from']) . ".php";
     if ($db->table_exists("datacache") && $upgrade_detail['requires_deactivated_plugins'] == 1 && $mybb->input['donewarning'] != "true") {
         $plugins = $cache->read('plugins', true);
         if (!empty($plugins['active'])) {
             $output->print_header();
             $lang->plugin_warning = "<input type=\"hidden\" name=\"from\" value=\"" . intval($mybb->input['from']) . "\" />\n<input type=\"hidden\" name=\"donewarning\" value=\"true\" />\n<div class=\"error\"><strong><span style=\"color: red\">Ostrzeżenie:</span></strong> <p>Na Twoim forum " . count($plugins['active']) . " pluginów wciąż jest aktywnych. Aktywne pluginy mogą sprawić problemy podczas przeprowadzania procesu aktualizacji lub całkowicie go zakłócić. <strong>Wysoce zalecane</strong> jest wyłączenie wszystkich pluginów przed przystąpieniem do procesu aktualizacji.</p></div> <br />";
             $output->print_contents($lang->sprintf($lang->plugin_warning, $mybb->version));
             $output->print_footer("doupgrade");
         } else {
             add_upgrade_store("startscript", $mybb->input['from']);
             $runfunction = next_function($mybb->input['from']);
         }
Пример #2
0
}
if (function_exists('pg_connect')) {
    $dboptions['pgsql'] = array('class' => 'DB_PgSQL', 'title' => 'PostgreSQL', 'short_title' => 'PostgreSQL', 'structure_file' => 'pgsql_db_tables.php', 'population_file' => 'mysql_db_inserts.php');
}
if (class_exists('PDO')) {
    $supported_dbs = PDO::getAvailableDrivers();
    if (in_array('sqlite', $supported_dbs)) {
        $dboptions['sqlite'] = array('class' => 'DB_SQLite', 'title' => 'SQLite 3', 'short_title' => 'SQLite', 'structure_file' => 'sqlite_db_tables.php', 'population_file' => 'mysql_db_inserts.php');
    }
}
if (file_exists('lock') && $mybb->dev_mode != true) {
    $output->print_error($lang->locked);
} else {
    if ($installed == true && empty($mybb->input['action'])) {
        $output->print_header($lang->already_installed, "errormsg", 0);
        echo $lang->sprintf($lang->mybb_already_installed, $mybb->version);
        $output->print_footer();
    } else {
        $output->steps = array('intro' => $lang->welcome, 'license' => $lang->license_agreement, 'requirements_check' => $lang->req_check, 'database_info' => $lang->db_config, 'create_tables' => $lang->table_creation, 'populate_tables' => $lang->data_insertion, 'templates' => $lang->theme_install, 'configuration' => $lang->board_config, 'adminuser' => $lang->admin_user, 'final' => $lang->finish_setup);
        switch ($mybb->get_input('action')) {
            case 'license':
                license_agreement();
                break;
            case 'requirements_check':
                requirements_check();
                break;
            case 'database_info':
                database_info();
                break;
            case 'create_tables':
                create_tables();
Пример #3
0
				<td class="first">' . $lang->login_password . ':<br /><small>' . $lang->login_password_desc . '</small></td>
				<td class="last alt_col"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" /></td>
			</tr>
		</tbody>
		</table>
	</div>
	<div id="next_button">
		<input type="submit" class="submit_button" name="submit" value="' . $lang->login . '" />
		<input type="hidden" name="action" value="do_login" />
	</div>
</form>');
        $output->print_footer("");
        exit;
    } else {
        if ($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != 'yes') {
            $output->print_error($lang->sprintf($lang->no_permision, $mybb->user['logoutkey']));
        }
    }
    if (!$mybb->input['action'] || $mybb->input['action'] == "intro") {
        $output->print_header();
        if ($db->table_exists("upgrade_data")) {
            $db->drop_table("upgrade_data");
        }
        $db->write_query("CREATE TABLE " . TABLE_PREFIX . "upgrade_data (\n\t\t\ttitle varchar(30) NOT NULL,\n\t\t\tcontents text NOT NULL,\n\t\t\tUNIQUE (title)\n\t\t);");
        $dh = opendir(INSTALL_ROOT . "resources");
        while (($file = readdir($dh)) !== false) {
            if (preg_match("#upgrade([0-9]+).php\$#i", $file, $match)) {
                $upgradescripts[$match[1]] = $file;
                $key_order[] = $match[1];
            }
        }