Vergleich install/upgrade.php - 1.4.0 - 1.4.1

  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 4052 2008-07-29 15:45:49Z Tikitiki $

 * $Id: upgrade.php 4120 2008-08-16 02:40:05Z Tikitiki $

 */
error_reporting(E_ALL & ~E_NOTICE);


 */
error_reporting(E_ALL & ~E_NOTICE);


Zeile 47Zeile 47
$lang->load('language');

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

$lang->load('language');

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

$db = new databaseEngine;

















switch($config['database']['type'])
{
case "sqlite3":
$db = new DB_SQLite3;
break;
case "sqlite2":
$db = new DB_SQLite2;
break;
case "pgsql":
$db = new DB_PgSQL;
break;
case "mysqli":
$db = new DB_MySQLi;
break;
default:
$db = new DB_MySQL;
}

	
// Connect to Database
define('TABLE_PREFIX', $config['database']['table_prefix']);

	
// Connect to Database
define('TABLE_PREFIX', $config['database']['table_prefix']);

Zeile 58Zeile 74
if(file_exists(MYBB_ROOT."inc/settings.php"))
{
require_once MYBB_ROOT."inc/settings.php";

if(file_exists(MYBB_ROOT."inc/settings.php"))
{
require_once MYBB_ROOT."inc/settings.php";

}


}


if(!file_exists(MYBB_ROOT."inc/settings.php") || !$settings)
{
if(function_exists('rebuild_settings'))

if(!file_exists(MYBB_ROOT."inc/settings.php") || !$settings)
{
if(function_exists('rebuild_settings'))

Zeile 80Zeile 96
			$settings[$setting['name']] = $setting['value'];
}
}

			$settings[$setting['name']] = $setting['value'];
}
}

}


}


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

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

Zeile 123Zeile 139
}
else
{

}
else
{

	if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")























	if($mybb->input['action'] == "logout" && $mybb->user['uid'])
{
// Check session ID if we have one
if($mybb->input['logoutkey'] != $mybb->user['logoutkey'])
{
$output->print_error("Your user ID could not be verified to log you out. This may have been because a malicious Javascript was attempting to log you out automatically. If you intended to log out, please click the Log Out button at the top menu.");
}

my_unsetcookie("mybbuser");
my_unsetcookie("sid");
if($mybb->user['uid'])
{
$time = TIME_NOW;
$lastvisit = array(
"lastactive" => $time-900,
"lastvisit" => $time,
);
$db->update_query("users", $lastvisit, "uid='".$mybb->user['uid']."'");
$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";


	{	
require_once MYBB_ROOT."inc/functions_user.php";


Zeile 136Zeile 174
		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.");

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

		}
else

		}
else

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

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

Zeile 196Zeile 234
	}
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.");

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

	}

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

	}

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

Zeile 312Zeile 350

{
$runfunction();


{
$runfunction();

	}
}


	}
}


function upgradethemes()
{
global $output, $db, $system_upgrade_detail, $lang, $mybb;

function upgradethemes()
{
global $output, $db, $system_upgrade_detail, $lang, $mybb;

Zeile 336Zeile 374
		  dateline int(10) NOT NULL default '0',
PRIMARY KEY (tid)
) TYPE=MyISAM;{$charset}");

		  dateline int(10) NOT NULL default '0',
PRIMARY KEY (tid)
) TYPE=MyISAM;{$charset}");

	}

	}


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


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

Zeile 362Zeile 400
			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};");

$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_themes.php";
}
else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))

		) TYPE=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"))
{
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_themes.php";
}

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

Zeile 402Zeile 440
			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_themes.php";
}
else

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

Zeile 483Zeile 521

function buildcaches()
{


function buildcaches()
{

	global $db, $output, $cache, $lang;

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


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



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


Zeile 579Zeile 617
}

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

}

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

{

{

	global $oldvers, $system_upgrade_detail, $currentscript;

load_module("upgrade".$from.".php");

	global $oldvers, $system_upgrade_detail, $currentscript;

load_module("upgrade".$from.".php");

Zeile 694Zeile 732
	$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 746Zeile 784
				$name = $db->escape_string($setting['attributes']['name']);
$db->update_query("settings", $settingdata, "name='{$name}'");
}

				$name = $db->escape_string($setting['attributes']['name']);
$db->update_query("settings", $settingdata, "name='{$name}'");
}

		}
}

foreach($settinggroups as $groupname)
{
if(!in_array($groupname, $settinggroupnames))
{
$db->delete_query("settinggroups", "gid='".$settinggroups[$groupname]."'", 1);
}
}

foreach($settings as $settingname)
{
if(!in_array($settingname, $settingnames))
{
$db->delete_query("settings", "sid='".$settings[$settingname]."'", 1);

 
		}
}


		}
}