Zeile 56 | Zeile 56 |
---|
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');
// Load DB interface
| $lang->load('language');
// Load DB interface
|
Zeile 67 | Zeile 67 |
---|
// Include the necessary constants for installation $grouppermignore = array('gid', 'type', 'title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');
|
// 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');
| $groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperuser', 'maxreputationsperthread', 'emailfloodtime');
|
$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image'); $fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');
| $displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image'); $fpermfields = array('canview', 'canviewthreads', 'candlattachments', 'canpostthreads', 'canpostreplys', 'canpostattachments', 'canratethreads', 'caneditposts', 'candeleteposts', 'candeletethreads', 'caneditattachments', 'canpostpolls', 'canvotepolls', 'cansearch', 'modposts', 'modthreads', 'modattachments', 'mod_edit_posts');
|
Zeile 106 | Zeile 106 |
---|
'title' => 'PostgreSQL', 'short_title' => 'PostgreSQL', 'structure_file' => 'pgsql_db_tables.php',
|
'title' => 'PostgreSQL', 'short_title' => 'PostgreSQL', 'structure_file' => 'pgsql_db_tables.php',
|
'population_file' => 'mysql_db_inserts.php'
| 'population_file' => 'pgsql_db_inserts.php'
|
); }
| ); }
|
Zeile 120 | 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' => 'mysql_db_inserts.php'
| 'population_file' => 'pgsql_db_inserts.php'
|
); } }
| ); } }
|
Zeile 193 | Zeile 193 |
---|
{ global $output, $mybb, $lang;
|
{ global $output, $mybb, $lang;
|
$output->print_header($lang->welcome, 'welcome');
| $output->print_header();
|
if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false) { echo $lang->sprintf($lang->mybb_incorrect_folder);
| if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false) { echo $lang->sprintf($lang->mybb_incorrect_folder);
|
Zeile 1443 | Zeile 1443 |
---|
$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 1467 | Zeile 1467 |
---|
if(($db->engine == 'mysql' || $db->engine == 'mysqli') && $config['encoding'] == 'utf8mb4' && version_compare($db->get_version(), '5.5.3', '<')) { $errors[] = $lang->db_step_error_utf8mb4_error;
|
if(($db->engine == 'mysql' || $db->engine == 'mysqli') && $config['encoding'] == 'utf8mb4' && version_compare($db->get_version(), '5.5.3', '<')) { $errors[] = $lang->db_step_error_utf8mb4_error;
|
}
| }
|
if(is_array($errors)) {
| if(is_array($errors)) {
|
Zeile 1476 | Zeile 1476 |
---|
// 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 1493 | Zeile 1491 |
---|
* * 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 1532 | Zeile 1530 |
---|
* * 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'.
|
* * 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';
| */
\$config['cache_store'] = 'db';
|
/** * Memcache configuration
| /** * Memcache configuration
|
Zeile 1584 | Zeile 1582 |
---|
'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( '127.0.0.1', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16',
|
);
";
| );
";
|
Zeile 1591 | Zeile 1620 |
---|
$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 1633 | Zeile 1667 |
---|
*/ 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 1648 | Zeile 1682 |
---|
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 1704 | Zeile 1738 |
---|
$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml'); if(!empty($mybb->config['admin_dir']) && file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
|
$contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml'); if(!empty($mybb->config['admin_dir']) && file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
|
{
| {
|
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"; require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"; }
| require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"; require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"; }
|
Zeile 1796 | Zeile 1830 |
---|
global $output, $mybb, $errors, $lang;
$output->print_header($lang->board_config, 'config');
|
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 1817 | Zeile 1851 |
---|
} } }
|
} } }
|
|
|
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 1859 | Zeile 1893 |
---|
}
// Attempt auto-detection
|
}
// Attempt auto-detection
|
if($_SERVER['HTTP_HOST'])
| if(!empty($_SERVER['HTTP_HOST']))
|
{ $hostname = $protocol.$_SERVER['HTTP_HOST']; $cookiedomain = $_SERVER['HTTP_HOST']; }
|
{ $hostname = $protocol.$_SERVER['HTTP_HOST']; $cookiedomain = $_SERVER['HTTP_HOST']; }
|
elseif($_SERVER['SERVER_NAME'])
| elseif(!empty($_SERVER['SERVER_NAME']))
|
{ $hostname = $protocol.$_SERVER['SERVER_NAME']; $cookiedomain = $_SERVER['SERVER_NAME'];
| { $hostname = $protocol.$_SERVER['SERVER_NAME']; $cookiedomain = $_SERVER['SERVER_NAME'];
|
Zeile 1885 | Zeile 1919 |
---|
$cookiedomain = ".{$cookiedomain}"; }
|
$cookiedomain = ".{$cookiedomain}"; }
|
if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && !preg_match("#:[0-9]#i", $hostname))
| if(!empty($_SERVER['SERVER_PORT']))
|
{
|
{
|
$hostname .= ':'.$_SERVER['SERVER_PORT'];
| $port = ":{$_SERVER['SERVER_PORT']}"; $pos = strrpos($cookiedomain, $port);
if($pos !== false) { $cookiedomain = substr($cookiedomain, 0, $pos); }
if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && !preg_match("#:[0-9]#i", $hostname)) { $hostname .= $port; }
|
}
|
}
|
|
|
$currentlocation = get_current_location('', '', true); $noinstall = substr($currentlocation, 0, strrpos($currentlocation, '/install/'));
|
$currentlocation = get_current_location('', '', true); $noinstall = substr($currentlocation, 0, strrpos($currentlocation, '/install/'));
|
|
|
$cookiepath = $noinstall.'/'; $bburl = $hostname.$noinstall; $websiteurl = $hostname.'/';
|
$cookiepath = $noinstall.'/'; $bburl = $hostname.$noinstall; $websiteurl = $hostname.'/';
|
$contactemail = $_SERVER['SERVER_ADMIN'];
| if(isset($_SERVER['SERVER_ADMIN']) && filter_var($_SERVER['SERVER_ADMIN'], FILTER_VALIDATE_EMAIL)) { $contactemail = $_SERVER['SERVER_ADMIN']; }
|
}
echo $lang->sprintf($lang->config_step_table, $bbname, $bburl, $websitename, $websiteurl, $cookiedomain, $cookiepath, $contactemail);
| }
echo $lang->sprintf($lang->config_step_table, $bbname, $bburl, $websitename, $websiteurl, $cookiedomain, $cookiepath, $contactemail);
|
Zeile 1915 | Zeile 1964 |
---|
if(!is_array($errors)) { if(empty($mybb->input['bburl']))
|
if(!is_array($errors)) { if(empty($mybb->input['bburl']))
|
{
| {
|
$errors[] = $lang->config_step_error_url; } if(empty($mybb->input['bbname']))
|
$errors[] = $lang->config_step_error_url; } if(empty($mybb->input['bbname']))
|
{
| {
|
$errors[] = $lang->config_step_error_name; } if(is_array($errors))
| $errors[] = $lang->config_step_error_name; } if(is_array($errors))
|
Zeile 1928 | Zeile 1977 |
---|
} } $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 1946 | Zeile 1995 |
---|
} } </script>
|
} } </script>
|
|
|
EOF;
if(is_array($errors))
| EOF;
if(is_array($errors))
|
Zeile 2233 | Zeile 2282 |
---|
'lastvisit' => $now, 'website' => '', 'icq' => '',
|
'lastvisit' => $now, 'website' => '', 'icq' => '',
|
'aim' => '',
| |
'yahoo' => '', 'skype' =>'', 'google' =>'',
| 'yahoo' => '', 'skype' =>'', 'google' =>'',
|
Zeile 2319 | Zeile 2367 |
---|
// 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 2362 | Zeile 2410 |
---|
$cache->update("plugins", array()); $cache->update("internal_settings", array('encryption_key' => random_str(32))); $cache->update_default_theme();
|
$cache->update("plugins", array()); $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");
|