Zeile 21 | Zeile 21 |
---|
require_once MYBB_ROOT.'inc/class_error.php'; $error_handler = new errorHandler();
|
require_once MYBB_ROOT.'inc/class_error.php'; $error_handler = new errorHandler();
|
| require_once MYBB_ROOT."inc/functions.php";
|
require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
|
require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
|
|
|
require_once MYBB_ROOT."inc/config.php";
|
require_once MYBB_ROOT."inc/config.php";
|
|
|
$orig_config = $config;
|
$orig_config = $config;
|
|
|
if(!is_array($config['database'])) { $config['database'] = array(
| if(!is_array($config['database'])) { $config['database'] = array(
|
Zeile 45 | Zeile 47 |
---|
// Include the files necessary for installation require_once MYBB_ROOT."inc/class_timers.php";
|
// Include the files necessary for installation require_once MYBB_ROOT."inc/class_timers.php";
|
require_once MYBB_ROOT."inc/functions.php";
| |
require_once MYBB_ROOT."inc/class_xml.php"; require_once MYBB_ROOT.'inc/class_language.php';
| require_once MYBB_ROOT."inc/class_xml.php"; require_once MYBB_ROOT.'inc/class_language.php';
|
Zeile 58 | Zeile 59 |
---|
{ $config['database']['type'] = 'sqlite'; }
|
{ $config['database']['type'] = 'sqlite'; }
|
| // Load DB interface require_once MYBB_ROOT."inc/db_base.php";
|
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type']) { case "sqlite": $db = new DB_SQLite;
|
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type']) { case "sqlite": $db = new DB_SQLite;
|
break;
| break;
|
case "pgsql": $db = new DB_PgSQL;
|
case "pgsql": $db = new DB_PgSQL;
|
break;
| break;
|
case "mysqli": $db = new DB_MySQLi; break; default: $db = new DB_MySQL;
|
case "mysqli": $db = new DB_MySQLi; break; default: $db = new DB_MySQL;
|
}
| }
|
// Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
| // Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
|
Zeile 92 | Zeile 96 |
---|
if(function_exists('rebuild_settings')) { rebuild_settings();
|
if(function_exists('rebuild_settings')) { rebuild_settings();
|
} else { $options = array(
| } else { $options = array(
|
"order_by" => "title", "order_dir" => "ASC" );
|
"order_by" => "title", "order_dir" => "ASC" );
|
|
|
$query = $db->simple_select("settings", "value, name", "", $options);
$settings = array(); while($setting = $db->fetch_array($query))
|
$query = $db->simple_select("settings", "value, name", "", $options);
$settings = array(); while($setting = $db->fetch_array($query))
|
{
| {
|
$setting['value'] = str_replace("\"", "\\\"", $setting['value']); $settings[$setting['name']] = $setting['value']; }
| $setting['value'] = str_replace("\"", "\\\"", $setting['value']); $settings[$setting['name']] = $setting['value']; }
|
Zeile 129 | Zeile 133 |
---|
// Load cache $cache->cache();
|
// Load cache $cache->cache();
|
|
|
$mybb->cache = &$cache;
require_once MYBB_ROOT."inc/class_session.php";
| $mybb->cache = &$cache;
require_once MYBB_ROOT."inc/class_session.php";
|
Zeile 141 | Zeile 145 |
---|
$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");
|
$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", "candlattachments", "canpostthreads", "canpostreplys", "canpostattachments", "canratethreads", "caneditposts", "candeleteposts", "candeletethreads", "caneditattachments", "canpostpolls", "canvotepolls", "cansearch");
| $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";
| // Include the installation resources require_once INSTALL_ROOT."resources/output.php";
|
Zeile 165 | Zeile 169 |
---|
}
my_unsetcookie("mybbuser");
|
}
my_unsetcookie("mybbuser");
|
my_unsetcookie("sid");
|
|
if($mybb->user['uid']) { $time = TIME_NOW;
| if($mybb->user['uid']) { $time = TIME_NOW;
|
Zeile 174 | Zeile 178 |
---|
"lastvisit" => $time, ); $db->update_query("users", $lastvisit, "uid='".$mybb->user['uid']."'");
|
"lastvisit" => $time, ); $db->update_query("users", $lastvisit, "uid='".$mybb->user['uid']."'");
|
$db->delete_query("sessions", "sid='".$session->sid."'");
| |
} header("Location: upgrade.php"); }
| } header("Location: upgrade.php"); }
|
Zeile 203 | Zeile 206 |
---|
$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."); } }
|
$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("mybbuser", $user['uid']."_".$user['loginkey'], null, true);
|
my_setcookie("sid", $session->sid, -1, true);
| |
header("Location: ./upgrade.php"); }
| header("Location: ./upgrade.php"); }
|
Zeile 331 | Zeile 322 |
---|
} elseif($mybb->input['action'] == "doupgrade") {
|
} elseif($mybb->input['action'] == "doupgrade") {
|
add_upgrade_store("allow_anonymous_info", $mybb->get_input('allow_anonymous_info', 1)); require_once INSTALL_ROOT."resources/upgrade".$mybb->get_input('from', 1).".php";
| add_upgrade_store("allow_anonymous_info", $mybb->get_input('allow_anonymous_info', MyBB::INPUT_INT)); require_once INSTALL_ROOT."resources/upgrade".$mybb->get_input('from', MyBB::INPUT_INT).".php";
|
if($db->table_exists("datacache") && $upgrade_detail['requires_deactivated_plugins'] == 1 && $mybb->get_input('donewarning') != "true") { $plugins = $cache->read('plugins', true); if(!empty($plugins['active'])) { $output->print_header();
|
if($db->table_exists("datacache") && $upgrade_detail['requires_deactivated_plugins'] == 1 && $mybb->get_input('donewarning') != "true") { $plugins = $cache->read('plugins', true); if(!empty($plugins['active'])) { $output->print_header();
|
$lang->plugin_warning = "<input type=\"hidden\" name=\"from\" value=\"".$mybb->get_input('from', 1)."\" />\n<input type=\"hidden\" name=\"donewarning\" value=\"true\" />\n<div class=\"error\"><strong><span style=\"color: red\">Warning:</span></strong> <p>There are still ".count($plugins['active'])." plugin(s) active. Active plugins can sometimes cause problems during an upgrade procedure or may break your forum afterward. It is <strong>strongly</strong> reccommended that you deactivate your plugins before continuing.</p></div> <br />";
| $lang->plugin_warning = "<input type=\"hidden\" name=\"from\" value=\"".$mybb->get_input('from', MyBB::INPUT_INT)."\" />\n<input type=\"hidden\" name=\"donewarning\" value=\"true\" />\n<div class=\"error\"><strong><span style=\"color: red\">Warning:</span></strong> <p>There are still ".count($plugins['active'])." plugin(s) active. Active plugins can sometimes cause problems during an upgrade procedure or may break your forum afterward. It is <strong>strongly</strong> reccommended that you deactivate your plugins before continuing.</p></div> <br />";
|
$output->print_contents($lang->sprintf($lang->plugin_warning, $mybb->version)); $output->print_footer("doupgrade"); } else {
|
$output->print_contents($lang->sprintf($lang->plugin_warning, $mybb->version)); $output->print_footer("doupgrade"); } else {
|
add_upgrade_store("startscript", $mybb->get_input('from', 1)); $runfunction = next_function($mybb->get_input('from', 1));
| add_upgrade_store("startscript", $mybb->get_input('from', MyBB::INPUT_INT)); $runfunction = next_function($mybb->get_input('from', MyBB::INPUT_INT));
|
} } else {
|
} } else {
|
add_upgrade_store("startscript", $mybb->get_input('from', 1)); $runfunction = next_function($mybb->get_input('from', 1));
| add_upgrade_store("startscript", $mybb->get_input('from', MyBB::INPUT_INT)); $runfunction = next_function($mybb->get_input('from', MyBB::INPUT_INT));
|
} } $currentscript = get_upgrade_store("currentscript");
| } } $currentscript = get_upgrade_store("currentscript");
|
Zeile 605 | Zeile 596 |
---|
function upgradedone() {
|
function upgradedone() {
|
global $db, $output, $mybb, $lang, $config;
| global $db, $output, $mybb, $lang, $config, $plugins;
|
ob_start(); $output->print_header("Upgrade Complete");
| ob_start(); $output->print_header("Upgrade Complete");
|
Zeile 625 | Zeile 616 |
---|
// Attempt to run an update check require_once MYBB_ROOT.'inc/functions_task.php';
|
// Attempt to run an update check require_once MYBB_ROOT.'inc/functions_task.php';
|
run_task(12);
| $query = $db->simple_select('tasks', 'tid', "file='versioncheck'"); $update_check = $db->fetch_array($query); if($update_check) { // Load plugin system for update check require_once MYBB_ROOT."inc/class_plugins.php"; $plugins = new pluginSystem;
run_task($update_check['tid']); }
|
if(is_writable("./")) {
| if(is_writable("./")) {
|
Zeile 746 | Zeile 746 |
---|
$replace_array = array( "title" => $db->escape_string($title),
|
$replace_array = array( "title" => $db->escape_string($title),
|
"contents" => $db->escape_string(serialize($contents))
| "contents" => $db->escape_string(my_serialize($contents))
|
); $db->replace_query("upgrade_data", $replace_array, "title"); }
| ); $db->replace_query("upgrade_data", $replace_array, "title"); }
|
Zeile 1090 | Zeile 1090 |
---|
fclose($file); } }
|
fclose($file); } }
|
?>
| |