Vergleich install/upgrade.php - 1.4.9 - 1.4.13

  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 4353 2009-04-19 00:25:42Z Tikitiki $

 * $Id: upgrade.php 4416 2009-08-07 02:11:52Z RyanGordon $

 */
error_reporting(E_ALL & ~E_NOTICE);


 */
error_reporting(E_ALL & ~E_NOTICE);


Zeile 15Zeile 15
define("TIME_NOW", time());
define('IN_MYBB', 1);
define("IN_UPGRADE", 1);

define("TIME_NOW", time());
define('IN_MYBB', 1);
define("IN_UPGRADE", 1);

 

if(function_exists('date_default_timezone_set'))
{
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;





require_once MYBB_ROOT."inc/config.php";

require_once MYBB_ROOT."inc/config.php";





$orig_config = $config;

if(!is_array($config['database']))

$orig_config = $config;

if(!is_array($config['database']))

{

{

	$config['database'] = array(
"type" => $config['dbtype'],
"database" => $config['database'],

	$config['database'] = array(
"type" => $config['dbtype'],
"database" => $config['database'],

Zeile 83Zeile 88
	if(function_exists('rebuild_settings'))
{
rebuild_settings();

	if(function_exists('rebuild_settings'))
{
rebuild_settings();

	}
else

	}
else

	{
$options = array(
"order_by" => "title",

	{
$options = array(
"order_by" => "title",

Zeile 93Zeile 98
		
$query = $db->simple_select("settings", "value, name", "", $options);
while($setting = $db->fetch_array($query))

		
$query = $db->simple_select("settings", "value, name", "", $options);
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 128Zeile 133
$groupzerogreater = array("pmquota", "maxreputationsday", "attachquota");
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
$fpermfields = array("canview", "candlattachments", "canpostthreads", "canpostreplys", "canpostattachments", "canratethreads", "caneditposts", "candeleteposts", "candeletethreads", "caneditattachments", "canpostpolls", "canvotepolls", "cansearch");

$groupzerogreater = array("pmquota", "maxreputationsday", "attachquota");
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
$fpermfields = array("canview", "candlattachments", "canpostthreads", "canpostreplys", "canpostattachments", "canratethreads", "caneditposts", "candeleteposts", "candeletethreads", "caneditattachments", "canpostpolls", "canvotepolls", "cansearch");





// Include the installation resources
require_once INSTALL_ROOT."resources/output.php";
$output = new installerOutput;

// Include the installation resources
require_once INSTALL_ROOT."resources/output.php";
$output = new installerOutput;

Zeile 136Zeile 141
$output->title = "MyBB Upgrade Wizard";

if(file_exists("lock"))

$output->title = "MyBB Upgrade Wizard";

if(file_exists("lock"))

{

{

	$output->print_error($lang->locked);
}
else

	$output->print_error($lang->locked);
}
else

Zeile 152Zeile 157
		my_unsetcookie("mybbuser");
my_unsetcookie("sid");
if($mybb->user['uid'])

		my_unsetcookie("mybbuser");
my_unsetcookie("sid");
if($mybb->user['uid'])

		{
$time = TIME_NOW;

		{
$time = TIME_NOW;

			$lastvisit = array(
"lastactive" => $time-900,
"lastvisit" => $time,

			$lastvisit = array(
"lastactive" => $time-900,
"lastvisit" => $time,

Zeile 162Zeile 167
			$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 222Zeile 227
			<tr class="first">
<td class="first">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 class="first">
<td class="first">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>

			<tr class="alt_row last">
<td class="first">Password:<br /><small>Please note that passwords are case sensitive.</small></td>
<td class="last alt_col"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" /></td>

			<tr class="alt_row last">
<td class="first">Password:<br /><small>Please note that passwords are case sensitive.</small></td>
<td class="last alt_col"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" /></td>

Zeile 240Zeile 245
		exit;
}
else if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != 'yes')

		exit;
}
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("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.");
}


Zeile 257Zeile 262
			contents text NOT NULL,
UNIQUE (title)
);");

			contents text NOT NULL,
UNIQUE (title)
);");





		$dh = opendir(INSTALL_ROOT."resources");
while(($file = readdir($dh)) !== false)
{

		$dh = opendir(INSTALL_ROOT."resources");
while(($file = readdir($dh)) !== false)
{

Zeile 265Zeile 270
			{
$upgradescripts[$match[1]] = $file;
$key_order[] = $match[1];

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

			}
}

			}
}

		closedir($dh);
natsort($key_order);
$key_order = array_reverse($key_order);

		closedir($dh);
natsort($key_order);
$key_order = array_reverse($key_order);

Zeile 291Zeile 296
		}
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 336Zeile 342
	elseif($mybb->input['action'] == "buildcaches")
{
$runfunction = "buildcaches";

	elseif($mybb->input['action'] == "buildcaches")
{
$runfunction = "buildcaches";

	}

	}

	elseif($mybb->input['action'] == "finished")
{
$runfunction = "upgradedone";

	elseif($mybb->input['action'] == "finished")
{
$runfunction = "upgradedone";

Zeile 361Zeile 367
}

function upgradethemes()

}

function upgradethemes()

{

{

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

Zeile 566Zeile 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");