Пример #1
0
    $dboptions['mysql'] = array('class' => 'DB_MySQL', 'title' => 'MySQL', 'short_title' => 'MySQL', 'structure_file' => 'mysql_db_tables.php', 'population_file' => 'mysql_db_inserts.php');
}
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':
Пример #2
0
                    $output->print_error("Wpisane hasło jest nieprawidłowe. Jeżeli nie pamiętasz swojego hasła, kliknij <a href=\"../member.php?action=lostpw\">tutaj</a>, aby je odzyskać i spróbuj ponownie.");
                }
            }
            $db->delete_query("sessions", "ip='" . $db->escape_string($session->ipaddress) . "' AND sid != '" . $session->sid . "'");
            $newsession = array("uid" => $user['uid']);
            $db->update_query("sessions", $newsession, "sid='" . $session->sid . "'");
            // Temporarily set the cookie remember option for the login cookies
            $mybb->user['remember'] = $user['remember'];
            my_setcookie("mybbuser", $user['uid'] . "_" . $user['loginkey'], null, true);
            my_setcookie("sid", $session->sid, -1, true);
            header("Location: ./upgrade.php");
        }
    }
    $output->steps = array($lang->upgrade);
    if ($mybb->user['uid'] == 0) {
        $output->print_header("Wymagane zalogowanie", "errormsg", 0, 1);
        $output->print_contents('<p>Podaj swój login i hasło, aby rozpocząć proces aktualizacji. Musisz mieć uprawnienia administratora, aby uruchomić ten proces.</p>
<form action="upgrade.php" method="post">
	<div class="border_wrapper">
		<table class="general" cellspacing="0">
		<thead>
			<tr>
				<th colspan="2" class="first last">Logowanie</th>
			</tr>
		</thead>
		<tbody>
			<tr class="first">
				<td class="first">Login:</td>
				<td class="last alt_col"><input type="text" class="textbox" name="username" size="25" maxlength="' . $mybb->settings['maxnamelength'] . '" style="width: 200px;" /></td>
			</tr>
			<tr class="alt_row last">
Пример #3
0
 	</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");
     $upgradescripts = array();
     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);
Пример #4
0
                    $output->print_error("The password you entered is incorrect. If you have forgotten your password, click <a href=\"../member.php?action=lostpw\">here</a>. Otherwise, go back and try again.");
                }
            }
            $db->delete_query("sessions", "ip='" . $db->escape_string($session->ipaddress) . "' AND sid != '" . $session->sid . "'");
            $newsession = array("uid" => $user['uid']);
            $db->update_query("sessions", $newsession, "sid='" . $session->sid . "'");
            // Temporarily set the cookie remember option for the login cookies
            $mybb->user['remember'] = $user['remember'];
            my_setcookie("mybbuser", $user['uid'] . "_" . $user['loginkey'], null, true);
            my_setcookie("sid", $session->sid, -1, true);
            header("Location: ./upgrade.php");
        }
    }
    $output->steps = array($lang->upgrade);
    if ($mybb->user['uid'] == 0) {
        $output->print_header($lang->please_login, "errormsg", 0, 1);
        $output->print_contents('<p>' . $lang->login_desc . '</p>
<form action="upgrade.php" method="post">
	<div class="border_wrapper">
		<table class="general" cellspacing="0">
		<thead>
			<tr>
				<th colspan="2" class="first last">' . $lang->login . '</th>
			</tr>
		</thead>
		<tbody>
			<tr class="first">
				<td class="first">' . $lang->login_username . ':</td>
				<td class="last alt_col"><input type="text" class="textbox" name="username" size="25" maxlength="' . $mybb->settings['maxnamelength'] . '" style="width: 200px;" /></td>
			</tr>
			<tr class="alt_row last">
                    $output->print_error("The password you entered is incorrect. If you have forgotten your password, click <a href=\"../member.php?action=lostpw\">here</a>. Otherwise, go back and try again.");
                }
            }
            $db->delete_query("sessions", "ip='" . $db->escape_string($session->ipaddress) . "' AND sid != '" . $session->sid . "'");
            $newsession = array("uid" => $user['uid']);
            $db->update_query("sessions", $newsession, "sid='" . $session->sid . "'");
            // Temporarily set the cookie remember option for the login cookies
            $mybb->user['remember'] = $user['remember'];
            my_setcookie("mybbuser", $user['uid'] . "_" . $user['loginkey'], null, true);
            my_setcookie("sid", $session->sid, -1, true);
            header("Location: ./upgrade.php");
        }
    }
    $output->steps = array($lang->upgrade);
    if ($mybb->user['uid'] == 0) {
        $output->print_header("Please Login", "errormsg", 0, 1);
        $output->print_contents('<p>Please enter your username and password to begin the upgrade process. You must be a valid forum administrator to perform the upgrade.</p>
<form action="upgrade.php" method="post">
	<div class="border_wrapper">
		<table class="general" cellspacing="0">
		<thead>
			<tr>
				<th colspan="2" class="first last">Login</th>
			</tr>
		</thead>
		<tbody>
			<tr class="first">
				<td class="first">Username:</td>
				<td class="last alt_col"><input type="text" class="textbox" name="username" size="25" maxlength="' . $mybb->settings['maxnamelength'] . '" style="width: 200px;" /></td>
			</tr>
			<tr class="alt_row last">