Vergleich install/index.php - 1.6.0 - 1.6.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: index.php 5092 2010-07-17 11:09:40Z Huji $

 * $Id: index.php 5591 2011-09-14 08:05:39Z Tomm $

 */

if(function_exists("unicode_decode"))

 */

if(function_exists("unicode_decode"))

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

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

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false)

		if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))

		{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;
database_info();

		{
$errors[] = $lang->db_step_error_sqlite_invalid_dbname;
database_info();

Zeile 1464Zeile 1464
 *
* Please see the MyBB Wiki for advanced
* database configuration for larger installations

 *
* Please see the MyBB Wiki for advanced
* database configuration for larger installations

 * http://wiki.mybboard.net/

 * http://wiki.mybb.com/

 */

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

 */

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

Zeile 1625Zeile 1625
		$db->query($val);
}


		$db->query($val);
}


	// Update the fid sequence for PgSQL

	// Update the sequences for PgSQL

	if($config['database']['type'] == "pgsql")
{

	if($config['database']['type'] == "pgsql")
{

		$db->query("ALTER SEQUENCE ".$config['database']['table_prefix']."forums_fid_seq RESTART WITH 3");









		$db->query("SELECT setval('{$config['database']['table_prefix']}attachtypes_atid_seq', (SELECT max(atid) FROM {$config['database']['table_prefix']}attachtypes));");
$db->query("SELECT setval('{$config['database']['table_prefix']}forums_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}forums));");
$db->query("SELECT setval('{$config['database']['table_prefix']}helpdocs_hid_seq', (SELECT max(hid) FROM {$config['database']['table_prefix']}helpdocs));");
$db->query("SELECT setval('{$config['database']['table_prefix']}helpsections_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}helpsections));");
$db->query("SELECT setval('{$config['database']['table_prefix']}icons_iid_seq', (SELECT max(iid) FROM {$config['database']['table_prefix']}icons));");
$db->query("SELECT setval('{$config['database']['table_prefix']}profilefields_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}profilefields));");
$db->query("SELECT setval('{$config['database']['table_prefix']}smilies_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}smilies));");
$db->query("SELECT setval('{$config['database']['table_prefix']}spiders_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}spiders));");
$db->query("SELECT setval('{$config['database']['table_prefix']}templategroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}templategroups));");

	}

echo $lang->populate_step_inserted;

	}

echo $lang->populate_step_inserted;

Zeile 1715Zeile 1723
		$websiteurl = $hostname.'/';
$websitename = 'Your Website';
$contactemail = '';

		$websiteurl = $hostname.'/';
$websitename = 'Your Website';
$contactemail = '';

 

$protocol = "http://";
if(!empty($_SERVER['HTTPS']) || substr($bburl, 0, 5) == "https")
{
$protocol = "https://";
}


		// Attempt auto-detection
if($_SERVER['HTTP_HOST'])
{

		// Attempt auto-detection
if($_SERVER['HTTP_HOST'])
{

			$hostname = 'http://'.$_SERVER['HTTP_HOST'];

			$hostname = $protocol.$_SERVER['HTTP_HOST'];

			$cookiedomain = '.'.$_SERVER['HTTP_HOST'];

			$cookiedomain = '.'.$_SERVER['HTTP_HOST'];

		}

		}

		elseif($_SERVER['SERVER_NAME'])
{

		elseif($_SERVER['SERVER_NAME'])
{

			$hostname = 'http://'.$_SERVER['SERVER_NAME'];

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

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

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

		}


		}


		if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);

		if(substr($cookiedomain, 0, 5) == ".www.")
{
$cookiedomain = my_substr($cookiedomain, 4);

		}

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

		}

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

		{
$cookiedomain = '';

		{
$cookiedomain = '';

		}


		}


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

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

Zeile 1754Zeile 1769
			else
{
$cookiepath = my_substr($currentlocation, 0, $pos).'/';

			else
{
$cookiepath = my_substr($currentlocation, 0, $pos).'/';

			}

			}

		}

$currentscript = $hostname.get_current_location();

		}

$currentscript = $hostname.get_current_location();

Zeile 1837Zeile 1852
					'optionscode' => $db->escape_string($setting['optionscode'][0]['value']),
'value' => $db->escape_string($setting['settingvalue'][0]['value']),
'disporder' => intval($setting['disporder'][0]['value']),

					'optionscode' => $db->escape_string($setting['optionscode'][0]['value']),
'value' => $db->escape_string($setting['settingvalue'][0]['value']),
'disporder' => intval($setting['disporder'][0]['value']),

					'gid' => $gid


					'gid' => $gid,
'isdefault' => 1

				);

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

				);

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

Zeile 1900Zeile 1916

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


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

		{

		{

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

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

			}


			}


			$conditions = array();

			$conditions = array();

			

 
			if(is_array($view['conditions'][0]['condition']))
{
foreach($view['conditions'][0]['condition'] as $condition)

			if(is_array($view['conditions'][0]['condition']))
{
foreach($view['conditions'][0]['condition'] as $condition)

Zeile 1918Zeile 1934
						$condition['value'] = unserialize($condition['value']);
}
$conditions[$condition['attributes']['name']] = $condition['value'];

						$condition['value'] = unserialize($condition['value']);
}
$conditions[$condition['attributes']['name']] = $condition['value'];

 
				}
}

$custom_profile_fields = array();
if(is_array($view['custom_profile_fields'][0]['field']))
{
foreach($view['custom_profile_fields'][0]['field'] as $field)
{
$custom_profile_fields[] = $field['attributes']['name'];

				}
}


				}
}


Zeile 1928Zeile 1953
				"title" => $db->escape_string($view['title'][0]['value']),
"fields" => $db->escape_string(serialize($fields)),
"conditions" => $db->escape_string(serialize($conditions)),

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

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

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

Zeile 1935Zeile 1961
			);
$db->insert_query("adminviews", $new_view);
$view_count++;

			);
$db->insert_query("adminviews", $new_view);
$view_count++;

		}

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

		}

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


echo $lang->admin_step_createadmin;
}


echo $lang->admin_step_createadmin;
}

Zeile 1951Zeile 1977
	global $output, $db, $mybb, $errors, $cache, $lang;

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

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

	{

	{

		$errors[] = $lang->admin_step_error_nopassword;
}
if($mybb->input['adminpass'] != $mybb->input['adminpass2'])

		$errors[] = $lang->admin_step_error_nopassword;
}
if($mybb->input['adminpass'] != $mybb->input['adminpass2'])

Zeile 1973Zeile 1999

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 1983Zeile 2009
	echo $lang->done_step_usergroupsinserted;

// Insert all of our user groups from the XML file

	echo $lang->done_step_usergroupsinserted;

// Insert all of our user groups from the XML file

	$settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
$parser = new XMLParser($settings);

	$usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
$parser = new XMLParser($usergroup_settings);

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


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


Zeile 2002Zeile 2028
			}

$new_group[$key] = $db->escape_string($value[0]['value']);

			}

$new_group[$key] = $db->escape_string($value[0]['value']);

		}

		}

		$db->insert_query("usergroups", $new_group, false);

// If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)

		$db->insert_query("usergroups", $new_group, false);

// If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)

Zeile 2012Zeile 2038
		}
$group_count++;
}

		}
$group_count++;
}

 

// Restart usergroup sequence with correct # of groups
if($config['database']['type'] == "pgsql")
{
$db->query("SELECT setval('{$config['database']['table_prefix']}usergroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}usergroups));");
}


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

echo $lang->done_step_admincreated;

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

echo $lang->done_step_admincreated;

Zeile 2151Zeile 2184
	$cache->update_spiders();
$cache->update_bannedips();
$cache->update_banned();

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

 
	$cache->update_bannedemails();

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

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

 
	$cache->update_threadprefixes();
$cache->update_forumsdisplay();

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


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