Vergleich install/upgrade.php - 1.8.33 - 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



			$candidates = array(
17, // 16+1
);

		}
else
{

		}
else
{

			$next_update_version = (int)(end($version_history)+1);

















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


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

			$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 331Zeile 352
		}
unset($upgradescripts);
unset($upgradescript);

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





		if(end($version_history) == reset($key_order) && empty($mybb->input['force']))
{
$output->print_contents($lang->upgrade_not_needed);
$output->print_footer("finished");

		if(end($version_history) == reset($key_order) && empty($mybb->input['force']))
{
$output->print_contents($lang->upgrade_not_needed);
$output->print_footer("finished");

		}

		}

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

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

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

		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();

		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();

				$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 393Zeile 422
		$bits = explode("_", $mybb->input['action'], 2);
if(!empty($bits[1])) // We're still running a module
{

		$bits = explode("_", $mybb->input['action'], 2);
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 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 551Zeile 588

$db->insert_query("templates", $insert_array);
++$newcount;


$db->insert_query("templates", $insert_array);
++$newcount;

			}
}

			}
}

	}

$output->print_contents($lang->upgrade_templates_reverted_success);

	}

$output->print_contents($lang->upgrade_templates_reverted_success);

Zeile 669Zeile 706
		if($written)
{
$lock_note = $lang->sprintf($lang->upgrade_locked, $config['admin_dir']);

		if($written)
{
$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>";
}

// Rebuild inc/settings.php at the end of the upgrade
if(function_exists('rebuild_settings'))

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

// Rebuild inc/settings.php at the end of the upgrade
if(function_exists('rebuild_settings'))

	{

	{

		rebuild_settings();
}
else

		rebuild_settings();
}
else

Zeile 698Zeile 735

$output->print_contents($lang->sprintf($lang->upgrade_congrats, $mybb->version, $lock_note));
$output->print_footer();


$output->print_contents($lang->sprintf($lang->upgrade_congrats, $mybb->version, $lock_note));
$output->print_footer();

}

/**

}

/**

 * Show the finish page
*/
function whatsnext()

 * Show the finish page
*/
function whatsnext()

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

 * @param string $func
*
* @return string

Zeile 730Zeile 767
function next_function($from, $func="dbchanges")
{
global $oldvers, $system_upgrade_detail, $currentscript, $cache;

function next_function($from, $func="dbchanges")
{
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(empty($function))
{
$function = "whatsnext";
}
return $function;

	if(empty($function))
{
$function = "whatsnext";
}
return $function;

}

}


/**
* @param string $module


/**
* @param string $module

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']);
}