Vergleich install/index.php - 1.8.4 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 65Zeile 65
// Prevent any shut down functions from running
$done_shutdown = 1;


// Prevent any shut down functions from running
$done_shutdown = 1;


// Include the necessary contants for installation

// Include the necessary constants for installation

$grouppermignore = array('gid', 'type', 'title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');

$grouppermignore = array('gid', 'type', 'title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');

$groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperthread');

$groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperuser', 'maxreputationsperthread', 'emailfloodtime');

$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');
$fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');


$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');
$fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');


Zeile 186Zeile 186
	}
}


	}
}


 
/**
* Welcome page
*/

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


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


	$output->print_header($lang->welcome, 'welcome');

	$output->print_header();

	if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)
{
echo $lang->sprintf($lang->mybb_incorrect_folder);

	if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)
{
echo $lang->sprintf($lang->mybb_incorrect_folder);

Zeile 199Zeile 202
	$output->print_footer('license');
}


	$output->print_footer('license');
}


 
/**
* Show the license agreement
*/

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

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

Zeile 221Zeile 227
	$license = <<<EOF
<pre>
GNU LESSER GENERAL PUBLIC LICENSE

	$license = <<<EOF
<pre>
GNU LESSER GENERAL PUBLIC LICENSE

                       Version 3, 29 June 2007

                       Version 3, 29 June 2007


Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.



Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.






  This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

  This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

Zeile 255Zeile 261
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.





  The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

  The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.





  1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License

  1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License

Zeile 273Zeile 279
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:





   a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs

   a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs

Zeile 290Zeile 296
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:





   a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

   a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

Zeile 358Zeile 364
   a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

   a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.





   b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

   b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

Zeile 461Zeile 467
  0. Definitions.

"This License" refers to version 3 of the GNU General Public License.

  0. Definitions.

"This License" refers to version 3 of the GNU General Public License.





  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.


  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.


Zeile 1013Zeile 1019
	$output->print_footer('requirements_check');
}


	$output->print_footer('requirements_check');
}


 
/**
* Check our requirements
*/

function requirements_check()
{
global $output, $mybb, $dboptions, $lang;

function requirements_check()
{
global $output, $mybb, $dboptions, $lang;

Zeile 1058Zeile 1067
	if(function_exists('iconv'))
{
$mboptions[] = 'iconv';

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

	}


	}


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

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

Zeile 1104Zeile 1113
	{
$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;
}

		$showerror = 1;
}

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

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

Zeile 1150Zeile 1159
	{
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_uploaddir);
$uploadsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable);

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

		$showerror = 1;
@fclose($uploadswritable);

		$showerror = 1;
@fclose($uploadswritable);

	}
else
{

	}
else
{

Zeile 1198Zeile 1207
	}
}


	}
}


 
/**
* Which database do we use?
*/

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

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

Zeile 1376Zeile 1388
	$output->print_footer('create_tables');
}


	$output->print_footer('create_tables');
}


 
/**
* Create our tables
*/

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

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

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

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

		$errors[] = $lang->sprintf($lang->db_step_error_noconnect, $config['dbhost']);

		$errors[] = $lang->sprintf($lang->db_step_error_noconnect, htmlspecialchars_uni($config['dbhost']));

	}
// 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, htmlspecialchars_uni($config['dbname']));

	}

// Most DB engines only allow certain characters in the table name. Oracle requires an alphabetic character first.

	}

// Most DB engines only allow certain characters in the table name. Oracle requires an alphabetic character first.

Zeile 1447Zeile 1462
	if(strlen($config['tableprefix']) > 40)
{
$errors[] = $lang->db_step_error_tableprefix_too_long;

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


if(is_array($errors))

	{

	{

		database_info();

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

		$db_encoding = "\$config['database']['encoding'] = '".addcslashes($config['encoding'], "'")."';";

	}
else
{

	}
else
{

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

		$db_encoding = "// \$config['database']['encoding'] = '".addcslashes($config['encoding'], "'")."';";

	}

	}


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

 

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


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

/**

/**

 * Database configuration
*
* Please see the MyBB Docs for advanced
* database configuration for larger installations

 * Database configuration
*
* Please see the MyBB Docs for advanced
* database configuration for larger installations

 * http://docs.mybb.com/

 * https://docs.mybb.com/

 */


 */


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

\$config['database']['type'] = '".addcslashes($mybb->input['dbengine'], "'")."';
\$config['database']['database'] = '".addcslashes($config['dbname'], "'")."';
\$config['database']['table_prefix'] = '".addcslashes($config['tableprefix'], "'")."';





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

\$config['database']['hostname'] = '".addcslashes($config['dbhost'], "'")."';
\$config['database']['username'] = '".addcslashes($config['dbuser'], "'")."';
\$config['database']['password'] = '".addcslashes($config['dbpass'], "'")."';


/**
* Admin CP directory


/**
* Admin CP directory

Zeile 1549Zeile 1562
 *  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

 */

 */


{$db_encoding}


{$db_encoding}





/**
* Automatic Log Pruning
* The MyBB task system can automatically prune

/**
* Automatic Log Pruning
* The MyBB task system can automatically prune

Zeile 1560Zeile 1573
 *  To enable this functionality for the logs below, set the
* the number of days before each log should be pruned.
* If you set the value to 0, the logs will not be pruned.

 *  To enable this functionality for the logs below, set the
* the number of days before each log should be pruned.
* If you set the value to 0, the logs will not be pruned.

 */


 */


\$config['log_pruning'] = array(
'admin_logs' => 365, // Administrator logs
'mod_logs' => 365, // Moderator logs

\$config['log_pruning'] = array(
'admin_logs' => 365, // Administrator logs
'mod_logs' => 365, // Moderator logs

Zeile 1569Zeile 1582
	'mail_logs' => 180, // Mail error logs
'user_mail_logs' => 180, // User mail logs
'promotion_logs' => 180 // Promotion logs

	'mail_logs' => 180, // Mail error logs
'user_mail_logs' => 180, // User mail logs
'promotion_logs' => 180 // Promotion logs

 
);

/**
* Disallowed Remote Hosts
* List of hosts the fetch_remote_file() function will not
* perform requests to.
* It is recommended that you enter hosts resolving to the
* forum server here to prevent Server Side Request
* Forgery attacks.
*/

\$config['disallowed_remote_hosts'] = array(
'localhost',
);

/**
* Disallowed Remote Addresses
* List of IPv4 addresses the fetch_remote_file() function
* will not perform requests to.
* It is recommended that you enter addresses resolving to
* the forum server here to prevent Server Side Request
* Forgery attacks.
* Removing all values disables resolving hosts in that
* function.
*/

\$config['disallowed_remote_addresses'] = array(
'127.0.0.1',
'10.0.0.0/8',
'172.16.0.0/12',
'192.168.0.0/16',

);

";

);

";





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

 

if(function_exists('opcache_invalidate'))
{
opcache_invalidate(MYBB_ROOT."inc/config.php");
}


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


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

Zeile 1613Zeile 1662
	$output->print_footer('populate_tables');
}


	$output->print_footer('populate_tables');
}


 
/**
* Insert our default data
*/

function populate_tables()
{
global $output, $lang;

function populate_tables()
{
global $output, $lang;

Zeile 1657Zeile 1709
	$output->print_footer('templates');
}


	$output->print_footer('templates');
}


 
/**
* Install our theme
*/

function insert_templates()

function insert_templates()

{

{

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

require MYBB_ROOT.'inc/config.php';

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

require MYBB_ROOT.'inc/config.php';

Zeile 1686Zeile 1741
	{
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";
require_once 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."admin/inc/functions.php";

	elseif(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{
require_once MYBB_ROOT."admin/inc/functions.php";

Zeile 1767Zeile 1822
	$output->print_footer('configuration');
}


	$output->print_footer('configuration');
}


 
/**
* Default configuration
*/

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

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

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

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

	



	echo <<<EOF

	echo <<<EOF

		<script type="text/javascript">	

		<script type="text/javascript">

		function warnUser(inp, warn)
{
var parenttr = $('#'+inp.id).closest('tr');

		function warnUser(inp, warn)
{
var parenttr = $('#'+inp.id).closest('tr');

Zeile 1784Zeile 1842
				{
var revertlink = ' <a href="javascript:revertSetting(\''+inp.defaultValue+'\', \'#'+inp.id+'\');">{$lang->config_step_revert}</a>';
parenttr.removeClass('last').after('<tr class="setting_peeker"><td colspan="2">'+warn+revertlink+'</td></tr>');

				{
var revertlink = ' <a href="javascript:revertSetting(\''+inp.defaultValue+'\', \'#'+inp.id+'\');">{$lang->config_step_revert}</a>';
parenttr.removeClass('last').after('<tr class="setting_peeker"><td colspan="2">'+warn+revertlink+'</td></tr>');

				}

				}

			} else {
parenttr.next('.setting_peeker').remove();
if(parenttr.is(':last-child'))
{
parenttr.addClass('last');
}

			} else {
parenttr.next('.setting_peeker').remove();
if(parenttr.is(':last-child'))
{
parenttr.addClass('last');
}

			}

			}

		}

		}

			



		function revertSetting(defval, inpid)
{

		function revertSetting(defval, inpid)
{

			$(inpid).val(defval);			

			$(inpid).val(defval);

			var parenttr = $(inpid).closest('tr');
parenttr.next('.setting_peeker').remove();
if(parenttr.is(':last-child'))
{
parenttr.addClass('last');

			var parenttr = $(inpid).closest('tr');
parenttr.next('.setting_peeker').remove();
if(parenttr.is(':last-child'))
{
parenttr.addClass('last');

			}			

			}

		}
</script>

		}
</script>

		



EOF;

// If board configuration errors

EOF;

// If board configuration errors

Zeile 1835Zeile 1893
		}

// Attempt auto-detection

		}

// Attempt auto-detection

		if($_SERVER['HTTP_HOST'])

		if(!empty($_SERVER['HTTP_HOST']))

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

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

		elseif($_SERVER['SERVER_NAME'])

		elseif(!empty($_SERVER['SERVER_NAME']))

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

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

Zeile 1861Zeile 1919
			$cookiedomain = ".{$cookiedomain}";
}


			$cookiedomain = ".{$cookiedomain}";
}


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

		if(!empty($_SERVER['SERVER_PORT']))

		{

		{

			$hostname .= ':'.$_SERVER['SERVER_PORT'];












			$port = ":{$_SERVER['SERVER_PORT']}";
$pos = strrpos($cookiedomain, $port);

if($pos !== false)
{
$cookiedomain = substr($cookiedomain, 0, $pos);
}

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

		}

		}

		



		$currentlocation = get_current_location('', '', true);
$noinstall = substr($currentlocation, 0, strrpos($currentlocation, '/install/'));

		$currentlocation = get_current_location('', '', true);
$noinstall = substr($currentlocation, 0, strrpos($currentlocation, '/install/'));

		



		$cookiepath = $noinstall.'/';
$bburl = $hostname.$noinstall;
$websiteurl = $hostname.'/';

		$cookiepath = $noinstall.'/';
$bburl = $hostname.$noinstall;
$websiteurl = $hostname.'/';

		$contactemail = $_SERVER['SERVER_ADMIN'];
}






if(isset($_SERVER['SERVER_ADMIN']) && filter_var($_SERVER['SERVER_ADMIN'], FILTER_VALIDATE_EMAIL))
{
$contactemail = $_SERVER['SERVER_ADMIN'];
}
}


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


 
/**
* How do we want to name the admin user?
*/

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

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

Zeile 1901Zeile 1977
		}
}
$output->print_header($lang->create_admin, 'admin');

		}
}
$output->print_header($lang->create_admin, 'admin');

	



	echo <<<EOF

	echo <<<EOF

		<script type="text/javascript">	

		<script type="text/javascript">

		function comparePass()
{
var parenttr = $('#adminpass2').closest('tr');

		function comparePass()
{
var parenttr = $('#adminpass2').closest('tr');

Zeile 1919Zeile 1995
			}
}
</script>

			}
}
</script>

		



EOF;

if(is_array($errors))

EOF;

if(is_array($errors))

Zeile 1936Zeile 2012

echo $lang->admin_step_setupsettings;
$adminuser = $adminemail = '';


echo $lang->admin_step_setupsettings;
$adminuser = $adminemail = '';





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

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

Zeile 1970Zeile 2046

$db->insert_query('settings', $settingdata);
$settingcount++;


$db->insert_query('settings', $settingdata);
$settingcount++;

			}

			}

		}

if(my_substr($mybb->get_input('bburl'), -1, 1) == '/')
{
$mybb->input['bburl'] = my_substr($mybb->get_input('bburl'), 0, -1);
}

		}

if(my_substr($mybb->get_input('bburl'), -1, 1) == '/')
{
$mybb->input['bburl'] = my_substr($mybb->get_input('bburl'), 0, -1);
}





		$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('bbname'))), "name='bbname'");
$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('bburl'))), "name='bburl'");
$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('websitename'))), "name='homename'");

		$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('bbname'))), "name='bbname'");
$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('bburl'))), "name='bburl'");
$db->update_query("settings", array('value' => $db->escape_string($mybb->get_input('websitename'))), "name='homename'");

Zeile 1993Zeile 2069

// Save the acp pin
$pin = addslashes($mybb->get_input('pin'));


// Save the acp pin
$pin = addslashes($mybb->get_input('pin'));





		$file = @fopen(MYBB_ROOT."inc/config.php", "a");

@fwrite($file, "/**

		$file = @fopen(MYBB_ROOT."inc/config.php", "a");

@fwrite($file, "/**

Zeile 2001Zeile 2077
 *  If you wish to request a PIN
* when someone tries to login
* on your Admin CP, enter it below.

 *  If you wish to request a PIN
* when someone tries to login
* on your Admin CP, enter it below.

 */

\$config['secret_pin'] = '{$pin}';");

 */

\$config['secret_pin'] = '{$pin}';");


@fclose($file);



@fclose($file);


Zeile 2104Zeile 2180
		echo $lang->sprintf($lang->admin_step_insertedviews, $view_count);

echo $lang->admin_step_createadmin;

		echo $lang->sprintf($lang->admin_step_insertedviews, $view_count);

echo $lang->admin_step_createadmin;

	}

	}


echo $lang->sprintf($lang->admin_step_admintable, $adminuser, $adminemail);
$output->print_footer('final');
}


echo $lang->sprintf($lang->admin_step_admintable, $adminuser, $adminemail);
$output->print_footer('final');
}







/**
* Installation is finished
*/

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->get_input('adminpass') != $mybb->get_input('adminpass2'))
{
$errors[] = $lang->admin_step_error_nomatch;

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

	}

	}

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

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

	}

	}

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

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

Zeile 2137Zeile 2216

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;


Zeile 2215Zeile 2294
		'receivepms' => 1,
'pmnotice' => 1,
'pmnotify' => 1,

		'receivepms' => 1,
'pmnotice' => 1,
'pmnotify' => 1,

 
		'buddyrequestspm' => 1,
'buddyrequestsauto' => 0,

		'showimages' => 1,
'showvideos' => 1,
'showsigs' => 1,

		'showimages' => 1,
'showvideos' => 1,
'showsigs' => 1,

Zeile 2240Zeile 2321
		'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 2330Zeile 2411
	$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));
$cache->update_default_theme();

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

 
	$cache->update_reportreasons(true);


$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");


$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");

Zeile 2373Zeile 2455
	$output->print_footer('');
}


	$output->print_footer('');
}


 
/**
* @param array $config
*
* @return DB_MySQL|DB_MySQLi|DB_PgSQL|DB_SQLite
*/

function db_connection($config)
{
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
switch($config['database']['type'])

function db_connection($config)
{
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
switch($config['database']['type'])

	{

	{

		case "sqlite":
$db = new DB_SQLite;
break;

		case "sqlite":
$db = new DB_SQLite;
break;

Zeile 2389Zeile 2476
			break;
default:
$db = new DB_MySQL;

			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 2399Zeile 2486
	$db->type = $config['database']['type'];

return $db;

	$db->type = $config['database']['type'];

return $db;

}

}





 
/**
* @param array $array
*
* @return string
*/

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

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

Zeile 2412Zeile 2504
	return $string;
}


	return $string;
}


 
/**
* Write our settings to the settings file
*/

function write_settings()
{
global $db;

function write_settings()
{
global $db;