Vergleich install/index.php - 1.6.8 - 1.6.10

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

 */

if(function_exists("unicode_decode"))

Zeile 162Zeile 162
		'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 206Zeile 206
function intro()
{
global $output, $mybb, $lang;

function intro()
{
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);
$output->print_footer('license');
}

		echo $lang->sprintf($lang->mybb_incorrect_folder);
}
echo $lang->sprintf($lang->welcome_step, $mybb->version);
$output->print_footer('license');
}





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 295
   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 423Zeile 423
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.

GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.





  When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for

  When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for

Zeile 1039Zeile 1039
	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 1058
	{
$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'))
{
$mboptions[] = 'iconv';
}

	if(function_exists('iconv'))
{
$mboptions[] = 'iconv';
}

	



	// Check Multibyte extensions
if(count($mboptions) < 1)
{
$mbstatus = $lang->sprintf($lang->req_step_span_fail, $lang->none);

	// Check Multibyte extensions
if(count($mboptions) < 1)
{
$mbstatus = $lang->sprintf($lang->req_step_span_fail, $lang->none);

	}
else

	}
else

	{
$mbstatus = implode(', ', $mboptions);

	{
$mbstatus = implode(', ', $mboptions);

	}

	}


// Check database engines
if(count($dboptions) < 1)


// Check database engines
if(count($dboptions) < 1)

Zeile 1099Zeile 1099
			$dbsupportlist[] = $dboption['title'];
}
$dbsupportlist = implode(', ', $dbsupportlist);

			$dbsupportlist[] = $dboption['title'];
}
$dbsupportlist = implode(', ', $dbsupportlist);

	}

	}


// Check XML parser is installed
if(!function_exists('xml_parser_create'))


// Check XML parser is installed
if(!function_exists('xml_parser_create'))

Zeile 1133Zeile 1133
	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_settingsfile);
$settingsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);

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

		$showerror = 1;
}
else
{
$settingsstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);

		$showerror = 1;
}
else
{
$settingsstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);

	}
@fclose($settingswritable);


	}
@fclose($settingswritable);


Zeile 1175Zeile 1175
	  	@my_chmod(MYBB_ROOT.'uploads', '0777');
@my_chmod(MYBB_ROOT.'uploads/test.write', '0777');
@unlink(MYBB_ROOT.'uploads/test.write');

	  	@my_chmod(MYBB_ROOT.'uploads', '0777');
@my_chmod(MYBB_ROOT.'uploads/test.write', '0777');
@unlink(MYBB_ROOT.'uploads/test.write');

	}

	}


// Check avatar directory is writable
$avatarswritable = @fopen(MYBB_ROOT.'uploads/avatars/test.write', 'w');
if(!$avatarswritable)


// Check avatar directory is writable
$avatarswritable = @fopen(MYBB_ROOT.'uploads/avatars/test.write', 'w');
if(!$avatarswritable)

	{

	{

		$errors[] =  $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir);
$avatarsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);
$showerror = 1;

		$errors[] =  $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir);
$avatarsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);
$showerror = 1;

Zeile 1194Zeile 1194
	  	@my_chmod(MYBB_ROOT.'uploads/avatars/test.write', '0777');
@unlink(MYBB_ROOT.'uploads/avatars/test.write');
}

	  	@my_chmod(MYBB_ROOT.'uploads/avatars/test.write', '0777');
@unlink(MYBB_ROOT.'uploads/avatars/test.write');
}





	// Output requirements page
echo $lang->sprintf($lang->req_step_reqtable, $phpversion, $dbsupportlist, $mbstatus, $xmlstatus, $configstatus, $settingsstatus, $cachestatus, $uploadsstatus, $avatarsstatus);

	// Output requirements page
echo $lang->sprintf($lang->req_step_reqtable, $phpversion, $dbsupportlist, $mbstatus, $xmlstatus, $configstatus, $settingsstatus, $cachestatus, $uploadsstatus, $avatarsstatus);





	if($showerror == 1)
{
$error_list = error_list($errors);

	if($showerror == 1)
{
$error_list = error_list($errors);

Zeile 1205Zeile 1205
		echo "\n			<input type=\"hidden\" name=\"action\" value=\"{$mybb->input['action']}\" />";
echo "\n <div id=\"next_button\"><input type=\"submit\" class=\"submit_button\" value=\"{$lang->recheck} &raquo;\" /></div><br style=\"clear: both;\" />\n";
$output->print_footer();

		echo "\n			<input type=\"hidden\" name=\"action\" value=\"{$mybb->input['action']}\" />";
echo "\n <div id=\"next_button\"><input type=\"submit\" class=\"submit_button\" value=\"{$lang->recheck} &raquo;\" /></div><br style=\"clear: both;\" />\n";
$output->print_footer();

	}

	}

	else
{
echo $lang->req_step_reqcomplete;

	else
{
echo $lang->req_step_reqcomplete;

Zeile 1216Zeile 1216
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 1250Zeile 1250
	{
echo $lang->db_step_config_db;
}

	{
echo $lang->db_step_config_db;
}

	



	// Loop through database engines
foreach($dboptions as $dbfile => $dbtype)
{
if($mybb->input['dbengine'] == $dbfile)

	// Loop through database engines
foreach($dboptions as $dbfile => $dbtype)
{
if($mybb->input['dbengine'] == $dbfile)

		{

		{

			$dbengines .= "<option value=\"{$dbfile}\" selected=\"selected\">{$dbtype['title']}</option>";

			$dbengines .= "<option value=\"{$dbfile}\" selected=\"selected\">{$dbtype['title']}</option>";

		}
else
{

		}
else
{

			$dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
}
}

			$dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
}
}

Zeile 1299Zeile 1299
				<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')
{

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

				<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 1374
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"))
{
$errors[] = $lang->db_step_error_invalidengine;
database_info();
}

	if(!file_exists(MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"))
{
$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($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))

	if(strstr($mybb->input['dbengine'], "sqlite") !== false)
{
if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))

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

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

Zeile 1445Zeile 1445
	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)

	{

	{

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

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

	



	// 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 1531Zeile 1531

/**
* 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 1556
	'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'];

Zeile 1610Zeile 1610
	echo $lang->sprintf($lang->populate_step_insert);

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

	echo $lang->sprintf($lang->populate_step_insert);

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

	{

	{

		$population_file = $dboptions[$db->type]['population_file'];
}
else
{
$population_file = 'mysql_db_inserts.php';

		$population_file = $dboptions[$db->type]['population_file'];
}
else
{
$population_file = 'mysql_db_inserts.php';

	}


	}


	require_once INSTALL_ROOT."resources/{$population_file}";
foreach($inserts as $val)
{

	require_once INSTALL_ROOT."resources/{$population_file}";
foreach($inserts as $val)
{

Zeile 1627Zeile 1627

// Update the sequences for PgSQL
if($config['database']['type'] == "pgsql")


// Update the sequences for PgSQL
if($config['database']['type'] == "pgsql")

	{

	{

		$db->query("SELECT setval('{$config['database']['table_prefix']}attachtypes_atid_seq', (SELECT max(atid) FROM {$config['database']['table_prefix']}attachtypes));");
$db->query("SELECT setval('{$config['database']['table_prefix']}forums_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}forums));");
$db->query("SELECT setval('{$config['database']['table_prefix']}helpdocs_hid_seq', (SELECT max(hid) FROM {$config['database']['table_prefix']}helpdocs));");

		$db->query("SELECT setval('{$config['database']['table_prefix']}attachtypes_atid_seq', (SELECT max(atid) FROM {$config['database']['table_prefix']}attachtypes));");
$db->query("SELECT setval('{$config['database']['table_prefix']}forums_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}forums));");
$db->query("SELECT setval('{$config['database']['table_prefix']}helpdocs_hid_seq', (SELECT max(hid) FROM {$config['database']['table_prefix']}helpdocs));");

Zeile 1638Zeile 1638
		$db->query("SELECT setval('{$config['database']['table_prefix']}spiders_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}spiders));");
$db->query("SELECT setval('{$config['database']['table_prefix']}templategroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}templategroups));");
}

		$db->query("SELECT setval('{$config['database']['table_prefix']}spiders_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}spiders));");
$db->query("SELECT setval('{$config['database']['table_prefix']}templategroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}templategroups));");
}





	echo $lang->populate_step_inserted;
$output->print_footer('templates');
}

function insert_templates()

	echo $lang->populate_step_inserted;
$output->print_footer('templates');
}

function insert_templates()

{

{

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

require MYBB_ROOT.'inc/config.php';

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

require MYBB_ROOT.'inc/config.php';

Zeile 1670Zeile 1670
	$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 1684
	}
$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"));
$properties['templateset'] = $templateset;
unset($properties['inherited']['templateset']);


	// 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"));
$properties['templateset'] = $templateset;
unset($properties['inherited']['templateset']);


	$db->update_query("themes", array("def" => 1, "properties" => $db->escape_string(serialize($properties))), "tid='{$tid}'");


	$db->update_query("themes", array("def" => 1, "properties" => $db->escape_string(serialize($properties))), "tid='{$tid}'");


	echo $lang->theme_step_imported;
$output->print_footer('configuration');
}

	echo $lang->theme_step_imported;
$output->print_footer('configuration');
}





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

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

		{

		{

			$cookiedomain = '';
}

			$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 1773
				$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 1792Zeile 1794
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 1999Zeile 2001

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;

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

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

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 2028
			{
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 2048
	}

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 2100Zeile 2102
		'usernotes' => ''
);
$db->insert_query('users', $newuser);

		'usernotes' => ''
);
$db->insert_query('users', $newuser);

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

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


echo $lang->done_step_adminoptions;
$adminoptions = file_get_contents(INSTALL_ROOT.'resources/adminoptions.xml');


echo $lang->done_step_adminoptions;
$adminoptions = file_get_contents(INSTALL_ROOT.'resources/adminoptions.xml');

Zeile 2108Zeile 2110
	$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 2188Zeile 2190
	$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 2202
	}
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 2241Zeile 2243
		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 2268
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))
{