Zeile 52 | Zeile 52 |
---|
} }
|
} }
|
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();
|
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');
|
$lang->load('language');
|
| // Load DB interface require_once MYBB_ROOT."inc/db_base.php"; require_once MYBB_ROOT."inc/AbstractPdoDbDriver.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');
|
$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');
|
$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 75 | Zeile 78 |
---|
$dboptions = array();
if(function_exists('mysqli_connect'))
|
$dboptions = array();
if(function_exists('mysqli_connect'))
|
{
| {
|
$dboptions['mysqli'] = array( 'class' => 'DB_MySQLi', 'title' => 'MySQL Improved', 'short_title' => 'MySQLi',
|
$dboptions['mysqli'] = array( '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 97 | Zeile 100 |
---|
}
if(function_exists('pg_connect'))
|
}
if(function_exists('pg_connect'))
|
{
| {
|
$dboptions['pgsql'] = array( 'class' => 'DB_PgSQL', 'title' => 'PostgreSQL', 'short_title' => 'PostgreSQL', 'structure_file' => 'pgsql_db_tables.php',
|
$dboptions['pgsql'] = array( 'class' => 'DB_PgSQL', 'title' => 'PostgreSQL', 'short_title' => 'PostgreSQL', 'structure_file' => 'pgsql_db_tables.php',
|
'population_file' => 'mysql_db_inserts.php'
| 'population_file' => 'pgsql_db_inserts.php'
|
);
|
);
|
}
| }
|
if(class_exists('PDO')) { $supported_dbs = PDO::getAvailableDrivers();
| if(class_exists('PDO')) { $supported_dbs = PDO::getAvailableDrivers();
|
Zeile 117 | Zeile 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' => 'pgsql_db_inserts.php' ); }
if (in_array('pgsql', $supported_dbs)) { $dboptions['pgsql_pdo'] = array( 'class' => 'PostgresPdoDbDriver', 'title' => 'PostgreSQL (PDO)', 'short_title' => 'PostgreSQL (PDO)', 'structure_file' => 'pgsql_db_tables.php', 'population_file' => 'pgsql_db_inserts.php' ); }
if (in_array('mysql', $supported_dbs)) { $dboptions['mysql_pdo'] = array( 'class' => 'MysqlPdoDbDriver', 'title' => 'MySQL (PDO)', 'short_title' => 'MySQL (PDO)', 'structure_file' => 'mysql_db_tables.php',
|
'population_file' => 'mysql_db_inserts.php' ); }
|
'population_file' => 'mysql_db_inserts.php' ); }
|
}
| }
|
if(file_exists('lock') && $mybb->dev_mode != true) {
| if(file_exists('lock') && $mybb->dev_mode != true) {
|
Zeile 133 | Zeile 156 |
---|
$output->print_footer(); } else
|
$output->print_footer(); } else
|
{
| {
|
$output->steps = array( 'intro' => $lang->welcome, 'license' => $lang->license_agreement,
| $output->steps = array( 'intro' => $lang->welcome, 'license' => $lang->license_agreement,
|
Zeile 151 | Zeile 174 |
---|
{ case 'license': license_agreement();
|
{ case 'license': license_agreement();
|
break;
| break;
|
case 'requirements_check': requirements_check(); break;
| case 'requirements_check': requirements_check(); break;
|
Zeile 160 | Zeile 183 |
---|
break; case 'create_tables': create_tables();
|
break; case 'create_tables': create_tables();
|
break;
| break;
|
case 'populate_tables': populate_tables(); break;
| case 'populate_tables': populate_tables(); break;
|
Zeile 169 | Zeile 192 |
---|
break; case 'configuration': configure();
|
break; case 'configuration': configure();
|
break;
| break;
|
case 'adminuser': create_admin_user();
|
case 'adminuser': create_admin_user();
|
break;
| break;
|
case 'final': install_done();
|
case 'final': install_done();
|
break;
| break;
|
default: $mybb->input['action'] = 'intro'; intro(); break;
|
default: $mybb->input['action'] = 'intro'; intro(); break;
|
} }
| } }
|
|
|
| /** * Welcome page */
|
function intro() { global $output, $mybb, $lang;
|
function intro() { global $output, $mybb, $lang;
|
$output->print_header($lang->welcome, 'welcome'); if(strpos(strtolower($_SERVER['PHP_SELF']), "upload/") !== false)
| $output->print_header(); if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false)
|
{ echo $lang->sprintf($lang->mybb_incorrect_folder); }
| { echo $lang->sprintf($lang->mybb_incorrect_folder); }
|
Zeile 196 | Zeile 222 |
---|
$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 203 | Zeile 232 |
---|
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 280 | Zeile 309 |
---|
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
|
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
|
|
|
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated
| The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated
|
Zeile 293 | Zeile 322 |
---|
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
|
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
|
document.
| document.
|
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
| 4. Combined Works.
You may convey a Combined Work under terms of your choice that,
|
Zeile 316 | Zeile 345 |
---|
copies of the GNU GPL and this license document.
d) Do one of the following:
|
copies of the GNU GPL and this license document.
d) Do one of the following:
|
|
|
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to
| 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to
|
Zeile 343 | Zeile 372 |
---|
Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
|
Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
|
|
|
5. Combined Libraries.
You may place library facilities that are a work based on the
| 5. Combined Libraries.
You may place library facilities that are a work based on the
|
Zeile 351 | Zeile 380 |
---|
facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
|
facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
|
|
|
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.
|
Zeile 495 | Zeile 524 |
---|
menu, a prominent item in the list meets this criterion.
1. Source Code.
|
menu, a prominent item in the list meets this criterion.
1. Source Code.
|
|
|
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
| The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
|
Zeile 603 | Zeile 632 |
---|
released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
|
released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
|
|
|
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7
| c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7
|
Zeile 638 | Zeile 667 |
---|
(including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
(including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
|
|
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as
| b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as
|
Zeile 1010 | Zeile 1039 |
---|
$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; $errors = array(); $showerror = 0;
|
$mybb->input['action'] = "requirements_check"; $output->print_header($lang->req_check, 'requirements'); echo $lang->req_step_top; $errors = array(); $showerror = 0;
|
|
|
if(!file_exists(MYBB_ROOT."/inc/config.php")) { if(!@rename(MYBB_ROOT."/inc/config.default.php", MYBB_ROOT."/inc/config.php"))
| if(!file_exists(MYBB_ROOT."/inc/config.php")) { if(!@rename(MYBB_ROOT."/inc/config.default.php", MYBB_ROOT."/inc/config.php"))
|
Zeile 1035 | Zeile 1067 |
---|
// Check PHP Version if(version_compare(PHP_VERSION, '5.2.0', "<"))
|
// Check PHP Version if(version_compare(PHP_VERSION, '5.2.0', "<"))
|
{
| {
|
$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;
| $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;
|
Zeile 1085 | Zeile 1117 |
---|
// Check XML parser is installed if(!function_exists('xml_parser_create'))
|
// Check XML parser is installed if(!function_exists('xml_parser_create'))
|
{
| {
|
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_xmlsupport); $xmlstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_installed); $showerror = 1;
| $errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_xmlsupport); $xmlstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_installed); $showerror = 1;
|
Zeile 1106 | Zeile 1138 |
---|
else { $configstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
|
else { $configstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
|
| @fclose($configwritable);
|
}
|
}
|
@fclose($configwritable);
| |
// Check settings file is writable $settingswritable = @fopen(MYBB_ROOT.'inc/settings.php', 'w');
| // Check settings file is writable $settingswritable = @fopen(MYBB_ROOT.'inc/settings.php', 'w');
|
Zeile 1120 | Zeile 1152 |
---|
else { $settingsstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
|
else { $settingsstatus = $lang->sprintf($lang->req_step_span_pass, $lang->writable);
|
| @fclose($settingswritable);
|
}
|
}
|
@fclose($settingswritable);
| |
// Check cache directory is writable $cachewritable = @fopen(MYBB_ROOT.'cache/test.write', 'w');
| // Check cache directory is writable $cachewritable = @fopen(MYBB_ROOT.'cache/test.write', 'w');
|
Zeile 1130 | Zeile 1162 |
---|
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_cachedir); $cachestatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable); $showerror = 1;
|
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_cachedir); $cachestatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable); $showerror = 1;
|
@fclose($cachewritable);
| |
} else {
| } else {
|
Zeile 1148 | Zeile 1179 |
---|
$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;
|
$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);
| |
} else {
| } else {
|
Zeile 1166 | Zeile 1196 |
---|
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir); $avatarsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable); $showerror = 1;
|
$errors[] = $lang->sprintf($lang->req_step_error_box, $lang->req_step_error_avatardir); $avatarsstatus = $lang->sprintf($lang->req_step_span_fail, $lang->not_writable); $showerror = 1;
|
@fclose($avatarswritable);
| |
} else {
| } else {
|
Zeile 1195 | Zeile 1224 |
---|
} }
|
} }
|
| /** * 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 1213 | Zeile 1245 |
---|
if(dbengine+'_settings' == element.attr('id')) { element.show();
|
if(dbengine+'_settings' == element.attr('id')) { element.show();
|
}
| }
|
else { element.hide();
| else { element.hide();
|
Zeile 1231 | Zeile 1263 |
---|
{ $error_list = error_list($errors); echo $lang->sprintf($lang->db_step_error_config, $error_list);
|
{ $error_list = error_list($errors); echo $lang->sprintf($lang->db_step_error_config, $error_list);
|
}
| }
|
else { echo $lang->db_step_config_db; }
|
else { echo $lang->db_step_config_db; }
|
|
|
$dbengines = '';
// Loop through database engines
| $dbengines = '';
// Loop through database engines
|
Zeile 1249 | Zeile 1281 |
---|
else { $dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
|
else { $dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
|
}
| }
|
}
$db_info = array();
| }
$db_info = array();
|
Zeile 1259 | Zeile 1291 |
---|
$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 1322 | Zeile 1354 |
---|
<tr> <td class=\"first\"><label for=\"config_{$dbfile}_dbuser\">{$lang->database_user}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbuser]\" id=\"config_{$dbfile}_dbuser\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbuser'])."\" /></td>
|
<tr> <td class=\"first\"><label for=\"config_{$dbfile}_dbuser\">{$lang->database_user}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbuser]\" id=\"config_{$dbfile}_dbuser\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbuser'])."\" /></td>
|
</tr>
| </tr>
|
<tr class=\"alt_row\"> <td class=\"first\"><label for=\"config_{$dbfile}_dbpass\">{$lang->database_pass}</label></td> <td class=\"last alt_col\"><input type=\"password\" class=\"text_input\" name=\"config[{$dbfile}][dbpass]\" id=\"config_{$dbfile}_dbpass\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbpass'])."\" /></td>
| <tr class=\"alt_row\"> <td class=\"first\"><label for=\"config_{$dbfile}_dbpass\">{$lang->database_pass}</label></td> <td class=\"last alt_col\"><input type=\"password\" class=\"text_input\" name=\"config[{$dbfile}][dbpass]\" id=\"config_{$dbfile}_dbpass\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbpass'])."\" /></td>
|
Zeile 1373 | Zeile 1405 |
---|
$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 1383 | Zeile 1418 |
---|
$errors[] = $lang->db_step_error_invalidengine; database_info(); }
|
$errors[] = $lang->db_step_error_invalidengine; 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 1394 | Zeile 1429 |
---|
$errors[] = $lang->db_step_error_sqlite_invalid_dbname; database_info(); }
|
$errors[] = $lang->db_step_error_sqlite_invalid_dbname; database_info(); }
|
}
| }
|
// Attempt to connect to the db require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"; switch($mybb->input['dbengine']) { case "sqlite": $db = new DB_SQLite;
|
// Attempt to connect to the db require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"; switch($mybb->input['dbengine']) { case "sqlite": $db = new DB_SQLite;
|
break;
| break;
|
case "pgsql": $db = new DB_PgSQL;
|
case "pgsql": $db = new DB_PgSQL;
|
| break; case "pgsql_pdo": $db = new PostgresPdoDbDriver();
|
break; case "mysqli": $db = new DB_MySQLi;
|
break; case "mysqli": $db = new DB_MySQLi;
|
| break; case "mysql_pdo": $db = new MysqlPdoDbDriver();
|
break; default: $db = new DB_MySQL; } $db->error_reporting = 0;
|
break; default: $db = new DB_MySQL; } $db->error_reporting = 0;
|
| if(!isset($config['encoding'])) { $config['encoding'] = null; }
|
$connect_array = array( "hostname" => $config['dbhost'],
| $connect_array = array( "hostname" => $config['dbhost'],
|
Zeile 1425 | Zeile 1471 |
---|
$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 1446 | Zeile 1492 |
---|
$errors[] = $lang->db_step_error_tableprefix_too_long; }
|
$errors[] = $lang->db_step_error_tableprefix_too_long; }
|
if(($db->engine == 'mysql' || $db->engine == 'mysqli') && $config['encoding'] == 'utf8mb4' && version_compare($db->get_version(), '5.5.3', '<'))
| if($connection !== false && ($db->engine == 'mysql' || $db->engine == 'mysqli') && $config['encoding'] == 'utf8mb4' && version_compare($db->get_version(), '5.5.3', '<'))
|
{ $errors[] = $lang->db_step_error_utf8mb4_error; }
| { $errors[] = $lang->db_step_error_utf8mb4_error; }
|
Zeile 1459 | Zeile 1505 |
---|
// 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 1475 | Zeile 1519 |
---|
* * 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 1511 | Zeile 1555 |
---|
* The data cache is a temporary cache * of the most commonly accessed data in MyBB. * By default, the database is used to store this data.
|
* The data cache is a temporary cache * 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'. */
\$config['cache_store'] = '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';
|
/** * Memcache configuration * If you are using memcache or memcached as your
| /** * Memcache configuration * If you are using memcache or memcached as your
|
Zeile 1525 | Zeile 1569 |
---|
* and port of your memcache server below. * * If not using memcache, ignore this section.
|
* and port of your memcache server below. * * If not using memcache, ignore this section.
|
*/
| */
|
\$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 1566 | Zeile 1623 |
---|
'mail_logs' => 180, // Mail error logs 'user_mail_logs' => 180, // User mail logs 'promotion_logs' => 180 // Promotion logs
|
'mail_logs' => 180, // Mail error logs 'user_mail_logs' => 180, // User mail 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( '0.0.0.0', '127.0.0.0/8', '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 1595 | Zeile 1689 |
---|
$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);
|
$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(!empty($match[1]))
|
{ $db->drop_table($match[1], false, false); echo $lang->sprintf($lang->tablecreate_step_created, $match[1]); } $db->query($val);
|
{ $db->drop_table($match[1], false, false); echo $lang->sprintf($lang->tablecreate_step_created, $match[1]); } $db->query($val);
|
if($match[1])
| if(!empty($match[1]))
|
{ echo $lang->done . "<br />\n"; }
| { echo $lang->done . "<br />\n"; }
|
Zeile 1610 | Zeile 1704 |
---|
$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 1623 | Zeile 1720 |
---|
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';
|
}
| }
|
require_once INSTALL_ROOT."resources/{$population_file}"; foreach($inserts as $val) {
| require_once INSTALL_ROOT."resources/{$population_file}"; foreach($inserts as $val) {
|
Zeile 1649 | Zeile 1746 |
---|
$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));"); }
|
$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; $output->print_footer('templates'); }
|
echo $lang->populate_step_inserted; $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;
|
|
|
require MYBB_ROOT.'inc/config.php'; $db = db_connection($config);
| require MYBB_ROOT.'inc/config.php'; $db = db_connection($config);
|
Zeile 1709 | Zeile 1809 |
---|
// 1.8: Stylesheet Colors $contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme_colors.xml');
|
// 1.8: Stylesheet Colors $contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme_colors.xml');
|
require_once MYBB_ROOT."inc/class_xml.php"; $parser = new XMLParser($contents);
| $parser = create_xml_parser($contents);
|
$tree = $parser->get_tree();
if(is_array($tree) && is_array($tree['colors']))
| $tree = $parser->get_tree();
if(is_array($tree) && is_array($tree['colors']))
|
Zeile 1758 | Zeile 1857 |
---|
} }
|
} }
|
$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;
$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'); if(inp.value != inp.defaultValue) { if(!parenttr.next('.setting_peeker').length)
|
function warnUser(inp, warn) { var parenttr = $('#'+inp.id).closest('tr'); if(inp.value != inp.defaultValue) { if(!parenttr.next('.setting_peeker').length)
|
{
| {
|
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>'); }
|
Zeile 1790 | Zeile 1892 |
---|
} } }
|
} } }
|
|
|
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 1823 | Zeile 1925 |
---|
{ $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 1834 | Zeile 1934 |
---|
}
// 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']; }
|
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 1860 | Zeile 1960 |
---|
$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']; } $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)
| $port = ":{$_SERVER['SERVER_PORT']}"; $pos = strrpos($cookiedomain, $port);
if($pos !== false)
|
{
|
{
|
$cookiepath = "/";
| $cookiedomain = substr($cookiedomain, 0, $pos);
|
}
|
}
|
else
| if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && !preg_match("#:[0-9]#i", $hostname))
|
{
|
{
|
$cookiepath = my_substr($currentlocation, 0, $pos).'/';
| $hostname .= $port;
|
} }
|
} }
|
$currentscript = $hostname.get_current_location();
if($currentscript) { $bburl = my_substr($currentscript, 0, my_strpos($currentscript, '/install/')); }
if($_SERVER['SERVER_ADMIN'])
| $currentlocation = get_current_location('', '', true); $noinstall = substr($currentlocation, 0, strrpos($currentlocation, '/install/'));
$cookiepath = $noinstall.'/'; $bburl = $hostname.$noinstall; $websiteurl = $hostname.'/';
if(isset($_SERVER['SERVER_ADMIN']) && filter_var($_SERVER['SERVER_ADMIN'], FILTER_VALIDATE_EMAIL))
|
{ $contactemail = $_SERVER['SERVER_ADMIN'];
|
{ $contactemail = $_SERVER['SERVER_ADMIN'];
|
| } else { $contactemail = null;
|
} }
| } }
|
Zeile 1898 | Zeile 1997 |
---|
$output->print_footer('adminuser'); }
|
$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 1905 | Zeile 2007 |
---|
$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))
|
{
| {
|
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;
|
}
| }
|
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 1938 | Zeile 2040 |
---|
} } </script>
|
} } </script>
|
|
|
EOF;
if(is_array($errors))
| EOF;
if(is_array($errors))
|
Zeile 1957 | Zeile 2059 |
---|
$adminuser = $adminemail = '';
$settings = file_get_contents(INSTALL_ROOT.'resources/settings.xml');
|
$adminuser = $adminemail = '';
$settings = file_get_contents(INSTALL_ROOT.'resources/settings.xml');
|
$parser = new XMLParser($settings);
| $parser = create_xml_parser($settings);
|
$parser->collapse_dups = 0; $tree = $parser->get_tree(); $groupcount = $settingcount = 0;
| $parser->collapse_dups = 0; $tree = $parser->get_tree(); $groupcount = $settingcount = 0;
|
Zeile 2028 | Zeile 2130 |
---|
include_once MYBB_ROOT."inc/functions_task.php"; $tasks = file_get_contents(INSTALL_ROOT.'resources/tasks.xml');
|
include_once MYBB_ROOT."inc/functions_task.php"; $tasks = file_get_contents(INSTALL_ROOT.'resources/tasks.xml');
|
$parser = new XMLParser($tasks);
| $parser = create_xml_parser($tasks);
|
$parser->collapse_dups = 0; $tree = $parser->get_tree(); $taskcount = 0;
| $parser->collapse_dups = 0; $tree = $parser->get_tree(); $taskcount = 0;
|
Zeile 2066 | Zeile 2168 |
---|
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');
|
$parser = new XMLParser($views);
| $parser = create_xml_parser($views);
|
$parser->collapse_dups = 0; $tree = $parser->get_tree(); $view_count = 0;
| $parser->collapse_dups = 0; $tree = $parser->get_tree(); $view_count = 0;
|
Zeile 2108 | Zeile 2210 |
---|
"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 2129 | Zeile 2231 |
---|
$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 2167 | Zeile 2272 |
---|
// Insert all of our user groups from the XML file $usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
|
// Insert all of our user groups from the XML file $usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml');
|
$parser = new XMLParser($usergroup_settings);
| $parser = create_xml_parser($usergroup_settings);
|
$parser->collapse_dups = 0; $tree = $parser->get_tree();
| $parser->collapse_dups = 0; $tree = $parser->get_tree();
|
Zeile 2222 | Zeile 2327 |
---|
'lastvisit' => $now, 'website' => '', 'icq' => '',
|
'lastvisit' => $now, 'website' => '', 'icq' => '',
|
'aim' => '', 'yahoo' => '',
| |
'skype' =>'', 'google' =>'', 'birthday' => '',
| 'skype' =>'', 'google' =>'', 'birthday' => '',
|
Zeile 2234 | Zeile 2337 |
---|
'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 2253 | Zeile 2358 |
---|
'referrer' => 0, 'buddylist' => '', 'ignorelist' => '',
|
'referrer' => 0, 'buddylist' => '', 'ignorelist' => '',
|
'pmfolders' => '',
| 'pmfolders' => "0**$%%$1**$%%$2**$%%$3**$%%$4**",
|
'notepad' => '', 'showredirect' => 1, 'usernotes' => ''
| 'notepad' => '', 'showredirect' => 1, 'usernotes' => ''
|
Zeile 2263 | Zeile 2368 |
---|
echo $lang->done_step_adminoptions; $adminoptions = file_get_contents(INSTALL_ROOT.'resources/adminoptions.xml');
|
echo $lang->done_step_adminoptions; $adminoptions = file_get_contents(INSTALL_ROOT.'resources/adminoptions.xml');
|
$parser = new XMLParser($adminoptions);
| $parser = create_xml_parser($adminoptions);
|
$parser->collapse_dups = 0; $tree = $parser->get_tree(); $insertmodule = array();
| $parser->collapse_dups = 0; $tree = $parser->get_tree(); $insertmodule = array();
|
Zeile 2293 | Zeile 2398 |
---|
'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 2306 | Zeile 2411 |
---|
// 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 2340 | Zeile 2445 |
---|
$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_threadprefixes(); $cache->update_forumsdisplay(); $cache->update("plugins", array());
|
$cache->update_bannedemails(); $cache->update_birthdays(); $cache->update_groupleaders(); $cache->update_threadprefixes(); $cache->update_forumsdisplay(); $cache->update("plugins", array());
|
| $cache->update("mostonline", array( 'numusers' => 0, 'time' => 0, ));
|
$cache->update("internal_settings", array('encryption_key' => random_str(32))); $cache->update_default_theme();
|
$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 2377 | Zeile 2486 |
---|
if(is_writable('./')) { $lock = @fopen('./lock', 'w');
|
if(is_writable('./')) { $lock = @fopen('./lock', 'w');
|
$written = @fwrite($lock, '1'); @fclose($lock); if($written)
| if($lock !== false)
|
{
|
{
|
echo $lang->done_step_locked;
| $written = @fwrite($lock, '1'); @fclose($lock);
if($written) { echo $lang->done_step_locked; }
|
} } if(!$written) { echo $lang->done_step_dirdelete;
|
} } if(!$written) { echo $lang->done_step_dirdelete;
|
}
| }
|
echo $lang->done_whats_next; $output->print_footer(''); }
|
echo $lang->done_whats_next; $output->print_footer(''); }
|
| /** * @param array $config * * @return DB_MySQL|DB_MySQLi|DB_PgSQL|DB_SQLite|PostgresPdoDbDriver|MysqlPdoDbDriver */
|
function db_connection($config)
|
function db_connection($config)
|
{
| {
|
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type']) { case "sqlite": $db = new DB_SQLite;
|
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type']) { case "sqlite": $db = new DB_SQLite;
|
break;
| break;
|
case "pgsql": $db = new DB_PgSQL;
|
case "pgsql": $db = new DB_PgSQL;
|
break;
| break; case "pgsql_pdo": $db = new PostgresPdoDbDriver(); break;
|
case "mysqli": $db = new DB_MySQLi;
|
case "mysqli": $db = new DB_MySQLi;
|
| break; case "mysql_pdo": $db = new MysqlPdoDbDriver();
|
break; default: $db = new DB_MySQL;
| break; default: $db = new DB_MySQL;
|
Zeile 2412 | Zeile 2537 |
---|
// Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
|
// Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
|
|
|
$db->connect($config['database']); $db->set_table_prefix(TABLE_PREFIX); $db->type = $config['database']['type'];
return $db;
|
$db->connect($config['database']); $db->set_table_prefix(TABLE_PREFIX); $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 2431 | Zeile 2561 |
---|
return $string; }
|
return $string; }
|
| /** * Write our settings to the settings file */
|
function write_settings() { global $db;
| function write_settings() { global $db;
|
Zeile 2439 | Zeile 2572 |
---|
$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))
|
Zeile 2450 | Zeile 2584 |
---|
fclose($file); } }
|
fclose($file); } }
|
?>
| |