Vergleich install/upgrade.php - 1.6.1 - 1.6.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: upgrade.php 5157 2010-07-31 23:36:15Z RyanGordon $

 * $Id$

 */

 */


if(function_exists("unicode_decode"))
{
// Unicode extension introduced in 6.0
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_STRICT);
}
elseif(defined("E_DEPRECATED"))
{
// E_DEPRECATED introduced in 5.3
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE);
}
else
{
error_reporting(E_ALL & ~E_NOTICE);
}

 

define('MYBB_ROOT', dirname(dirname(__FILE__))."/");
define("INSTALL_ROOT", dirname(__FILE__)."/");


define('MYBB_ROOT', dirname(dirname(__FILE__))."/");
define("INSTALL_ROOT", dirname(__FILE__)."/");

Zeile 34Zeile 19
{
date_default_timezone_set('GMT');
}

{
date_default_timezone_set('GMT');
}

 

require_once MYBB_ROOT.'inc/class_error.php';
$error_handler = new errorHandler();


require_once MYBB_ROOT."inc/class_core.php";
$mybb = new MyBB;


require_once MYBB_ROOT."inc/class_core.php";
$mybb = new MyBB;

Zeile 61Zeile 49
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/functions.php";
require_once MYBB_ROOT."inc/class_xml.php";
require_once MYBB_ROOT.'inc/class_language.php';





$lang = new MyLanguage();
$lang->set_path(MYBB_ROOT.'install/resources/');
$lang->load('language');

$lang = new MyLanguage();
$lang->set_path(MYBB_ROOT.'install/resources/');
$lang->load('language');





// If we're upgrading from an SQLite installation, make sure we still work.
if($config['database']['type'] == 'sqlite3' || $config['database']['type'] == 'sqlite2')
{

// If we're upgrading from an SQLite installation, make sure we still work.
if($config['database']['type'] == 'sqlite3' || $config['database']['type'] == 'sqlite2')
{

Zeile 74Zeile 62

require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
switch($config['database']['type'])


require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
switch($config['database']['type'])

{

{

	case "sqlite":
$db = new DB_SQLite;
break;

	case "sqlite":
$db = new DB_SQLite;
break;

Zeile 124Zeile 112

$settings['wolcutoff'] = $settings['wolcutoffmins']*60;
$settings['bbname_orig'] = $settings['bbname'];


$settings['wolcutoff'] = $settings['wolcutoffmins']*60;
$settings['bbname_orig'] = $settings['bbname'];

$settings['bbname'] = strip_tags($settings['bbname']);


$settings['bbname'] = strip_tags($settings['bbname']);


// Fix for people who for some specify a trailing slash on the board URL
if(substr($settings['bburl'], -1) == "/")
{

// Fix for people who for some specify a trailing slash on the board URL
if(substr($settings['bburl'], -1) == "/")
{

Zeile 187Zeile 175
			$db->delete_query("sessions", "sid='".$session->sid."'");
}
header("Location: upgrade.php");

			$db->delete_query("sessions", "sid='".$session->sid."'");
}
header("Location: upgrade.php");

	}

	}

	else if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
{
require_once MYBB_ROOT."inc/functions_user.php";

	else if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
{
require_once MYBB_ROOT."inc/functions_user.php";

Zeile 226Zeile 214
		my_setcookie("sid", $session->sid, -1, true);

header("Location: ./upgrade.php");

		my_setcookie("sid", $session->sid, -1, true);

header("Location: ./upgrade.php");

	}


	}


	$output->steps = array($lang->upgrade);

if($mybb->user['uid'] == 0)
{

	$output->steps = array($lang->upgrade);

if($mybb->user['uid'] == 0)
{

		$output->print_header("Please Login", "errormsg", 0, 1);

		$output->print_header($lang->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>

		$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>

<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>

				<th colspan="2" class="first last">'.$lang->login.'</th>

			</tr>
</thead>
<tbody>
<tr class="first">

			</tr>
</thead>
<tbody>
<tr class="first">

				<td class="first">Username:</td>

				<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">

				<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">

				<td class="first">Password:<br /><small>Please note that passwords are case sensitive.</small></td>

				<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">

				<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="Login" />

		<input type="submit" class="submit_button" name="submit" value="'.$lang->login.'" />

		<input type="hidden" name="action" value="do_login" />
</div>
</form>');

		<input type="hidden" name="action" value="do_login" />
</div>
</form>');

Zeile 266Zeile 254
	}
else if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != 'yes')
{

	}
else if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != 'yes')
{

		$output->print_error("You do not have permissions to run this process. You need administrator permissions to be able to run the upgrade procedure.<br /><br />If you need to logout, please click <a href=\"upgrade.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}\">here</a>. From there you will be able to log in again under your administrator account.");

		$output->print_error($lang->sprintf($lang->no_permision, $mybb->user['logoutkey']));

	}

if(!$mybb->input['action'] || $mybb->input['action'] == "intro")

	}

if(!$mybb->input['action'] || $mybb->input['action'] == "intro")

Zeile 339Zeile 327
		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")
{

		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")
{

			require_once MYBB_ROOT."inc/class_datacache.php";
$cache = new datacache;

 
			$plugins = $cache->read('plugins', true);
if(!empty($plugins['active']))
{

			$plugins = $cache->read('plugins', true);
if(!empty($plugins['active']))
{

Zeile 418Zeile 404
		  status varchar(10) NOT NULL default '',
dateline int(10) NOT NULL default '0',
PRIMARY KEY (tid)

		  status varchar(10) NOT NULL default '',
dateline int(10) NOT NULL default '0',
PRIMARY KEY (tid)

		) TYPE=MyISAM{$charset};");

		) ENGINE=MyISAM{$charset};");

	}

if($system_upgrade_detail['revert_all_themes'] > 0)

	}

if($system_upgrade_detail['revert_all_themes'] > 0)

Zeile 433Zeile 419
		 stylesheets text NOT NULL,
allowedgroups text NOT NULL,
PRIMARY KEY (tid)

		 stylesheets text NOT NULL,
allowedgroups text NOT NULL,
PRIMARY KEY (tid)

		) TYPE=MyISAM{$charset};");

		) ENGINE=MyISAM{$charset};");


$db->drop_table("themestylesheets");
$db->write_query("CREATE TABLE ".TABLE_PREFIX."themestylesheets(


$db->drop_table("themestylesheets");
$db->write_query("CREATE TABLE ".TABLE_PREFIX."themestylesheets(

Zeile 445Zeile 431
			cachefile varchar(100) NOT NULL default '',
lastmodified bigint(30) NOT NULL default '0',
PRIMARY KEY(sid)

			cachefile varchar(100) NOT NULL default '',
lastmodified bigint(30) NOT NULL default '0',
PRIMARY KEY(sid)

		) TYPE=MyISAM{$charset};");

		) ENGINE=MyISAM{$charset};");


$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');
if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
{


$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');
if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
{

 
			require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";

			require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
}
else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{

			require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
}
else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{

 
			require_once MYBB_ROOT."admin/inc/functions.php";

			require_once MYBB_ROOT."admin/inc/functions_themes.php";
}
else

			require_once MYBB_ROOT."admin/inc/functions_themes.php";
}
else

Zeile 472Zeile 460
		  sid smallint unsigned NOT NULL auto_increment,
title varchar(120) NOT NULL default '',
PRIMARY KEY (sid)

		  sid smallint unsigned NOT NULL auto_increment,
title varchar(120) NOT NULL default '',
PRIMARY KEY (sid)

		) TYPE=MyISAM{$charset};");

		) ENGINE=MyISAM{$charset};");

		
$db->insert_query("templatesets", array('title' => 'Default Templates'));
}

		
$db->insert_query("templatesets", array('title' => 'Default Templates'));
}

Zeile 595Zeile 583
	$cache->update_most_replied_threads();
$cache->update_most_viewed_threads();
$cache->update_groupleaders();

	$cache->update_most_replied_threads();
$cache->update_most_viewed_threads();
$cache->update_groupleaders();

 
	$cache->update_threadprefixes();
$cache->update_forumsdisplay();


$contents .= $lang->done."</p>";



$contents .= $lang->done."</p>";


Zeile 650Zeile 640
		);

$query = $db->simple_select("settings", "value, name", "", $options);

		);

$query = $db->simple_select("settings", "value, name", "", $options);

		while($setting = $db->fetch_array($query))

		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 662Zeile 652
}

function whatsnext()

}

function whatsnext()

{

{

	global $output, $db, $system_upgrade_detail, $lang;

if($system_upgrade_detail['revert_all_templates'] > 0)

	global $output, $db, $system_upgrade_detail, $lang;

if($system_upgrade_detail['revert_all_templates'] > 0)

	{

	{

		$output->print_header($lang->upgrade_template_reversion);
$output->print_contents($lang->upgrade_template_reversion_success);
$output->print_footer("templates");

		$output->print_header($lang->upgrade_template_reversion);
$output->print_contents($lang->upgrade_template_reversion_success);
$output->print_footer("templates");

	}

	}

	else
{
upgradethemes();

	else
{
upgradethemes();

	}
}

	}
}


function next_function($from, $func="dbchanges")
{


function next_function($from, $func="dbchanges")
{

Zeile 701Zeile 691
	}

if(!$function)

	}

if(!$function)

	{

	{

		$function = "whatsnext";
}
return $function;

		$function = "whatsnext";
}
return $function;

Zeile 727Zeile 717
}

function get_upgrade_store($title)

}

function get_upgrade_store($title)

{

{

	global $db;

$query = $db->simple_select("upgrade_data", "*", "title='".$db->escape_string($title)."'");

	global $db;

$query = $db->simple_select("upgrade_data", "*", "title='".$db->escape_string($title)."'");

Zeile 753Zeile 743
	$settingcount = $groupcount = 0;
$settings = $settinggroups = array();
if($redo == 2)

	$settingcount = $groupcount = 0;
$settings = $settinggroups = array();
if($redo == 2)

	{

	{

		$db->drop_table("settinggroups");
switch($db->type)
{

		$db->drop_table("settinggroups");
switch($db->type)
{

Zeile 766Zeile 756
				  disporder smallint NOT NULL default '0',
isdefault int NOT NULL default '0',
PRIMARY KEY (gid)

				  disporder smallint NOT NULL default '0',
isdefault int NOT NULL default '0',
PRIMARY KEY (gid)

				);");
break;

				);");
break;

			case "sqlite":
$db->write_query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid INTEGER PRIMARY KEY,

			case "sqlite":
$db->write_query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid INTEGER PRIMARY KEY,

				  name varchar(100) NOT NULL default '',
title varchar(220) NOT NULL default '',
description TEXT NOT NULL,
disporder smallint NOT NULL default '0',
isdefault int(1) NOT NULL default '0'
);");
break;
case "mysql":
default:

				  name varchar(100) NOT NULL default '',
title varchar(220) NOT NULL default '',
description TEXT NOT NULL,
disporder smallint NOT NULL default '0',
isdefault int(1) NOT NULL default '0'
);");
break;
case "mysql":
default:

				$db->write_query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid smallint unsigned NOT NULL auto_increment,
name varchar(100) NOT NULL default '',

				$db->write_query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid smallint unsigned NOT NULL auto_increment,
name varchar(100) NOT NULL default '',

Zeile 788Zeile 778
				  disporder smallint unsigned NOT NULL default '0',
isdefault int(1) NOT NULL default '0',
PRIMARY KEY (gid)

				  disporder smallint unsigned NOT NULL default '0',
isdefault int(1) NOT NULL default '0',
PRIMARY KEY (gid)

				) TYPE=MyISAM;");

				) ENGINE=MyISAM;");

		}

$db->drop_table("settings");

		}

$db->drop_table("settings");

Zeile 835Zeile 825
				  gid smallint unsigned NOT NULL default '0',
isdefault int(1) NOT NULL default '0',
PRIMARY KEY (sid)

				  gid smallint unsigned NOT NULL default '0',
isdefault int(1) NOT NULL default '0',
PRIMARY KEY (sid)

				) TYPE=MyISAM;");

				) ENGINE=MyISAM;");

		}
}
else

		}
}
else

Zeile 848Zeile 838
        {
$wheresettings = "isdefault='1'";
}

        {
$wheresettings = "isdefault='1'";
}

		
$query = $db->simple_select("settings", "name,sid", $wheresettings);
while($setting = $db->fetch_array($query))
{
$settings[$setting['name']] = $setting['sid'];
}










		$query = $db->simple_select("settinggroups", "name,title,gid", $wheresettings);
while($group = $db->fetch_array($query))

		$query = $db->simple_select("settinggroups", "name,title,gid", $wheresettings);
while($group = $db->fetch_array($query))

		{

		{

			$settinggroups[$group['name']] = $group['gid'];

			$settinggroups[$group['name']] = $group['gid'];

 
		}

// Collect all the user's settings - regardless of 'defaultivity' - we'll check them all
// against default settings and insert/update them accordingly
$query = $db->simple_select("settings", "name,sid");
while($setting = $db->fetch_array($query))
{
$settings[$setting['name']] = $setting['sid'];

		}
}
$settings_xml = file_get_contents(INSTALL_ROOT."resources/settings.xml");

		}
}
$settings_xml = file_get_contents(INSTALL_ROOT."resources/settings.xml");

Zeile 1010Zeile 1002
					logging int(1) NOT NULL default '0',
locked bigint(30) NOT NULL default '0',
PRIMARY KEY (tid)

					logging int(1) NOT NULL default '0',
locked bigint(30) NOT NULL default '0',
PRIMARY KEY (tid)

				) TYPE=MyISAM;");

				) ENGINE=MyISAM;");

		}
}
else

		}
}
else