Vergleich install/upgrade.php - 1.4.3 - 1.4.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: upgrade.php 4172 2008-09-03 00:30:14Z Tikitiki $

 * $Id: upgrade.php 5379 2011-02-21 11:06:42Z Tomm $

 */
error_reporting(E_ALL & ~E_NOTICE);


 */
error_reporting(E_ALL & ~E_NOTICE);


Zeile 14Zeile 14
define("INSTALL_ROOT", dirname(__FILE__)."/");
define("TIME_NOW", time());
define('IN_MYBB', 1);

define("INSTALL_ROOT", dirname(__FILE__)."/");
define("TIME_NOW", time());
define('IN_MYBB', 1);

 
define("IN_UPGRADE", 1);

if(function_exists('date_default_timezone_set') && !ini_get('date.timezone'))
{
date_default_timezone_set('GMT');
}


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


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

Zeile 105Zeile 111

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

{

{

	$settings['bburl'] = my_substr($settings['bburl'], 0, -1);
}


	$settings['bburl'] = my_substr($settings['bburl'], 0, -1);
}


Zeile 173Zeile 179
		$query = $db->simple_select("users", "uid,username,password,salt,loginkey", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
$user = $db->fetch_array($query);
if(!$user['uid'])

		$query = $db->simple_select("users", "uid,username,password,salt,loginkey", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
$user = $db->fetch_array($query);
if(!$user['uid'])

		{
$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 username you have entered appears to be invalid.");

		}
else
{
$user = validate_password_from_uid($user['uid'], $mybb->input['password'], $user);

		}
else
{
$user = validate_password_from_uid($user['uid'], $mybb->input['password'], $user);

 
			if(!$user['uid'])
{
$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."'");

		}

$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");

Zeile 196Zeile 206
		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);



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


Zeile 287Zeile 297
		unset($upgradescripts);
unset($upgradescript);


		unset($upgradescripts);
unset($upgradescript);


		$output->print_contents($lang->sprintf($lang->upgrade_welcome, $mybb->version)."<p><select name=\"from\">$vers</select>");

		$output->print_contents($lang->sprintf($lang->upgrade_welcome, $mybb->version)."<p><select name=\"from\">$vers</select>".$lang->upgrade_send_stats);

		$output->print_footer("doupgrade");
}
elseif($mybb->input['action'] == "doupgrade")
{

		$output->print_footer("doupgrade");
}
elseif($mybb->input['action'] == "doupgrade")
{

 
		add_upgrade_store("allow_anonymous_info", intval($mybb->input['allow_anonymous_info']));

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

Zeile 375Zeile 386
		  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}");

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

	}

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

	}

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

	{

	{

		$db->drop_table("themes");
$db->write_query("CREATE TABLE ".TABLE_PREFIX."themes (
tid smallint unsigned NOT NULL auto_increment,

		$db->drop_table("themes");
$db->write_query("CREATE TABLE ".TABLE_PREFIX."themes (
tid smallint unsigned NOT NULL auto_increment,

Zeile 417Zeile 428
		{
$output->print_error("Please make sure your admin directory is uploaded correctly.");
}

		{
$output->print_error("Please make sure your admin directory is uploaded correctly.");
}

		import_theme_xml($contents, array("templateset" => -2, "no_templates" => 1));

		import_theme_xml($contents, array("templateset" => -2, "no_templates" => 1, "version_compat" => 1));

		$tid = build_new_theme("Default", null, 1);

$db->update_query("themes", array("def" => 1), "tid='{$tid}'");

		$tid = build_new_theme("Default", null, 1);

$db->update_query("themes", array("def" => 1), "tid='{$tid}'");

Zeile 451Zeile 462
		}

// Import master theme

		}

// Import master theme

		import_theme_xml($contents, array("tid" => 1, "no_templates" => 1));

		import_theme_xml($contents, array("tid" => 1, "no_templates" => 1, "version_compat" => 1));

	}

$sid = -2;

	}

$sid = -2;

Zeile 561Zeile 572
function upgradedone()
{
global $db, $output, $mybb, $lang, $config;

function upgradedone()
{
global $db, $output, $mybb, $lang, $config;

 
	
ob_start();


$output->print_header("Upgrade Complete");


$output->print_header("Upgrade Complete");

 
	
$allow_anonymous_info = get_upgrade_store("allow_anonymous_info");
if($allow_anonymous_info == 1)
{
require_once MYBB_ROOT."inc/functions_serverstats.php";
$build_server_stats = build_server_stats(0, '', $mybb->version_code, $mybb->config['database']['encoding']);

if($build_server_stats['info_sent_success'] == false)
{
echo $build_server_stats['info_image'];
}
}
ob_end_flush();


	if(is_writable("./"))
{
$lock = @fopen("./lock", "w");

	if(is_writable("./"))
{
$lock = @fopen("./lock", "w");

Zeile 696Zeile 723
		  title varchar(220) NOT NULL default '',
description text NOT NULL,
disporder smallint unsigned NOT NULL default '0',

		  title varchar(220) NOT NULL default '',
description text NOT NULL,
disporder smallint unsigned NOT NULL default '0',

		  isdefault int(1) NOT NULL default '',

		  isdefault int(1) NOT NULL default '0',

		  PRIMARY KEY  (gid)
) TYPE=MyISAM;");


		  PRIMARY KEY  (gid)
) TYPE=MyISAM;");


Zeile 714Zeile 741
		  isdefault int(1) NOT NULL default '0',
PRIMARY KEY (sid)
) TYPE=MyISAM;");

		  isdefault int(1) NOT NULL default '0',
PRIMARY KEY (sid)
) TYPE=MyISAM;");

	}

	}

	else
{
if($db->type == "mysql" || $db->type == "mysqli")
{
$wheresettings = "isdefault='1' OR isdefault='yes'";

	else
{
if($db->type == "mysql" || $db->type == "mysqli")
{
$wheresettings = "isdefault='1' OR isdefault='yes'";

        }

        }

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

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

Zeile 744Zeile 771
	$tree = $parser->get_tree();
$settinggroupnames = array();
$settingnames = array();

	$tree = $parser->get_tree();
$settinggroupnames = array();
$settingnames = array();

	



	foreach($tree['settings'][0]['settinggroup'] as $settinggroup)
{
$settinggroupnames[] = $settinggroup['attributes']['name'];

	foreach($tree['settings'][0]['settinggroup'] as $settinggroup)
{
$settinggroupnames[] = $settinggroup['attributes']['name'];

Zeile 804Zeile 831
		require MYBB_ROOT."inc/settings.php";
foreach($settings as $key => $val)
{

		require MYBB_ROOT."inc/settings.php";
foreach($settings as $key => $val)
{

			$db->update_query("settings", array('value' => $db->escape_string($val)), "name='$key'");

			$db->update_query("settings", array('value' => $db->escape_string($val)), "name='".$db->escape_string($key)."'");

		}
}
unset($settings);

		}
}
unset($settings);