Vergleich install/index.php - 1.8.3 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 58Zeile 58
$lang = new MyLanguage();
$lang->set_path(MYBB_ROOT.'install/resources');
$lang->load('language');

$lang = new MyLanguage();
$lang->set_path(MYBB_ROOT.'install/resources');
$lang->load('language');

 

// Load DB interface
require_once MYBB_ROOT."inc/db_base.php";


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

$fpermfields = array('canview', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch');

$fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');


// Include the installation resources
require_once INSTALL_ROOT.'resources/output.php';


// Include the installation resources
require_once INSTALL_ROOT.'resources/output.php';

Zeile 80Zeile 83
		'class' => 'DB_MySQLi',
'title' => 'MySQL Improved',
'short_title' => 'MySQLi',

		'class' => 'DB_MySQLi',
'title' => 'MySQL Improved',
'short_title' => 'MySQLi',

		'structure_file' => 'mysql_db_tables.php',
'population_file' => 'mysql_db_inserts.php'
);
}


		'structure_file' => 'mysql_db_tables.php',
'population_file' => 'mysql_db_inserts.php'
);
}


if(function_exists('mysql_connect'))
{
$dboptions['mysql'] = array(

if(function_exists('mysql_connect'))
{
$dboptions['mysql'] = array(

Zeile 97Zeile 100
}

if(function_exists('pg_connect'))

}

if(function_exists('pg_connect'))

{

{

	$dboptions['pgsql'] = array(
'class' => 'DB_PgSQL',
'title' => 'PostgreSQL',

	$dboptions['pgsql'] = array(
'class' => 'DB_PgSQL',
'title' => 'PostgreSQL',

Zeile 183Zeile 186
	}
}


	}
}


 
/**
* Welcome page
*/

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

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

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

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

	if(strpos(strtolower($_SERVER['PHP_SELF']), "upload/") !== false)

	if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)

	{
echo $lang->sprintf($lang->mybb_incorrect_folder);
}

	{
echo $lang->sprintf($lang->mybb_incorrect_folder);
}

Zeile 196Zeile 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 203Zeile 212
	ob_start();
$output->print_header($lang->license_agreement, 'license');


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


	if($mybb->get_input('allow_anonymous_info', 1) == 1)

	if($mybb->get_input('allow_anonymous_info', MyBB::INPUT_INT) == 1)

	{
require_once MYBB_ROOT."inc/functions_serverstats.php";
$build_server_stats = build_server_stats(1, '', $mybb->version_code);

	{
require_once MYBB_ROOT."inc/functions_serverstats.php";
$build_server_stats = build_server_stats(1, '', $mybb->version_code);

Zeile 355Zeile 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 1010Zeile 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 1055Zeile 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 1101Zeile 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 1147Zeile 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 1195Zeile 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 1259Zeile 1274
		$db = new $dbtype['class'];
$encodings = $db->fetch_db_charsets();
$encoding_select = '';

		$db = new $dbtype['class'];
$encodings = $db->fetch_db_charsets();
$encoding_select = '';

		$mybb->input['config'] = $mybb->get_input('config', 2);

		$mybb->input['config'] = $mybb->get_input('config', MyBB::INPUT_ARRAY);

		if(empty($mybb->input['config'][$dbfile]['dbhost']))
{
$mybb->input['config'][$dbfile]['dbhost'] = "localhost";

		if(empty($mybb->input['config'][$dbfile]['dbhost']))
{
$mybb->input['config'][$dbfile]['dbhost'] = "localhost";

Zeile 1373Zeile 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 1384Zeile 1402
		database_info();
}


		database_info();
}


	$mybb->input['config'] = $mybb->get_input('config', 2);

	$mybb->input['config'] = $mybb->get_input('config', MyBB::INPUT_ARRAY);

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

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

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

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

Zeile 1431Zeile 1449
	elseif(method_exists($db, 'select_db') && !$db->select_db($config['dbname']))
{
$errors[] = $lang->sprintf($lang->db_step_error_nodbname, $config['dbname']);

	elseif(method_exists($db, 'select_db') && !$db->select_db($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'] != '')
{

	// 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'] != '')
{

Zeile 1529Zeile 1547

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


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





/**
* Super Administrators
* A comma separated list of user IDs who cannot

/**
* Super Administrators
* A comma separated list of user IDs who cannot

Zeile 1587Zeile 1605
	else
{
$structure_file = 'mysql_db_tables.php';

	else
{
$structure_file = 'mysql_db_tables.php';

	}


	}


	require_once INSTALL_ROOT."resources/{$structure_file}";
foreach($tables as $val)
{
$val = preg_replace('#mybb_(\S+?)([\s\.,\(]|$)#', $config['tableprefix'].'\\1\\2', $val);
$val = preg_replace('#;$#', $db->build_create_table_collation().";", $val);
preg_match('#CREATE TABLE (\S+)(\s?|\(?)\(#i', $val, $match);

	require_once INSTALL_ROOT."resources/{$structure_file}";
foreach($tables as $val)
{
$val = preg_replace('#mybb_(\S+?)([\s\.,\(]|$)#', $config['tableprefix'].'\\1\\2', $val);
$val = preg_replace('#;$#', $db->build_create_table_collation().";", $val);
preg_match('#CREATE TABLE (\S+)(\s?|\(?)\(#i', $val, $match);

		if($match[1])
{

		if($match[1])
{

			$db->drop_table($match[1], false, false);
echo $lang->sprintf($lang->tablecreate_step_created, $match[1]);

			$db->drop_table($match[1], false, false);
echo $lang->sprintf($lang->tablecreate_step_created, $match[1]);

		}

		}

		$db->query($val);
if($match[1])
{

		$db->query($val);
if($match[1])
{

Zeile 1610Zeile 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 1654Zeile 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 1758Zeile 1782
		}
}


		}
}


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

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


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



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


 
/**
* Default configuration
*/

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

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

Zeile 1823Zeile 1850
	{
$bbname = 'Forums';
$cookiedomain = '';

	{
$bbname = 'Forums';
$cookiedomain = '';

		$cookiepath = '/';

 
		$websitename = 'Your Website';

		$websitename = 'Your Website';

		$contactemail = '';

 

$protocol = "http://";
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off"))


$protocol = "http://";
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off"))

Zeile 1845Zeile 1870
			$cookiedomain = $_SERVER['SERVER_NAME'];
}


			$cookiedomain = $_SERVER['SERVER_NAME'];
}


		if(substr($cookiedomain, 0, 4) == "www.")

		if(my_substr($cookiedomain, 0, 4) == "www.")

		{

		{

			$cookiedomain = my_substr($cookiedomain, 4);

			$cookiedomain = substr($cookiedomain, 4);

		}

// IP addresses and hostnames are not valid

		}

// IP addresses and hostnames are not valid

Zeile 1864Zeile 1889
		{
$hostname .= ':'.$_SERVER['SERVER_PORT'];
}

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

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

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

		$websiteurl = $hostname.'/';

		$websiteurl = $hostname.'/';


$currentlocation = get_current_location();
if($currentlocation)
{
// TODO: Change this to find the last position of /install/
$pos = my_strpos($currentlocation, '/install/');
if($pos === 0)
{
$cookiepath = "/";
}
else
{
$cookiepath = my_substr($currentlocation, 0, $pos).'/';
}
}

$currentscript = $hostname.get_current_location();

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

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

		$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 1917Zeile 1925
		if(is_array($errors))
{
configure();

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

		}

		}

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


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


Zeile 2108Zeile 2116
				"type" => $db->escape_string($view['attributes']['type']),
"visibility" => (int)$view['attributes']['visibility'],
"title" => $db->escape_string($view['title'][0]['value']),

				"type" => $db->escape_string($view['attributes']['type']),
"visibility" => (int)$view['attributes']['visibility'],
"title" => $db->escape_string($view['title'][0]['value']),

				"fields" => $db->escape_string(serialize($fields)),
"conditions" => $db->escape_string(serialize($conditions)),
"custom_profile_fields" => $db->escape_string(serialize($custom_profile_fields)),

				"fields" => $db->escape_string(my_serialize($fields)),
"conditions" => $db->escape_string(my_serialize($conditions)),
"custom_profile_fields" => $db->escape_string(my_serialize($custom_profile_fields)),

				"sortby" => $db->escape_string($view['sortby'][0]['value']),
"sortorder" => $db->escape_string($view['sortorder'][0]['value']),
"perpage" => (int)$view['perpage'][0]['value'],

				"sortby" => $db->escape_string($view['sortby'][0]['value']),
"sortorder" => $db->escape_string($view['sortorder'][0]['value']),
"perpage" => (int)$view['perpage'][0]['value'],

Zeile 2129Zeile 2137
	$output->print_footer('final');
}


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

Zeile 2136Zeile 2147
	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;

Zeile 2209Zeile 2220
	$salt = random_str();
$loginkey = generate_loginkey();
$saltedpw = md5(md5($salt).md5($mybb->get_input('adminpass')));

	$salt = random_str();
$loginkey = generate_loginkey();
$saltedpw = md5(md5($salt).md5($mybb->get_input('adminpass')));





	$newuser = array(
'username' => $db->escape_string($mybb->get_input('adminuser')),
'password' => $saltedpw,

	$newuser = array(
'username' => $db->escape_string($mybb->get_input('adminuser')),
'password' => $saltedpw,

Zeile 2234Zeile 2245
		'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 2281Zeile 2294
			{
$insertmodule[$module['attributes']['name']][$permission['attributes']['name']] = $permission['value'];
}

			{
$insertmodule[$module['attributes']['name']][$permission['attributes']['name']] = $permission['value'];
}

		}


		}


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

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

Zeile 2293Zeile 2306
			'uid' => (int)$uid,
'cpstyle' => '',
'notes' => '',

			'uid' => (int)$uid,
'cpstyle' => '',
'notes' => '',

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

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

		);

$insertmodule = array();

		);

$insertmodule = array();

Zeile 2357Zeile 2370
		if(preg_match("#upgrade([0-9]+).php$#i", $file, $match))
{
$version_history[$match[1]] = $match[1];

		if(preg_match("#upgrade([0-9]+).php$#i", $file, $match))
{
$version_history[$match[1]] = $match[1];

		}

		}

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

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

Zeile 2370Zeile 2383
	$cache->update_tasks();

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

	$cache->update_tasks();

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





	echo $lang->done_step_success;

$written = 0;

	echo $lang->done_step_success;

$written = 0;

Zeile 2383Zeile 2396
		{
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 2392Zeile 2405
	$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 2420Zeile 2438
	return $db;
}


	return $db;
}


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

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

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

Zeile 2431Zeile 2454
	return $string;
}


	return $string;
}


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

function write_settings()
{
global $db;

function write_settings()
{
global $db;

Zeile 2450Zeile 2476
		fclose($file);
}
}

		fclose($file);
}
}

?>