Vergleich install/index.php - 1.8.4 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 56Zeile 56
require_once MYBB_ROOT.'inc/functions_user.php';
require_once MYBB_ROOT.'inc/class_language.php';
$lang = new MyLanguage();

require_once MYBB_ROOT.'inc/functions_user.php';
require_once MYBB_ROOT.'inc/class_language.php';
$lang = new MyLanguage();

$lang->set_path(MYBB_ROOT.'install/resources');

$lang->set_path(INSTALL_ROOT.'resources');

$lang->load('language');

// Load DB interface

$lang->load('language');

// Load DB interface

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 106Zeile 106
		'title' => 'PostgreSQL',
'short_title' => 'PostgreSQL',
'structure_file' => 'pgsql_db_tables.php',

		'title' => 'PostgreSQL',
'short_title' => 'PostgreSQL',
'structure_file' => 'pgsql_db_tables.php',

		'population_file' => 'mysql_db_inserts.php'

		'population_file' => 'pgsql_db_inserts.php'

	);
}


	);
}


Zeile 120Zeile 120
			'title' => 'SQLite 3',
'short_title' => 'SQLite',
'structure_file' => 'sqlite_db_tables.php',

			'title' => 'SQLite 3',
'short_title' => 'SQLite',
'structure_file' => 'sqlite_db_tables.php',

			'population_file' => 'mysql_db_inserts.php'

			'population_file' => 'pgsql_db_inserts.php'

		);
}
}

		);
}
}

Zeile 163Zeile 163
			break;
case 'create_tables':
create_tables();

			break;
case 'create_tables':
create_tables();

			break;

			break;

		case 'populate_tables':
populate_tables();

		case 'populate_tables':
populate_tables();

			break;

			break;

		case 'templates':
insert_templates();

		case 'templates':
insert_templates();

			break;

			break;

		case 'configuration':
configure();
break;
case 'adminuser':
create_admin_user();

		case 'configuration':
configure();
break;
case 'adminuser':
create_admin_user();

			break;

			break;

		case 'final':
install_done();

		case 'final':
install_done();

			break;

			break;

		default:
$mybb->input['action'] = 'intro';
intro();

		default:
$mybb->input['action'] = 'intro';
intro();

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





	$mybb->input['action'] = "requirements_check";
$output->print_header($lang->req_check, 'requirements');
echo $lang->req_step_top;

	$mybb->input['action'] = "requirements_check";
$output->print_header($lang->req_check, 'requirements');
echo $lang->req_step_top;

Zeile 1041Zeile 1050
	{
$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
{

Zeile 1184Zeile 1193
	echo $lang->sprintf($lang->req_step_reqtable, $phpversion, $dbsupportlist, $mbstatus, $xmlstatus, $configstatus, $settingsstatus, $cachestatus, $uploadsstatus, $avatarsstatus);

if($showerror == 1)

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

if($showerror == 1)

	{

	{

		$error_list = error_list($errors);
echo $lang->sprintf($lang->req_step_error_tablelist, $error_list);
echo "\n <input type=\"hidden\" name=\"action\" value=\"{$mybb->input['action']}\" />";

		$error_list = error_list($errors);
echo $lang->sprintf($lang->req_step_error_tablelist, $error_list);
echo "\n <input type=\"hidden\" name=\"action\" value=\"{$mybb->input['action']}\" />";

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

	else
{
echo $lang->db_step_config_db;

	}

$dbengines = '';


	}

$dbengines = '';


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

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

Zeile 1311Zeile 1323
			$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>
</tr>";

					<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

		}
// Others get db host, username, password etc
else

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 1462Zeile 1477
	// 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

Zeile 1478Zeile 1491
 *
* Please see the MyBB Docs for advanced
* database configuration for larger installations

 *
* 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 1515Zeile 1528
 *  of the most commonly accessed data in MyBB.
* By default, the database is used to store this data.
*

 *  of the most commonly accessed data in MyBB.
* By default, the database is used to store this data.
*

 *  If you wish to use the file system (cache/ directory), MemCache (or MemCached), xcache, APC, or eAccelerator
* you can change the value below to 'files', 'memcache', 'memcached', 'xcache', 'apc' or 'eaccelerator' from 'db'.

 *  If you wish to use the file system (cache/ directory), MemCache (or MemCached), xcache, APC, APCu, eAccelerator or Redis
* you can change the value below to 'files', 'memcache', 'memcached', 'xcache', 'apc', 'apcu', 'eaccelerator' or 'redis' from 'db'.

 */

\$config['cache_store'] = 'db';

 */

\$config['cache_store'] = 'db';

Zeile 1532Zeile 1545

\$config['memcache']['host'] = 'localhost';
\$config['memcache']['port'] = 11211;


\$config['memcache']['host'] = 'localhost';
\$config['memcache']['port'] = 11211;

 

/**
* Redis configuration
* If you are using Redis as your data-cache
* you need to configure the hostname and port
* of your redis server below. If you want
* to connect via unix sockets, use the full
* path to the unix socket as host and leave
* the port setting unconfigured or false.
*/

\$config['redis']['host'] = 'localhost';
\$config['redis']['port'] = 6379;


/**
* Super Administrators


/**
* Super Administrators

Zeile 1539Zeile 1565
 *  be edited, deleted or banned in the Admin CP.
* The administrator permissions for these users
* cannot be altered either.

 *  be edited, deleted or banned in the Admin CP.
* The administrator permissions for these users
* cannot be altered either.

 */

 */


\$config['super_admins'] = '1';



\$config['super_admins'] = '1';


Zeile 1549Zeile 1575
 *  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 1586
 *  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


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

Zeile 1571Zeile 1597
	'promotion_logs' => 180 // Promotion 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 1675
	$output->print_footer('populate_tables');
}


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


 
/**
* Insert our default data
*/

function populate_tables()
{

function populate_tables()
{

	global $output, $lang;

	global $output, $lang, $dboptions;


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


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

Zeile 1626Zeile 1691
	if(!empty($dboptions[$db->type]['population_file']))
{
$population_file = $dboptions[$db->type]['population_file'];

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

	}

	}

	else
{
$population_file = 'mysql_db_inserts.php';

	else
{
$population_file = 'mysql_db_inserts.php';

Zeile 1637Zeile 1702
	{
$val = preg_replace('#mybb_(\S+?)([\s\.,]|$)#', $config['database']['table_prefix'].'\\1\\2', $val);
$db->query($val);

	{
$val = preg_replace('#mybb_(\S+?)([\s\.,]|$)#', $config['database']['table_prefix'].'\\1\\2', $val);
$db->query($val);

	}


	}


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

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

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


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


 
/**
* Install our theme
*/

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

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

Zeile 1666Zeile 1734

require_once MYBB_ROOT.'inc/class_datacache.php';
$cache = new datacache;


require_once MYBB_ROOT.'inc/class_datacache.php';
$cache = new datacache;





	$output->print_header($lang->theme_installation, 'theme');

echo $lang->theme_step_importing;

	$output->print_header($lang->theme_installation, 'theme');

echo $lang->theme_step_importing;





	$db->delete_query("themes");
$db->delete_query("templates");
$db->delete_query("themestylesheets");

	$db->delete_query("themes");
$db->delete_query("templates");
$db->delete_query("themestylesheets");

Zeile 1767Zeile 1835
	$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 1855
				{
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 1906
		}

// 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 1932
			$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 1890Zeile 1979
		if(empty($mybb->input['bburl']))
{
$errors[] = $lang->config_step_error_url;

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

		}

		}

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

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

Zeile 1898Zeile 1987
		if(is_array($errors))
{
configure();

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

		}

		}

	}
$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 2008
			}
}
</script>

			}
}
</script>

		



EOF;

if(is_array($errors))

EOF;

if(is_array($errors))

Zeile 1933Zeile 2022
	{
require MYBB_ROOT.'inc/config.php';
$db = db_connection($config);

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





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


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


Zeile 2028Zeile 2117
				'month' => $db->escape_string($task['month'][0]['value']),
'enabled' => $db->escape_string($task['enabled'][0]['value']),
'logging' => $db->escape_string($task['logging'][0]['value'])

				'month' => $db->escape_string($task['month'][0]['value']),
'enabled' => $db->escape_string($task['enabled'][0]['value']),
'logging' => $db->escape_string($task['logging'][0]['value'])

			);


			);


			$new_task['nextrun'] = fetch_next_run($new_task);

			$new_task['nextrun'] = fetch_next_run($new_task);





			$db->insert_query("tasks", $new_task);
$taskcount++;
}

			$db->insert_query("tasks", $new_task);
$taskcount++;
}





		// For the version check task, set a random date and hour (so all MyBB installs don't query mybb.com all at the same time)
$update_array = array(
'hour' => rand(0, 23),

		// For the version check task, set a random date and hour (so all MyBB installs don't query mybb.com all at the same time)
$update_array = array(
'hour' => rand(0, 23),

Zeile 2043Zeile 2132
		);

$db->update_query("tasks", $update_array, "file = 'versioncheck'");

		);

$db->update_query("tasks", $update_array, "file = 'versioncheck'");





		echo $lang->sprintf($lang->admin_step_insertedtasks, $taskcount);

$views = file_get_contents(INSTALL_ROOT.'resources/adminviews.xml');

		echo $lang->sprintf($lang->admin_step_insertedtasks, $taskcount);

$views = file_get_contents(INSTALL_ROOT.'resources/adminviews.xml');

Zeile 2051Zeile 2140
		$parser->collapse_dups = 0;
$tree = $parser->get_tree();
$view_count = 0;

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





		// Insert admin views
foreach($tree['adminviews'][0]['view'] as $view)
{

		// Insert admin views
foreach($tree['adminviews'][0]['view'] as $view)
{

Zeile 2059Zeile 2148
			foreach($view['fields'][0]['field'] as $field)
{
$fields[] = $field['attributes']['name'];

			foreach($view['fields'][0]['field'] as $field)
{
$fields[] = $field['attributes']['name'];

			}


			}


			$conditions = array();
if(isset($view['conditions'][0]['condition']) && is_array($view['conditions'][0]['condition']))
{

			$conditions = array();
if(isset($view['conditions'][0]['condition']) && is_array($view['conditions'][0]['condition']))
{

Zeile 2110Zeile 2199
	$output->print_footer('final');
}


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


 
/**
* Installation is finished
*/

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

if(empty($mybb->input['adminuser']))

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['adminpass']))

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

Zeile 2123Zeile 2215
		$errors[] = $lang->admin_step_error_nopassword;
}
if($mybb->get_input('adminpass') != $mybb->get_input('adminpass2'))

		$errors[] = $lang->admin_step_error_nopassword;
}
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_nomatch;
}
if(empty($mybb->input['adminemail']))

Zeile 2137Zeile 2229

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 2159Zeile 2251
		// usergroup[cancp][0][value]
$new_group = array();
foreach($usergroup as $key => $value)

		// usergroup[cancp][0][value]
$new_group = array();
foreach($usergroup as $key => $value)

		{

		{

			if(!is_array($value))
{
continue;

			if(!is_array($value))
{
continue;

Zeile 2203Zeile 2295
		'lastvisit' => $now,
'website' => '',
'icq' => '',

		'lastvisit' => $now,
'website' => '',
'icq' => '',

		'aim' => '',
'yahoo' => '',

 
		'skype' =>'',
'google' =>'',
'birthday' => '',

		'skype' =>'',
'google' =>'',
'birthday' => '',

Zeile 2215Zeile 2305
		'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 2234Zeile 2326
		'referrer' => 0,
'buddylist' => '',
'ignorelist' => '',

		'referrer' => 0,
'buddylist' => '',
'ignorelist' => '',

		'pmfolders' => '',

		'pmfolders' => "0**$%%$1**$%%$2**$%%$3**$%%$4**",

		'notepad' => '',
'showredirect' => 1,
'usernotes' => ''

		'notepad' => '',
'showredirect' => 1,
'usernotes' => ''

Zeile 2268Zeile 2360
		foreach($users['defaultviews'][0]['view'] as $view)
{
$defaultviews[$view['attributes']['type']] = $view['value'];

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

		}

		}


$adminoptiondata = array(
'uid' => (int)$uid,


$adminoptiondata = array(
'uid' => (int)$uid,

Zeile 2287Zeile 2379
	// Automatic Login
my_unsetcookie("sid");
my_unsetcookie("mybbuser");

	// Automatic Login
my_unsetcookie("sid");
my_unsetcookie("mybbuser");

	my_setcookie('mybbuser', $uid.'_'.$loginkey, null, true);

	my_setcookie('mybbuser', $uid.'_'.$loginkey, null, true, "lax");

	ob_end_flush();

// Make fulltext columns if supported

	ob_end_flush();

// Make fulltext columns if supported

Zeile 2321Zeile 2413
	$cache->update_posticons();
$cache->update_spiders();
$cache->update_bannedips();

	$cache->update_posticons();
$cache->update_spiders();
$cache->update_bannedips();

	$cache->update_banned();

 
	$cache->update_bannedemails();
$cache->update_birthdays();
$cache->update_groupleaders();

	$cache->update_bannedemails();
$cache->update_birthdays();
$cache->update_groupleaders();

Zeile 2330Zeile 2421
	$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 2465
	$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";

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

Zeile 2401Zeile 2498
	return $db;
}


	return $db;
}


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

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

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

Zeile 2412Zeile 2514
	return $string;
}


	return $string;
}


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

function write_settings()
{
global $db;

function write_settings()
{
global $db;

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

		$setting['value'] = str_replace("\"", "\\\"", $setting['value']);


		$setting['name'] = addcslashes($setting['name'], "\\'");
$setting['value'] = addcslashes($setting['value'], '\\"$');

		$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";
}
if(!empty($settings))

		$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";
}
if(!empty($settings))