Vergleich install/index.php - 1.6.8 - 1.6.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: index.php 5816 2012-04-23 15:42:18Z Tomm $

 * $Id$

 */

 */


if(function_exists("unicode_decode"))
{
// Unicode extension introduced in 6.0
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_STRICT);
}
elseif(defined("E_DEPRECATED"))
{
// E_DEPRECATED introduced in 5.3
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE);
}
else
{
error_reporting(E_ALL & ~E_NOTICE);
}

 

@set_time_limit(0);



@set_time_limit(0);


Zeile 36Zeile 21
{
date_default_timezone_set('GMT');
}

{
date_default_timezone_set('GMT');
}

 

require_once MYBB_ROOT.'inc/class_error.php';
$error_handler = new errorHandler();


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/class_error.php';
$error_handler = new errorHandler();

 

// Include the files necessary for installation
require_once MYBB_ROOT.'inc/class_timers.php';


// Include the files necessary for installation
require_once MYBB_ROOT.'inc/class_timers.php';

Zeile 91Zeile 76
$dboptions = array();

if(function_exists('mysqli_connect'))

$dboptions = array();

if(function_exists('mysqli_connect'))

{

{

	$dboptions['mysqli'] = array(
'class' => 'DB_MySQLi',
'title' => 'MySQL Improved',

	$dboptions['mysqli'] = array(
'class' => 'DB_MySQLi',
'title' => 'MySQL Improved',

Zeile 162Zeile 147
		'adminuser' => $lang->admin_user,
'final' => $lang->finish_setup,
);

		'adminuser' => $lang->admin_user,
'final' => $lang->finish_setup,
);

	



	if(!isset($mybb->input['action']))
{
$mybb->input['action'] = 'intro';
}

	if(!isset($mybb->input['action']))
{
$mybb->input['action'] = 'intro';
}

	



	switch($mybb->input['action'])
{
case 'license':

	switch($mybb->input['action'])
{
case 'license':

Zeile 178Zeile 163
			break;
case 'database_info':
database_info();

			break;
case 'database_info':
database_info();

			break;

			break;

		case 'create_tables':
create_tables();
break;

		case 'create_tables':
create_tables();
break;

Zeile 193Zeile 178
			break;
case 'adminuser';
create_admin_user();

			break;
case 'adminuser';
create_admin_user();

			break;

			break;

		case 'final':
install_done();

		case 'final':
install_done();

			break;

			break;

		default:
intro();
break;

		default:
intro();
break;

	}

	}

}

function intro()

}

function intro()

{

{

	global $output, $mybb, $lang;

	global $output, $mybb, $lang;

	



	$output->print_header($lang->welcome, 'welcome');
if(strpos(strtolower($_SERVER['PHP_SELF']), "upload/") !== false)

	$output->print_header($lang->welcome, 'welcome');
if(strpos(strtolower($_SERVER['PHP_SELF']), "upload/") !== false)

	{

	{

		echo $lang->sprintf($lang->mybb_incorrect_folder);
}
echo $lang->sprintf($lang->welcome_step, $mybb->version);

		echo $lang->sprintf($lang->mybb_incorrect_folder);
}
echo $lang->sprintf($lang->welcome_step, $mybb->version);

Zeile 219Zeile 204
function license_agreement()
{
global $output, $lang, $mybb;

function license_agreement()
{
global $output, $lang, $mybb;

	



	ob_start();
$output->print_header($lang->license_agreement, 'license');

	ob_start();
$output->print_header($lang->license_agreement, 'license');

	



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

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

		



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

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

Zeile 295Zeile 280
   ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

   ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or





   b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.


   b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.


Zeile 1039Zeile 1024
	echo $lang->req_step_top;
$errors = array();
$showerror = 0;

	echo $lang->req_step_top;
$errors = array();
$showerror = 0;

	



	if(!file_exists(MYBB_ROOT."/inc/config.php"))
{
if(!@rename(MYBB_ROOT."/inc/config.default.php", MYBB_ROOT."/inc/config.php"))

	if(!file_exists(MYBB_ROOT."/inc/config.php"))
{
if(!@rename(MYBB_ROOT."/inc/config.default.php", MYBB_ROOT."/inc/config.php"))

Zeile 1058Zeile 1043
	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->sprintf($lang->req_step_error_phpversion, PHP_VERSION));
$phpversion = $lang->sprintf($lang->req_step_span_fail, PHP_VERSION);

	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->sprintf($lang->req_step_error_phpversion, PHP_VERSION));
$phpversion = $lang->sprintf($lang->req_step_span_fail, PHP_VERSION);

		$showerror = 1;
}

		$showerror = 1;
}

	else

	else

	{

	{

		$phpversion = $lang->sprintf($lang->req_step_span_pass, PHP_VERSION);

		$phpversion = $lang->sprintf($lang->req_step_span_pass, PHP_VERSION);

	}


	}


	if(function_exists('mb_detect_encoding'))
{
$mboptions[] = $lang->multi_byte;
}

	if(function_exists('mb_detect_encoding'))
{
$mboptions[] = $lang->multi_byte;
}

	



	if(function_exists('iconv'))

	if(function_exists('iconv'))

	{

	{

		$mboptions[] = 'iconv';
}

		$mboptions[] = 'iconv';
}

	



	// Check Multibyte extensions
if(count($mboptions) < 1)
{

	// Check Multibyte extensions
if(count($mboptions) < 1)
{

Zeile 1090Zeile 1075
	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_dboptions);
$dbsupportlist = $lang->sprintf($lang->req_step_span_fail, $lang->none);

	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_dboptions);
$dbsupportlist = $lang->sprintf($lang->req_step_span_fail, $lang->none);

		$showerror = 1;
}
else

		$showerror = 1;
}
else

	{
foreach($dboptions as $dboption)
{

	{
foreach($dboptions as $dboption)
{

Zeile 1119Zeile 1104
	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_configfile);
$configstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);

	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_configfile);
$configstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);

		$showerror = 1;
}
else

		$showerror = 1;
}
else

	{
$configstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
}

	{
$configstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
}

Zeile 1216Zeile 1201
function database_info()
{
global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;

function database_info()
{
global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;

	



	$mybb->input['action'] = 'database_info';
$output->print_header($lang->db_config, 'dbconfig');


	$mybb->input['action'] = 'database_info';
$output->print_header($lang->db_config, 'dbconfig');


Zeile 1225Zeile 1210
		{
dbengine = \$('dbengine').options[\$('dbengine').selectedIndex].value;
$$('.db_settings').each(function(element)

		{
dbengine = \$('dbengine').options[\$('dbengine').selectedIndex].value;
$$('.db_settings').each(function(element)

			{

			{

				element.className = 'db_settings';
if(dbengine+'_settings' == element.id)

				element.className = 'db_settings';
if(dbengine+'_settings' == element.id)

				{

				{

					Element.show(element);
}
else

					Element.show(element);
}
else

Zeile 1250Zeile 1235
	{
echo $lang->db_step_config_db;
}

	{
echo $lang->db_step_config_db;
}

	



	// Loop through database engines
foreach($dboptions as $dbfile => $dbtype)
{

	// Loop through database engines
foreach($dboptions as $dbfile => $dbtype)
{

Zeile 1299Zeile 1284
				<tr>
<th colspan=\"2\" class=\"first last\">{$dbtype['title']} {$lang->database_settings}</th>
</tr>";

				<tr>
<th colspan=\"2\" class=\"first last\">{$dbtype['title']} {$lang->database_settings}</th>
</tr>";

			



		// SQLite gets some special settings
if($dbfile == 'sqlite')

		// SQLite gets some special settings
if($dbfile == 'sqlite')

		{

		{

			$db_info[$dbfile] .= "
<tr class=\"alt_row\">
<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_path}</label></td>

			$db_info[$dbfile] .= "
<tr class=\"alt_row\">
<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_path}</label></td>

					<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td>

					<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td>

				</tr>";
}
// Others get db host, username, password etc
else
{
$db_info[$dbfile] .= "

				</tr>";
}
// Others get db host, username, password etc
else
{
$db_info[$dbfile] .= "

				<tr class=\"alt_row\">

				<tr class=\"alt_row\">

					<td class=\"first\"><label for=\"config_{$dbfile}_dbhost\">{$lang->database_host}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbhost]\" id=\"config_{$dbfile}_dbhost\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbhost'])."\" /></td>
</tr>

					<td class=\"first\"><label for=\"config_{$dbfile}_dbhost\">{$lang->database_host}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbhost]\" id=\"config_{$dbfile}_dbhost\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbhost'])."\" /></td>
</tr>

Zeile 1329Zeile 1314
					<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_name}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td>
</tr>";

					<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_name}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td>
</tr>";

		}


		}


		// Now we're up to table settings
$db_info[$dbfile] .= "
<tr>
<th colspan=\"2\" class=\"first last\">{$dbtype['title']} {$lang->table_settings}</th>

		// Now we're up to table settings
$db_info[$dbfile] .= "
<tr>
<th colspan=\"2\" class=\"first last\">{$dbtype['title']} {$lang->table_settings}</th>

			</tr>

			</tr>

			<tr class=\"first\">
<td class=\"first\"><label for=\"config_{$dbfile}_tableprefix\">{$lang->table_prefix}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][tableprefix]\" id=\"config_{$dbfile}_tableprefix\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['tableprefix'])."\" /></td>
</tr>
";

			<tr class=\"first\">
<td class=\"first\"><label for=\"config_{$dbfile}_tableprefix\">{$lang->table_prefix}</label></td>
<td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][tableprefix]\" id=\"config_{$dbfile}_tableprefix\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['tableprefix'])."\" /></td>
</tr>
";

		



		// Encoding selection only if supported
if(is_array($encodings))
{

		// Encoding selection only if supported
if(is_array($encodings))
{

Zeile 1374Zeile 1359
function create_tables()
{
global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;

function create_tables()
{
global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;

	



	if(!file_exists(MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"))

	if(!file_exists(MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"))

	{

	{

		$errors[] = $lang->db_step_error_invalidengine;
database_info();

		$errors[] = $lang->db_step_error_invalidengine;
database_info();

	}



	}

$config = $mybb->input['config'][$mybb->input['dbengine']];





	$config = $mybb->input['config'][$mybb->input['dbengine']];


 
	if(strstr($mybb->input['dbengine'], "sqlite") !== false)

	if(strstr($mybb->input['dbengine'], "sqlite") !== false)

	{

	{

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))
{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))
{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;

Zeile 1395Zeile 1380
	// Attempt to connect to the db
require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php";
switch($mybb->input['dbengine'])

	// Attempt to connect to the db
require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php";
switch($mybb->input['dbengine'])

	{
case "sqlite":
$db = new DB_SQLite;
break;
case "pgsql":
$db = new DB_PgSQL;
break;

	{
case "sqlite":
$db = new DB_SQLite;
break;
case "pgsql":
$db = new DB_PgSQL;
break;

		case "mysqli":
$db = new DB_MySQLi;
break;

		case "mysqli":
$db = new DB_MySQLi;
break;

Zeile 1409Zeile 1394
			$db = new DB_MySQL;
}
$db->error_reporting = 0;

			$db = new DB_MySQL;
}
$db->error_reporting = 0;





	$connect_array = array(
"hostname" => $config['dbhost'],
"username" => $config['dbuser'],

	$connect_array = array(
"hostname" => $config['dbhost'],
"username" => $config['dbuser'],

Zeile 1417Zeile 1402
		"database" => $config['dbname'],
"encoding" => $config['encoding']
);

		"database" => $config['dbname'],
"encoding" => $config['encoding']
);





	$connection = $db->connect($connect_array);
if($connection === false)
{

	$connection = $db->connect($connect_array);
if($connection === false)
{

Zeile 1425Zeile 1410
	}
// double check if the DB exists for MySQL
elseif(method_exists($db, 'select_db') && !$db->select_db($config['dbname']))

	}
// double check if the DB exists for MySQL
elseif(method_exists($db, 'select_db') && !$db->select_db($config['dbname']))

	{

	{

		$errors[] = $lang->sprintf($lang->db_step_error_nodbname, $config['dbname']);
}

		$errors[] = $lang->sprintf($lang->db_step_error_nodbname, $config['dbname']);
}

	



	// Most DB engines only allow certain characters in the table name. Oracle requires an alphabetic character first.
if((!preg_match("#^[A-Za-z][A-Za-z0-9_]*$#", $config['tableprefix'])) && $config['tableprefix'] != '')
{
$errors[] = $lang->db_step_error_invalid_tableprefix;
}

	// Most DB engines only allow certain characters in the table name. Oracle requires an alphabetic character first.
if((!preg_match("#^[A-Za-z][A-Za-z0-9_]*$#", $config['tableprefix'])) && $config['tableprefix'] != '')
{
$errors[] = $lang->db_step_error_invalid_tableprefix;
}

	



	// Needs to be smaller then 64 characters total (MySQL Limit).
// This allows 24 characters for the actual table name, which should be sufficient.
if(strlen($config['tableprefix']) > 40)
{
$errors[] = $lang->db_step_error_tableprefix_too_long;

	// Needs to be smaller then 64 characters total (MySQL Limit).
// This allows 24 characters for the actual table name, which should be sufficient.
if(strlen($config['tableprefix']) > 40)
{
$errors[] = $lang->db_step_error_tableprefix_too_long;

 
	}

if(($db->engine == 'mysql' || $db->engine == 'mysqli') && $config['encoding'] == 'utf8mb4' && version_compare($db->get_version(), '5.5.3', '<'))
{
$errors[] = $lang->db_step_error_utf8mb4_error;

	}

if(is_array($errors))
{
database_info();

	}

if(is_array($errors))
{
database_info();

	}


	}


	// Decide if we can use a database encoding or not
if($db->fetch_db_charsets() != false)
{

	// Decide if we can use a database encoding or not
if($db->fetch_db_charsets() != false)
{

Zeile 1456Zeile 1446
	{
$db_encoding = "// \$config['database']['encoding'] = '{$config['encoding']}';";
}

	{
$db_encoding = "// \$config['database']['encoding'] = '{$config['encoding']}';";
}

	




$config['dbpass'] = addslashes($config['dbpass']);


	// Write the configuration file
$configdata = "<?php
/**
* Database configuration
*

	// Write the configuration file
$configdata = "<?php
/**
* Database configuration
*

 * Please see the MyBB Wiki for advanced

 * Please see the MyBB Docs for advanced

 * database configuration for larger installations

 * database configuration for larger installations

 * http://wiki.mybb.com/

 * http://docs.mybb.com/

 */

\$config['database']['type'] = '{$mybb->input['dbengine']}';

 */

\$config['database']['type'] = '{$mybb->input['dbengine']}';

Zeile 1474Zeile 1466
\$config['database']['hostname'] = '{$config['dbhost']}';
\$config['database']['username'] = '{$config['dbuser']}';
\$config['database']['password'] = '{$config['dbpass']}';

\$config['database']['hostname'] = '{$config['dbhost']}';
\$config['database']['username'] = '{$config['dbuser']}';
\$config['database']['password'] = '{$config['dbpass']}';


/**


/**

 * Admin CP directory
* For security reasons, it is recommended you
* rename your Admin CP directory. You then need

 * Admin CP directory
* For security reasons, it is recommended you
* rename your Admin CP directory. You then need

Zeile 1531Zeile 1523

/**
* Database Encoding


/**
* Database Encoding

 *  If you wish to set an encoding for MyBB uncomment 

 *  If you wish to set an encoding for MyBB uncomment

 *  the line below (if it isn't already) and change
* the current value to the mysql charset:
* http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html

 *  the line below (if it isn't already) and change
* the current value to the mysql charset:
* http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html

Zeile 1556Zeile 1548
	'user_mail_logs' => 180, // User mail logs
'promotion_logs' => 180 // Promotion logs
);

	'user_mail_logs' => 180, // User mail logs
'promotion_logs' => 180 // Promotion logs
);

 



?>";

$file = fopen(MYBB_ROOT.'inc/config.php', 'w');
fwrite($file, $configdata);
fclose($file);

?>";

$file = fopen(MYBB_ROOT.'inc/config.php', 'w');
fwrite($file, $configdata);
fclose($file);





	// Error reporting back on
$db->error_reporting = 1;

	// Error reporting back on
$db->error_reporting = 1;





	$output->print_header($lang->table_creation, 'createtables');
echo $lang->sprintf($lang->tablecreate_step_connected, $dboptions[$mybb->input['dbengine']]['short_title'], $db->get_version());

	$output->print_header($lang->table_creation, 'createtables');
echo $lang->sprintf($lang->tablecreate_step_connected, $dboptions[$mybb->input['dbengine']]['short_title'], $db->get_version());

	



	if($dboptions[$mybb->input['dbengine']]['structure_file'])
{
$structure_file = $dboptions[$mybb->input['dbengine']]['structure_file'];

	if($dboptions[$mybb->input['dbengine']]['structure_file'])
{
$structure_file = $dboptions[$mybb->input['dbengine']]['structure_file'];

	}

	}

	else
{
$structure_file = 'mysql_db_tables.php';

	else
{
$structure_file = 'mysql_db_tables.php';

Zeile 1580Zeile 1572

require_once INSTALL_ROOT."resources/{$structure_file}";
foreach($tables as $val)


require_once INSTALL_ROOT."resources/{$structure_file}";
foreach($tables as $val)

	{

	{

		$val = preg_replace('#mybb_(\S+?)([\s\.,\(]|$)#', $config['tableprefix'].'\\1\\2', $val);
$val = preg_replace('#;$#', $db->build_create_table_collation().";", $val);
preg_match('#CREATE TABLE (\S+)(\s?|\(?)\(#i', $val, $match);

		$val = preg_replace('#mybb_(\S+?)([\s\.,\(]|$)#', $config['tableprefix'].'\\1\\2', $val);
$val = preg_replace('#;$#', $db->build_create_table_collation().";", $val);
preg_match('#CREATE TABLE (\S+)(\s?|\(?)\(#i', $val, $match);

Zeile 1612Zeile 1604
	if($dboptions[$db->type]['population_file'])
{
$population_file = $dboptions[$db->type]['population_file'];

	if($dboptions[$db->type]['population_file'])
{
$population_file = $dboptions[$db->type]['population_file'];

	}
else
{

	}
else
{

		$population_file = 'mysql_db_inserts.php';
}


		$population_file = 'mysql_db_inserts.php';
}


Zeile 1670Zeile 1662
	$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');
if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
{

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

		require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
}
elseif(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{

		require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
}
elseif(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{

 
		require_once MYBB_ROOT."admin/inc/functions.php";

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

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

Zeile 1682Zeile 1676
	}
$theme_id = import_theme_xml($contents, array("templateset" => -2, "version_compat" => 1));
$tid = build_new_theme("Default", null, $theme_id);

	}
$theme_id = import_theme_xml($contents, array("templateset" => -2, "version_compat" => 1));
$tid = build_new_theme("Default", null, $theme_id);

	



	// Update our properties template set to the correct one
$query = $db->simple_select("themes", "properties", "tid='{$tid}'", array('limit' => 1));
$properties = unserialize($db->fetch_field($query, "properties"));

	// Update our properties template set to the correct one
$query = $db->simple_select("themes", "properties", "tid='{$tid}'", array('limit' => 1));
$properties = unserialize($db->fetch_field($query, "properties"));

Zeile 1698Zeile 1692
function configure()
{
global $output, $mybb, $errors, $lang;

function configure()
{
global $output, $mybb, $errors, $lang;

	



	$output->print_header($lang->board_config, 'config');

// If board configuration errors

	$output->print_header($lang->board_config, 'config');

// If board configuration errors

Zeile 1707Zeile 1701
		$error_list = error_list($errors);
echo $lang->sprintf($lang->config_step_error_config, $error_list);


		$error_list = error_list($errors);
echo $lang->sprintf($lang->config_step_error_config, $error_list);


		$bbname = htmlspecialchars($mybb->input['bbname']);
$bburl = htmlspecialchars($mybb->input['bburl']);
$websitename = htmlspecialchars($mybb->input['websitename']);
$websiteurl = htmlspecialchars($mybb->input['websiteurl']);
$cookiedomain = htmlspecialchars($mybb->input['cookiedomain']);
$cookiepath = htmlspecialchars($mybb->input['cookiepath']);
$contactemail = htmlspecialchars($mybb->input['contactemail']);

		$bbname = htmlspecialchars_uni($mybb->input['bbname']);
$bburl = htmlspecialchars_uni($mybb->input['bburl']);
$websitename = htmlspecialchars_uni($mybb->input['websitename']);
$websiteurl = htmlspecialchars_uni($mybb->input['websiteurl']);
$cookiedomain = htmlspecialchars_uni($mybb->input['cookiedomain']);
$cookiepath = htmlspecialchars_uni($mybb->input['cookiepath']);
$contactemail = htmlspecialchars_uni($mybb->input['contactemail']);

	}
else
{

	}
else
{

Zeile 1741Zeile 1735
			$hostname = $protocol.$_SERVER['SERVER_NAME'];
$cookiedomain = '.'.$_SERVER['SERVER_NAME'];
}

			$hostname = $protocol.$_SERVER['SERVER_NAME'];
$cookiedomain = '.'.$_SERVER['SERVER_NAME'];
}

		



		if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);

		if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);

		}


		}


		if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost' || ip2long($_SERVER['SERVER_NAME']) != false)
{
$cookiedomain = '';

		if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost' || ip2long($_SERVER['SERVER_NAME']) != false)
{
$cookiedomain = '';

		}


		}


		if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && !preg_match("#:[0-9]#i", $hostname))
{
$hostname .= ':'.$_SERVER['SERVER_PORT'];

		if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && !preg_match("#:[0-9]#i", $hostname))
{
$hostname .= ':'.$_SERVER['SERVER_PORT'];

		}


		}


		$currentlocation = get_current_location();
if($currentlocation)
{

		$currentlocation = get_current_location();
if($currentlocation)
{

Zeile 1771Zeile 1765
				$cookiepath = my_substr($currentlocation, 0, $pos).'/';
}
}

				$cookiepath = my_substr($currentlocation, 0, $pos).'/';
}
}

		



		$currentscript = $hostname.get_current_location();

		$currentscript = $hostname.get_current_location();

		



		if($currentscript)
{
$bburl = my_substr($currentscript, 0, my_strpos($currentscript, '/install/'));

		if($currentscript)
{
$bburl = my_substr($currentscript, 0, my_strpos($currentscript, '/install/'));

		}


		}


		if($_SERVER['SERVER_ADMIN'])
{
$contactemail = $_SERVER['SERVER_ADMIN'];

		if($_SERVER['SERVER_ADMIN'])
{
$contactemail = $_SERVER['SERVER_ADMIN'];

Zeile 1788Zeile 1782
	echo $lang->sprintf($lang->config_step_table, $bbname, $bburl, $websitename, $websiteurl, $cookiedomain, $cookiepath, $contactemail);
$output->print_footer('adminuser');
}

	echo $lang->sprintf($lang->config_step_table, $bbname, $bburl, $websitename, $websiteurl, $cookiedomain, $cookiepath, $contactemail);
$output->print_footer('adminuser');
}





function create_admin_user()
{
global $output, $mybb, $errors, $db, $lang;

function create_admin_user()
{
global $output, $mybb, $errors, $db, $lang;

	



	$mybb->input['action'] = "adminuser";
// If no errors then check for errors from last step
if(!is_array($errors))

	$mybb->input['action'] = "adminuser";
// If no errors then check for errors from last step
if(!is_array($errors))

Zeile 1844Zeile 1838
			$gid = $db->insert_query('settinggroups', $groupdata);
++$groupcount;
foreach($settinggroup['setting'] as $setting)

			$gid = $db->insert_query('settinggroups', $groupdata);
++$groupcount;
foreach($settinggroup['setting'] as $setting)

			{

			{

				$settingdata = array(
'name' => $db->escape_string($setting['attributes']['name']),
'title' => $db->escape_string($setting['title'][0]['value']),

				$settingdata = array(
'name' => $db->escape_string($setting['attributes']['name']),
'title' => $db->escape_string($setting['title'][0]['value']),

Zeile 1975Zeile 1969
function install_done()
{
global $output, $db, $mybb, $errors, $cache, $lang;

function install_done()
{
global $output, $db, $mybb, $errors, $cache, $lang;





	if(empty($mybb->input['adminuser']))
{
$errors[] = $lang->admin_step_error_nouser;

	if(empty($mybb->input['adminuser']))
{
$errors[] = $lang->admin_step_error_nouser;

	}

	}

	if(empty($mybb->input['adminpass']))
{
$errors[] = $lang->admin_step_error_nopassword;

	if(empty($mybb->input['adminpass']))
{
$errors[] = $lang->admin_step_error_nopassword;

	}

	}

	if($mybb->input['adminpass'] != $mybb->input['adminpass2'])
{
$errors[] = $lang->admin_step_error_nomatch;

	if($mybb->input['adminpass'] != $mybb->input['adminpass2'])
{
$errors[] = $lang->admin_step_error_nomatch;

Zeile 1999Zeile 1993

require MYBB_ROOT.'inc/config.php';
$db = db_connection($config);


require MYBB_ROOT.'inc/config.php';
$db = db_connection($config);

	



	require MYBB_ROOT.'inc/settings.php';
$mybb->settings = &$settings;

	require MYBB_ROOT.'inc/settings.php';
$mybb->settings = &$settings;





	ob_start();
$output->print_header($lang->finish_setup, 'finish');

	ob_start();
$output->print_header($lang->finish_setup, 'finish');

	



	echo $lang->done_step_usergroupsinserted;

	echo $lang->done_step_usergroupsinserted;

	
// Insert all of our user groups from the XML file


// Insert all of our user groups from the XML file

	$usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
$parser = new XMLParser($usergroup_settings);
$parser->collapse_dups = 0;

	$usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
$parser = new XMLParser($usergroup_settings);
$parser->collapse_dups = 0;

Zeile 2026Zeile 2020
			{
continue;
}

			{
continue;
}

			



			$new_group[$key] = $db->escape_string($value[0]['value']);
}
$db->insert_query("usergroups", $new_group, false);

			$new_group[$key] = $db->escape_string($value[0]['value']);
}
$db->insert_query("usergroups", $new_group, false);

		



		// If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)
if($new_group['cancp'] == 1 && !$admin_gid)
{

		// If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)
if($new_group['cancp'] == 1 && !$admin_gid)
{

Zeile 2046Zeile 2040
	}

echo $lang->done . '</p>';

	}

echo $lang->done . '</p>';

	



	echo $lang->done_step_admincreated;
$now = TIME_NOW;
$salt = random_str();

	echo $lang->done_step_admincreated;
$now = TIME_NOW;
$salt = random_str();

Zeile 2108Zeile 2102
	$parser->collapse_dups = 0;
$tree = $parser->get_tree();
$insertmodule = array();

	$parser->collapse_dups = 0;
$tree = $parser->get_tree();
$insertmodule = array();

	



	$db->delete_query("adminoptions");

	$db->delete_query("adminoptions");

	



	// Insert all the admin permissions
foreach($tree['adminoptions'][0]['user'] as $users)

	// Insert all the admin permissions
foreach($tree['adminoptions'][0]['user'] as $users)

	{			

	{

		$uid = $users['attributes']['uid'];

		$uid = $users['attributes']['uid'];

		



		foreach($users['permissions'][0]['module'] as $module)
{
foreach($module['permission'] as $permission)
{
$insertmodule[$module['attributes']['name']][$permission['attributes']['name']] = $permission['value'];
}

		foreach($users['permissions'][0]['module'] as $module)
{
foreach($module['permission'] as $permission)
{
$insertmodule[$module['attributes']['name']][$permission['attributes']['name']] = $permission['value'];
}

		}


		}


		$defaultviews = array();
foreach($users['defaultviews'][0]['view'] as $view)
{
$defaultviews[$view['attributes']['type']] = $view['value'];
}

		$defaultviews = array();
foreach($users['defaultviews'][0]['view'] as $view)
{
$defaultviews[$view['attributes']['type']] = $view['value'];
}

		



		$adminoptiondata = array(
'uid' => intval($uid),
'cpstyle' => '',

		$adminoptiondata = array(
'uid' => intval($uid),
'cpstyle' => '',

Zeile 2137Zeile 2131
			'permissions' => $db->escape_string(serialize($insertmodule)),
'defaultviews' => $db->escape_string(serialize($defaultviews))
);

			'permissions' => $db->escape_string(serialize($insertmodule)),
'defaultviews' => $db->escape_string(serialize($defaultviews))
);





		$insertmodule = array();

$db->insert_query('adminoptions', $adminoptiondata);

		$insertmodule = array();

$db->insert_query('adminoptions', $adminoptiondata);

	}

	}

	echo $lang->done . '</p>';

// Automatic Login

	echo $lang->done . '</p>';

// Automatic Login

Zeile 2158Zeile 2152
	if($db->supports_fulltext_boolean('posts'))
{
$db->create_fulltext_index('posts', 'message');

	if($db->supports_fulltext_boolean('posts'))
{
$db->create_fulltext_index('posts', 'message');

	}

	}


echo $lang->done_step_cachebuilding;
require_once MYBB_ROOT.'inc/class_datacache.php';


echo $lang->done_step_cachebuilding;
require_once MYBB_ROOT.'inc/class_datacache.php';

Zeile 2188Zeile 2182
	$cache->update_forumsdisplay();
$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));

	$cache->update_forumsdisplay();
$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));

	



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

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

Zeile 2200Zeile 2194
	}
sort($version_history, SORT_NUMERIC);
$cache->update("version_history", $version_history);

	}
sort($version_history, SORT_NUMERIC);
$cache->update("version_history", $version_history);

	



	echo $lang->done . '</p>';

echo $lang->done_step_success;

	echo $lang->done . '</p>';

echo $lang->done_step_success;

Zeile 2220Zeile 2214
	{
echo $lang->done_step_dirdelete;
}

	{
echo $lang->done_step_dirdelete;
}

	echo $lang->done_subscribe_mailing;

	echo $lang->done_whats_next;

	$output->print_footer('');
}


	$output->print_footer('');
}


Zeile 2241Zeile 2235
		default:
$db = new DB_MySQL;
}

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





	$db->connect($config['database']);
$db->set_table_prefix(TABLE_PREFIX);
$db->type = $config['database']['type'];

	$db->connect($config['database']);
$db->set_table_prefix(TABLE_PREFIX);
$db->type = $config['database']['type'];

	



	return $db;

	return $db;

}


}


function error_list($array)
{
$string = "<ul>\n";

function error_list($array)
{
$string = "<ul>\n";

Zeile 2266Zeile 2260
function write_settings()
{
global $db;

function write_settings()
{
global $db;

	



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