示例#1
0
	<div id="next_button">
		<input type="submit" class="submit_button" name="submit" value="Zaloguj" />
		<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("Nie masz uprawnień do uruchomienia procesu aktualizacji. Musisz mieć uprawnienia administratora, aby móc uruchomić ten proces.<br /><br />Jeżeli chcesz się wylogować, kliknij <a href=\"upgrade.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}\">tutaj</a>. Powrócisz do formularza logowania i będzie można zalogować się na koncie administratora.");
        }
    }
    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];
            }
        }
        closedir($dh);
        natsort($key_order);
        $key_order = array_reverse($key_order);
        // Figure out which version we last updated from (as of 1.6)
        $version_history = $cache->read("version_history");
        // If array is empty then we must be upgrading to 1.6 since that's when this feature was added