Vergleich install/upgrade.php - 1.8.28 - 1.8.39

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 200Zeile 200
		);
$user = get_user_by_username($mybb->get_input('username'), $options);


		);
$user = get_user_by_username($mybb->get_input('username'), $options);


		if(!$user['uid'])

		if(!$user)

		{
$output->print_error("The username you have entered appears to be invalid.");
}
else
{
$user = validate_password_from_uid($user['uid'], $mybb->get_input('password'), $user);

		{
$output->print_error("The username you have entered appears to be invalid.");
}
else
{
$user = validate_password_from_uid($user['uid'], $mybb->get_input('password'), $user);

			if(!$user['uid'])

			if(!$user)

			{
$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.");
}

Zeile 287Zeile 287
		$upgradescripts = array();
while(($file = readdir($dh)) !== false)
{

		$upgradescripts = array();
while(($file = readdir($dh)) !== false)
{

			if(preg_match("#upgrade([0-9]+).php$#i", $file, $match))

			if(preg_match("#upgrade(\d+(p\d+)*).php$#i", $file, $match))

			{
$upgradescripts[$match[1]] = $file;
$key_order[] = $match[1];

			{
$upgradescripts[$match[1]] = $file;
$key_order[] = $match[1];

Zeile 303Zeile 303
		// If array is empty then we must be upgrading to 1.6 since that's when this feature was added
if(empty($version_history))
{

		// If array is empty then we must be upgrading to 1.6 since that's when this feature was added
if(empty($version_history))
{

			$next_update_version = 17; // 16+1
}
else
{
$next_update_version = (int)(end($version_history)+1);
}





















			$candidates = array(
17, // 16+1
);
}
else
{
$latest_installed = end($version_history);

// Check for standard migrations and old branch patches (1 < 1p1 < 1p2 < 2)
$parts = explode('p', $latest_installed);

$candidates = array(
(string)((int)$parts[0] + 1),
);

if(isset($parts[1]))
{
$candidates[] = $parts[0].'p'.((int)$parts[1] + 1);
}
else
{
$candidates[] = $parts[0].'p1';
}
}



		$vers = '';
foreach($key_order as $k => $key)
{
$file = $upgradescripts[$key];
$upgradescript = file_get_contents(INSTALL_ROOT."resources/$file");
preg_match("#Upgrade Script:(.*)#i", $upgradescript, $verinfo);

		$vers = '';
foreach($key_order as $k => $key)
{
$file = $upgradescripts[$key];
$upgradescript = file_get_contents(INSTALL_ROOT."resources/$file");
preg_match("#Upgrade Script:(.*)#i", $upgradescript, $verinfo);

			preg_match("#upgrade([0-9]+).php$#i", $file, $keynum);

			preg_match("#upgrade(\d+(p\d+)*).php$#i", $file, $keynum);

			if(trim($verinfo[1]))
{

			if(trim($verinfo[1]))
{

				if($keynum[1] == $next_update_version)

				if(in_array($keynum[1], $candidates))

				{
$vers .= "<option value=\"$keynum[1]\" selected=\"selected\">$verinfo[1]</option>\n";

				{
$vers .= "<option value=\"$keynum[1]\" selected=\"selected\">$verinfo[1]</option>\n";

 

$candidates = array();

				}
else
{

				}
else
{

Zeile 345Zeile 366
	}
elseif($mybb->input['action'] == "doupgrade")
{

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

 
		if(ctype_alnum($mybb->get_input('from')))
{
$from = $mybb->get_input('from');
}
else{
$from = 0;
}


		add_upgrade_store("allow_anonymous_info", $mybb->get_input('allow_anonymous_info', MyBB::INPUT_INT));

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

		require_once INSTALL_ROOT."resources/upgrade".$from.".php";
if($db->table_exists("datacache") && !empty($upgrade_detail['requires_deactivated_plugins']) && $mybb->get_input('donewarning') != "true")

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

		{
$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', 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 />";

				$lang->plugin_warning = "<input type=\"hidden\" name=\"from\" value=\"".$from."\" />\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', MyBB::INPUT_INT));
$runfunction = next_function($mybb->get_input('from', MyBB::INPUT_INT));

				add_upgrade_store("startscript", $from);
$runfunction = next_function($from);

			}
}
else
{

			}
}
else
{

			add_upgrade_store("startscript", $mybb->get_input('from', MyBB::INPUT_INT));
$runfunction = next_function($mybb->get_input('from', MyBB::INPUT_INT));

			add_upgrade_store("startscript", $from);
$runfunction = next_function($from);

		}
}
$currentscript = get_upgrade_store("currentscript");

		}
}
$currentscript = get_upgrade_store("currentscript");

Zeile 391Zeile 420
	else // Busy running modules, come back later
{
$bits = explode("_", $mybb->input['action'], 2);

	else // Busy running modules, come back later
{
$bits = explode("_", $mybb->input['action'], 2);

		if($bits[1]) // We're still running a module

		if(!empty($bits[1])) // We're still running a module

		{

		{

			$from = $bits[0];
$runfunction = next_function($bits[0], $bits[1]);









			if(ctype_alnum($bits[0]))
{
$from = $bits[0];
}
else
{
$from = 0;
}

$runfunction = next_function($from, $bits[1]);


}
}


}
}

Zeile 414Zeile 451
	global $output, $db, $system_upgrade_detail, $lang, $mybb;

$output->print_header($lang->upgrade_templates_reverted);

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

$output->print_header($lang->upgrade_templates_reverted);





	$charset = $db->build_create_table_collation();

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

	$charset = $db->build_create_table_collation();

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

Zeile 433Zeile 470
	}

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 530Zeile 567
			$time = TIME_NOW;
$query = $db->simple_select("templates", "tid", "sid='-2' AND title='".$db->escape_string($templatename)."'");
$oldtemp = $db->fetch_array($query);

			$time = TIME_NOW;
$query = $db->simple_select("templates", "tid", "sid='-2' AND title='".$db->escape_string($templatename)."'");
$oldtemp = $db->fetch_array($query);

			if($oldtemp['tid'])

			if($oldtemp)

			{
$update_array = array(
'template' => $templatevalue,

			{
$update_array = array(
'template' => $templatevalue,

Zeile 589Zeile 626

$output->print_header($lang->upgrade_datacache_building);



$output->print_header($lang->upgrade_datacache_building);


	$contents .= $lang->upgrade_building_datacache;

	$contents = $lang->upgrade_building_datacache;


$cache->update_version();
$cache->update_attachtypes();


$cache->update_version();
$cache->update_attachtypes();

Zeile 671Zeile 708
			$lock_note = $lang->sprintf($lang->upgrade_locked, $config['admin_dir']);
}
}

			$lock_note = $lang->sprintf($lang->upgrade_locked, $config['admin_dir']);
}
}

	if(!$written)

	if(empty($written))

	{
$lock_note = "<p><b><span style=\"color: red;\">".$lang->upgrade_removedir."</span></b></p>";
}

	{
$lock_note = "<p><b><span style=\"color: red;\">".$lang->upgrade_removedir."</span></b></p>";
}

Zeile 722Zeile 759
/**
* Determine the next function we need to call
*

/**
* Determine the next function we need to call
*

 * @param int $from

 * @param string $from

 * @param string $func
*
* @return string
*/
function next_function($from, $func="dbchanges")

 * @param string $func
*
* @return string
*/
function next_function($from, $func="dbchanges")

{

{

	global $oldvers, $system_upgrade_detail, $currentscript, $cache;

	global $oldvers, $system_upgrade_detail, $currentscript, $cache;

 

if(!ctype_alnum($from))
{
$from = 0;
}


load_module("upgrade".$from.".php");
if(function_exists("upgrade".$from."_".$func))


load_module("upgrade".$from.".php");
if(function_exists("upgrade".$from."_".$func))

Zeile 739Zeile 781
	else
{
// We're done with our last upgrade script, so add it to the upgrade scripts we've already completed.

	else
{
// We're done with our last upgrade script, so add it to the upgrade scripts we've already completed.

 
		if (ctype_digit($from)) {
$from = (int)$from;
}


		$version_history = $cache->read("version_history");
$version_history[$from] = $from;
$cache->update("version_history", $version_history);

		$version_history = $cache->read("version_history");
$version_history[$from] = $from;
$cache->update("version_history", $version_history);


$from = $from+1;
if(file_exists(INSTALL_ROOT."resources/upgrade".$from.".php"))
{
$function = next_function($from);





















// Check for standard migrations and old branch patches (1 < 1p1 < 1p2 < 2)
$parts = explode('p', $from);

$candidates = array(
(string)((int)$parts[0] + 1),
);

if(isset($parts[1]))
{
$candidates[] = $parts[0].'p'.((int)$parts[1] + 1);
}
else
{
$candidates[] = $parts[0].'p1';
}

foreach($candidates as $candidate)
{
if(file_exists(INSTALL_ROOT."resources/upgrade".$candidate.".php"))
{
$function = next_function($candidate);
break;
}

		}
}


		}
}


	if(!$function)

	if(empty($function))

	{
$function = "whatsnext";
}

	{
$function = "whatsnext";
}

Zeile 761Zeile 826
 * @param string $module
*/
function load_module($module)

 * @param string $module
*/
function load_module($module)

{

{

	global $system_upgrade_detail, $currentscript, $upgrade_detail;

require_once INSTALL_ROOT."resources/".$module;

	global $system_upgrade_detail, $currentscript, $upgrade_detail;

require_once INSTALL_ROOT."resources/".$module;

Zeile 769Zeile 834
	{
foreach($upgrade_detail as $key => $val)
{

	{
foreach($upgrade_detail as $key => $val)
{

			if(!$system_upgrade_detail[$key] || $val > $system_upgrade_detail[$key])

			if(empty($system_upgrade_detail[$key]) || $val > $system_upgrade_detail[$key])

			{
$system_upgrade_detail[$key] = $val;
}

			{
$system_upgrade_detail[$key] = $val;
}

Zeile 792Zeile 857

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


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

 

if(!isset($data['contents']))
{
return null;
}


	return my_unserialize($data['contents']);
}


	return my_unserialize($data['contents']);
}


Zeile 1002Zeile 1073
		}
}
unset($settings);

		}
}
unset($settings);

 
	$settings = '';

	$query = $db->simple_select("settings", "*", "", array('order_by' => 'title'));
while($setting = $db->fetch_array($query))
{

	$query = $db->simple_select("settings", "*", "", array('order_by' => 'title'));
while($setting = $db->fetch_array($query))
{