Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: index.php 2191 2006-09-03 12:11:04Z chris $
| * $Id: index.php 3006 2007-04-11 06:14:56Z Tikitiki $
|
*/ error_reporting(E_ALL & ~E_NOTICE);
|
*/ error_reporting(E_ALL & ~E_NOTICE);
|
define("MYBB_ROOT", dirname(dirname(__FILE__)));
| define('MYBB_ROOT', dirname(dirname(__FILE__))."/");
|
define("INSTALL_ROOT", dirname(__FILE__));
|
define("INSTALL_ROOT", dirname(__FILE__));
|
require_once MYBB_ROOT.'/inc/class_core.php';
| require_once MYBB_ROOT.'inc/class_core.php';
|
$mybb = new MyBB;
// Include the files necessary for installation
|
$mybb = new MyBB;
// Include the files necessary for installation
|
require_once MYBB_ROOT.'/inc/class_timers.php'; require_once MYBB_ROOT.'/inc/functions.php'; require_once MYBB_ROOT.'/admin/adminfunctions.php'; require_once MYBB_ROOT.'/inc/class_xml.php'; require_once MYBB_ROOT.'/inc/functions_user.php'; require_once MYBB_ROOT.'/inc/class_language.php';
| require_once MYBB_ROOT.'inc/class_timers.php'; require_once MYBB_ROOT.'inc/functions.php'; require_once MYBB_ROOT.'admin/adminfunctions.php'; require_once MYBB_ROOT.'inc/class_xml.php'; require_once MYBB_ROOT.'inc/functions_user.php'; require_once MYBB_ROOT.'inc/class_language.php';
|
$lang = new MyLanguage();
|
$lang = new MyLanguage();
|
$lang->set_path('.'); $lang->language = 'resources';
| $lang->set_path(MYBB_ROOT.'install/resources');
|
$lang->load('language');
// Include the necessary contants for installation
| $lang->load('language');
// Include the necessary contants for installation
|
Zeile 39 | Zeile 38 |
---|
$output = new installerOutput;
$dboptions = array();
|
$output = new installerOutput;
$dboptions = array();
|
// Get the current working directory $cwd = getcwd();
| |
if(function_exists('mysqli_connect')) { $dboptions['mysqli'] = array( 'title' => 'MySQL Improved',
|
if(function_exists('mysqli_connect')) { $dboptions['mysqli'] = array( 'title' => 'MySQL Improved',
|
'structure_file' => 'mysql_db_tables.php', 'population_file' => 'mysql_db_inserts.php'
| 'structure_file' => 'mysql_db_tables.php', 'population_file' => 'mysql_db_inserts.php'
|
); }
| ); }
|
Zeile 80 | Zeile 76 |
---|
'final' => $lang->finish_setup, ); if(!isset($mybb->input['action']))
|
'final' => $lang->finish_setup, ); if(!isset($mybb->input['action']))
|
{
| {
|
$mybb->input['action'] = 'intro'; } switch($mybb->input['action'])
| $mybb->input['action'] = 'intro'; } switch($mybb->input['action'])
|
Zeile 93 | Zeile 89 |
---|
break; case 'database_info': database_info();
|
break; case 'database_info': database_info();
|
break;
| break;
|
case 'create_tables': create_tables(); break;
| case 'create_tables': create_tables(); break;
|
Zeile 193 | Zeile 189 |
---|
{ $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_dboptions); $dbsupportlist = sprintf($lang->req_step_span_fail, $lang->none);
|
{ $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_dboptions); $dbsupportlist = sprintf($lang->req_step_span_fail, $lang->none);
|
$showerror = 1;
| $showerror = 1;
|
} else {
| } else {
|
Zeile 217 | Zeile 213 |
---|
}
// Check config file is writable
|
}
// Check config file is writable
|
$configwritable = @fopen(MYBB_ROOT.'/inc/config.php', 'w');
| $configwritable = @fopen(MYBB_ROOT.'inc/config.php', 'w');
|
if(!$configwritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_configfile);
| if(!$configwritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_configfile);
|
Zeile 231 | Zeile 227 |
---|
@fclose($configwritable);
// Check settings file is writable
|
@fclose($configwritable);
// Check settings file is writable
|
$settingswritable = @fopen(MYBB_ROOT.'/inc/settings.php', 'w');
| $settingswritable = @fopen(MYBB_ROOT.'inc/settings.php', 'w');
|
if(!$settingswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_settingsfile);
| if(!$settingswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_settingsfile);
|
Zeile 245 | Zeile 241 |
---|
@fclose($settingswritable);
// Check upload directory is writable
|
@fclose($settingswritable);
// Check upload directory is writable
|
$uploadswritable = @fopen(MYBB_ROOT.'/uploads/test.write', 'w');
| $uploadswritable = @fopen(MYBB_ROOT.'uploads/test.write', 'w');
|
if(!$uploadswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_uploaddir);
| if(!$uploadswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_uploaddir);
|
Zeile 257 | Zeile 253 |
---|
{ $uploadsstatus = sprintf($lang->req_step_span_pass, $lang->writable); @fclose($uploadswritable);
|
{ $uploadsstatus = sprintf($lang->req_step_span_pass, $lang->writable); @fclose($uploadswritable);
|
@chmod(MYBB_ROOT.'/uploads', 0777); @chmod(MYBB_ROOT.'/uploads/test.write', 0777); @unlink(MYBB_ROOT.'/uploads/test.write');
| @chmod(MYBB_ROOT.'uploads', 0777); @chmod(MYBB_ROOT.'uploads/test.write', 0777); @unlink(MYBB_ROOT.'uploads/test.write');
|
}
// Check avatar directory is writable
|
}
// Check avatar directory is writable
|
$avatarswritable = @fopen(MYBB_ROOT.'/uploads/avatars/test.write', 'w');
| $avatarswritable = @fopen(MYBB_ROOT.'uploads/avatars/test.write', 'w');
|
if(!$avatarswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir);
| if(!$avatarswritable) { $errors[] = sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir);
|
Zeile 275 | Zeile 271 |
---|
{ $avatarsstatus = sprintf($lang->req_step_span_pass, $lang->writable); @fclose($avatarswritable);
|
{ $avatarsstatus = sprintf($lang->req_step_span_pass, $lang->writable); @fclose($avatarswritable);
|
@chmod(MYBB_ROOT.'/uploads/avatars', 0777); @chmod(MYBB_ROOT.'/uploads/avatars/test.write', 0777); @unlink(MYBB_ROOT.'/uploads/avatars/test.write'); }
| @chmod(MYBB_ROOT.'uploads/avatars', 0777); @chmod(MYBB_ROOT.'uploads/avatars/test.write', 0777); @unlink(MYBB_ROOT.'uploads/avatars/test.write'); }
|
// Output requirements page
|
// Output requirements page
|
Zeile 304 | Zeile 300 |
---|
$output->print_header($lang->db_config, 'dbconfig');
// Check for errors from this stage
|
$output->print_header($lang->db_config, 'dbconfig');
// Check for errors from this stage
|
if(is_array($errors)) {
| if(is_array($errors)) {
|
$error_list = error_list($errors); echo sprintf($lang->db_step_error_config, $error_list); $dbhost = $mybb->input['dbhost'];
| $error_list = error_list($errors); echo sprintf($lang->db_step_error_config, $error_list); $dbhost = $mybb->input['dbhost'];
|
Zeile 336 | Zeile 332 |
---|
{ global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
|
{ global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
|
if(!file_exists(MYBB_ROOT."/inc/db_{$mybb->input['dbengine']}.php"))
| if(!file_exists(MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"))
|
{ $errors[] = $lang->db_step_error_invalidengine; database_info(); }
// Attempt to connect to the db
|
{ $errors[] = $lang->db_step_error_invalidengine; database_info(); }
// Attempt to connect to the db
|
require_once MYBB_ROOT."/inc/db_{$mybb->input['dbengine']}.php";
| require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php";
|
$db = new databaseEngine; $db->error_reporting = 0;
| $db = new databaseEngine; $db->error_reporting = 0;
|
Zeile 368 | Zeile 364 |
---|
// Write the configuration file $configdata = "<?php /**
|
// Write the configuration file $configdata = "<?php /**
|
* Daatabase configuration
| * Database configuration
|
*/
\$config['dbtype'] = '{$mybb->input['dbengine']}';
| */
\$config['dbtype'] = '{$mybb->input['dbengine']}';
|
Zeile 406 | Zeile 402 |
---|
* * If you wish to use the file system (inc/cache directory) * you can change the value below to 'files' from 'db'.
|
* * If you wish to use the file system (inc/cache directory) * you can change the value below to 'files' from 'db'.
|
*/
\$config['cache_store'] = 'db';
| */
\$config['cache_store'] = 'db';
|
/** * Super Administrators
| /** * Super Administrators
|
Zeile 421 | Zeile 417 |
---|
\$config['super_admins'] = '1'; ?>";
|
\$config['super_admins'] = '1'; ?>";
|
$file = fopen(MYBB_ROOT.'/inc/config.php', 'w');
| $file = fopen(MYBB_ROOT.'inc/config.php', 'w');
|
fwrite($file, $configdata); fclose($file);
|
fwrite($file, $configdata); fclose($file);
|
|
|
$output->print_header($lang->table_creation, 'createtables'); echo sprintf($lang->tablecreate_step_connected, $dboptions[$mybb->input['dbengine']]['title'], $db->get_version());
|
$output->print_header($lang->table_creation, 'createtables'); echo sprintf($lang->tablecreate_step_connected, $dboptions[$mybb->input['dbengine']]['title'], $db->get_version());
|
|
|
if($dboptions[$config['dbtype']]['structure_file'])
|
if($dboptions[$config['dbtype']]['structure_file'])
|
{
| {
|
$structure_file = $dboptions[$config['dbtype']]['structure_file']; } else
|
$structure_file = $dboptions[$config['dbtype']]['structure_file']; } else
|
{
| {
|
$structure_file = 'mysql_db_tables.php'; }
| $structure_file = 'mysql_db_tables.php'; }
|
Zeile 447 | Zeile 443 |
---|
{ $db->query('DROP TABLE IF EXISTS '.$match[1]); echo sprintf($lang->tablecreate_step_created, $match[1]);
|
{ $db->query('DROP TABLE IF EXISTS '.$match[1]); echo sprintf($lang->tablecreate_step_created, $match[1]);
|
}
| }
|
$db->query($val); if($match[1]) {
| $db->query($val); if($match[1]) {
|
Zeile 460 | Zeile 456 |
---|
function populate_tables() {
|
function populate_tables() {
|
global $output, $lang;
| global $output, $lang, $config;
|
|
|
require_once MYBB_ROOT.'/inc/config.php';
| require_once MYBB_ROOT.'inc/config.php';
|
$db = db_connection($config);
$output->print_header($lang->table_population, 'tablepopulate');
| $db = db_connection($config);
$output->print_header($lang->table_population, 'tablepopulate');
|
Zeile 489 | Zeile 485 |
---|
function insert_templates() {
|
function insert_templates() {
|
global $output, $cache, $db, $lang;
| global $output, $cache, $db, $lang, $config;
|
|
|
require_once MYBB_ROOT.'/inc/config.php';
| require_once MYBB_ROOT.'inc/config.php';
|
$db = db_connection($config);
|
$db = db_connection($config);
|
require_once MYBB_ROOT.'/inc/class_datacache.php';
| require_once MYBB_ROOT.'inc/class_datacache.php';
|
$cache = new datacache;
$output->print_header($lang->theme_installation, 'theme');
| $cache = new datacache;
$output->print_header($lang->theme_installation, 'theme');
|
Zeile 503 | Zeile 499 |
---|
$db->query("DELETE FROM ".TABLE_PREFIX."themes"); $db->query("DELETE FROM ".TABLE_PREFIX."templates");
|
$db->query("DELETE FROM ".TABLE_PREFIX."themes"); $db->query("DELETE FROM ".TABLE_PREFIX."templates");
|
$db->query("INSERT INTO ".TABLE_PREFIX."themes (name,pid,css,cssbits,themebits,extracss) VALUES ('MyBB Master Style','0','','','','')"); $db->query("INSERT INTO ".TABLE_PREFIX."themes (name,pid,def,css,cssbits,themebits,extracss) VALUES ('MyBB Default','1','1','','','','')");
| $db->query("INSERT INTO ".TABLE_PREFIX."themes (name,pid,css,cssbits,themebits,extracss,allowedgroups) VALUES ('MyBB Master Style','0','','','','','')"); $db->query("INSERT INTO ".TABLE_PREFIX."themes (name,pid,def,css,cssbits,themebits,extracss,allowedgroups) VALUES ('MyBB Default','1','1','','','','','')");
|
$db->query("INSERT INTO ".TABLE_PREFIX."templatesets (title) VALUES ('Default Templates');"); $templateset = $db->insert_id();
| $db->query("INSERT INTO ".TABLE_PREFIX."templatesets (title) VALUES ('Default Templates');"); $templateset = $db->insert_id();
|
Zeile 585 | Zeile 581 |
---|
function create_admin_user() {
|
function create_admin_user() {
|
global $output, $mybb, $errors, $db, $lang;
| global $output, $mybb, $errors, $db, $lang, $config;
|
$mybb->input['action'] = "adminuser"; // If no errors then check for errors from last step if(!is_array($errors))
| $mybb->input['action'] = "adminuser"; // If no errors then check for errors from last step if(!is_array($errors))
|
Zeile 614 | Zeile 610 |
---|
} else {
|
} else {
|
require_once MYBB_ROOT.'/inc/config.php';
| require_once MYBB_ROOT.'inc/config.php';
|
$db = db_connection($config);
echo $lang->admin_step_setupsettings;
| $db = db_connection($config);
echo $lang->admin_step_setupsettings;
|
Zeile 679 | Zeile 675 |
---|
function install_done() {
|
function install_done() {
|
global $output, $db, $mybb, $errors, $cache, $lang;
| global $output, $db, $mybb, $errors, $cache, $lang, $config;
|
if(empty($mybb->input['adminuser'])) {
| if(empty($mybb->input['adminuser'])) {
|
Zeile 702 | Zeile 698 |
---|
create_admin_user(); }
|
create_admin_user(); }
|
require_once MYBB_ROOT.'/inc/config.php';
| require_once MYBB_ROOT.'inc/config.php';
|
$db = db_connection($config);
|
$db = db_connection($config);
|
require_once MYBB_ROOT.'/inc/settings.php';
| require_once MYBB_ROOT.'inc/settings.php';
|
$mybb->settings = &$settings;
ob_start();
| $mybb->settings = &$settings;
ob_start();
|
Zeile 733 | Zeile 729 |
---|
'yahoo' => '', 'msn' =>'', 'birthday' => '',
|
'yahoo' => '', 'msn' =>'', 'birthday' => '',
|
| 'signature' => '',
|
'allownotices' => 'yes', 'hideemail' => 'no', 'emailnotify' => 'no',
| 'allownotices' => 'yes', 'hideemail' => 'no', 'emailnotify' => 'no',
|
Zeile 755 | Zeile 752 |
---|
'tpp' => 0, 'ppp' => 0, 'referrer' => 0,
|
'tpp' => 0, 'ppp' => 0, 'referrer' => 0,
|
| 'buddylist' => '', 'ignorelist' => '', 'pmfolders' => '', 'notepad' => ''
|
); $db->insert_query(TABLE_PREFIX.'users', $newuser); $uid = $db->insert_id();
| ); $db->insert_query(TABLE_PREFIX.'users', $newuser); $uid = $db->insert_id();
|
Zeile 762 | Zeile 763 |
---|
$db->query("INSERT INTO ".TABLE_PREFIX."adminoptions VALUES ('{$uid}','','','1','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes')");
// Automatic Login
|
$db->query("INSERT INTO ".TABLE_PREFIX."adminoptions VALUES ('{$uid}','','','1','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes')");
// Automatic Login
|
my_setcookie('mybbuser', $uid.'_'.$loginkey);
| my_setcookie('mybbuser', $uid.'_'.$loginkey, null, true);
|
ob_end_flush();
echo $lang->done . '</p>';
| ob_end_flush();
echo $lang->done . '</p>';
|
Zeile 782 | Zeile 783 |
---|
add_shutdown('test_shutdown_function');
echo $lang->done_step_cachebuilding;
|
add_shutdown('test_shutdown_function');
echo $lang->done_step_cachebuilding;
|
require_once MYBB_ROOT.'/inc/class_datacache.php';
| require_once MYBB_ROOT.'inc/class_datacache.php';
|
$cache = new datacache; $cache->updateversion(); $cache->updateattachtypes();
| $cache = new datacache; $cache->updateversion(); $cache->updateattachtypes();
|
Zeile 823 | Zeile 824 |
---|
function db_connection($config) {
|
function db_connection($config) {
|
require_once MYBB_ROOT."/inc/db_{$config['dbtype']}.php";
| require_once MYBB_ROOT."inc/db_{$config['dbtype']}.php";
|
$db = new databaseEngine; // Connect to Database define('TABLE_PREFIX', $config['table_prefix']);
| $db = new databaseEngine; // Connect to Database define('TABLE_PREFIX', $config['table_prefix']);
|
Zeile 845 | Zeile 846 |
---|
function write_settings() {
|
function write_settings() {
|
global $db, $cwd;
| global $db;
|
$query = $db->query('SELECT * FROM '.TABLE_PREFIX.'settings ORDER BY title ASC'); while($setting = $db->fetch_array($query)) {
| $query = $db->query('SELECT * FROM '.TABLE_PREFIX.'settings ORDER BY title ASC'); while($setting = $db->fetch_array($query)) {
|
Zeile 855 | Zeile 856 |
---|
if(!empty($settings)) { $settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";
|
if(!empty($settings)) { $settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";
|
$file = fopen(dirname($cwd)."/inc/settings.php", "w");
| $file = fopen(MYBB_ROOT."inc/settings.php", "w");
|
fwrite($file, $settings); fclose($file); }
| fwrite($file, $settings); fclose($file); }
|