示例#1
0
$session->init();
$mybb->session =& $session;
// Include the necessary contants for installation
$grouppermignore = array("gid", "type", "title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
$groupzerogreater = array("pmquota", "maxpmrecipients", "maxreputationsday", "attachquota", "maxemails", "maxwarningsday", "maxposts", "edittimelimit", "canusesigxposts", "maxreputationsperthread");
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
$fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');
// Include the installation resources
require_once INSTALL_ROOT . "resources/output.php";
$output = new installerOutput();
$output->script = "upgrade.php";
$output->title = "MyBB Upgrade Wizard";
if (file_exists("lock")) {
    $output->print_error($lang->locked);
} else {
    $mybb->input['action'] = $mybb->get_input('action');
    if ($mybb->input['action'] == "logout" && $mybb->user['uid']) {
        // Check session ID if we have one
        if ($mybb->get_input('logoutkey') != $mybb->user['logoutkey']) {
            $output->print_error("Your user ID could not be verified to log you out.  This may have been because a malicious Javascript was attempting to log you out automatically.  If you intended to log out, please click the Log Out button at the top menu.");
        }
        my_unsetcookie("mybbuser");
        if ($mybb->user['uid']) {
            $time = TIME_NOW;
            $lastvisit = array("lastactive" => $time - 900, "lastvisit" => $time);
            $db->update_query("users", $lastvisit, "uid='" . $mybb->user['uid'] . "'");
        }
        header("Location: upgrade.php");
    } else {
        if ($mybb->input['action'] == "do_login" && $mybb->request_method == "post") {
            require_once MYBB_ROOT . "inc/functions_user.php";
示例#2
0
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();
                break;
            case 'populate_tables':
                populate_tables();
                break;
示例#3
0
/**
 * View the modal.
 *
 * @param MyBB       $mybb      MyBB core object.
 * @param MyLanguage $lang      Language object.
 * @param templates  $templates Template manager.
 * @param array      $theme     Details about the current theme.
 */
function myalerts_view_modal($mybb, $lang, $templates, $theme)
{
    $userAlerts = MybbStuff_MyAlerts_AlertManager::getInstance()->getAlerts(0, $mybb->settings['myalerts_dropdown_limit']);
    $alerts = '';
    if (is_array($userAlerts) && !empty($userAlerts)) {
        foreach ($userAlerts as $alertObject) {
            $altbg = alt_trow();
            $alert = parse_alert($alertObject);
            if ($alert['message']) {
                $alerts .= eval($templates->render('myalerts_alert_row_popup'));
            }
            $readAlerts[] = $alert['id'];
        }
    } else {
        $altbg = 'trow1';
        $alerts = eval($templates->render('myalerts_alert_row_popup_no_alerts'));
    }
    $myalerts_return_link = $mybb->get_input('ret_link');
    $myalerts_modal = eval($templates->render('myalerts_modal_content', 1, 0));
    echo $myalerts_modal;
    exit;
}