Vergleich install/index.php - 1.8.5 - 1.8.7

  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');
$groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperthread');
$displaygroupfields = array('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');
$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');

Zeile 186Zeile 186
	}
}


	}
}


 
/**
* Welcome page
*/

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

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





	$output->print_header($lang->welcome, 'welcome');
if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)
{

	$output->print_header($lang->welcome, 'welcome');
if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)
{

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 738Zeile 744
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.





  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own

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 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 1613Zeile 1628
	$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 1675
	$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 1683Zeile 1704

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


$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');
if(!empty($mybb->config['admin_dir']) && 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";
}

		require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
}

Zeile 1729Zeile 1750
		}

if(is_array($tree['colors']['stylesheets']))

		}

if(is_array($tree['colors']['stylesheets']))

		{

		{

			$count = count($properties['disporder']) + 1;
foreach($tree['colors']['stylesheets']['stylesheet'] as $stylesheet)
{

			$count = count($properties['disporder']) + 1;
foreach($tree['colors']['stylesheets']['stylesheet'] as $stylesheet)
{

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


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


 
/**
* Default configuration
*/

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

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





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

	$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 1793Zeile 1817
				}
}
}

				}
}
}

			



		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 1859
		}

// 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 1885
			$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 1943
		}
}
$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 1961
			}
}
</script>

			}
}
</script>

		



EOF;

if(is_array($errors))

EOF;

if(is_array($errors))

Zeile 1936Zeile 1978

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 2012

$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 2035

// 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 2043
 *  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 2146
		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 2182

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 2344Zeile 2389
	}
sort($version_history, SORT_NUMERIC);
$cache->update("version_history", $version_history);

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





	// Schedule an update check so it occurs an hour ago.  Gotta stay up to date!
$update['nextrun'] = TIME_NOW - 3600;
$db->update_query("tasks", $update, "tid='12'");

	// Schedule an update check so it occurs an hour ago.  Gotta stay up to date!
$update['nextrun'] = TIME_NOW - 3600;
$db->update_query("tasks", $update, "tid='12'");

Zeile 2353Zeile 2398
	$cache->update_tasks();

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

	$cache->update_tasks();

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





	echo $lang->done_step_success;

$written = 0;
if(is_writable('./'))

	echo $lang->done_step_success;

$written = 0;
if(is_writable('./'))

	{

	{

		$lock = @fopen('./lock', 'w');
$written = @fwrite($lock, '1');
@fclose($lock);

		$lock = @fopen('./lock', 'w');
$written = @fwrite($lock, '1');
@fclose($lock);

Zeile 2366Zeile 2411
		{
echo $lang->done_step_locked;
}

		{
echo $lang->done_step_locked;
}

	}

	}

	if(!$written)
{
echo $lang->done_step_dirdelete;

	if(!$written)
{
echo $lang->done_step_dirdelete;

Zeile 2375Zeile 2420
	$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 2391Zeile 2441
			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 2401Zeile 2451
	$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 2414Zeile 2469
	return $string;
}


	return $string;
}


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

function write_settings()
{
global $db;

function write_settings()
{
global $db;