mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Merging revisions #r8346, #r8347 and #r8348
git-svn-id: file:///svn/phpbb/trunk@8349 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -450,7 +450,7 @@ class module
|
||||
global $db, $template;
|
||||
|
||||
$template->display('body');
|
||||
|
||||
|
||||
// Close our DB connection.
|
||||
if (!empty($db) && is_object($db))
|
||||
{
|
||||
@@ -493,7 +493,8 @@ class module
|
||||
*/
|
||||
function redirect($page)
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
|
||||
$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
|
||||
|
||||
@@ -511,7 +512,11 @@ class module
|
||||
|
||||
if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
|
||||
{
|
||||
$url .= ':' . $server_port;
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') === false)
|
||||
{
|
||||
$url .= ':' . $server_port;
|
||||
}
|
||||
}
|
||||
|
||||
$url .= $script_path . '/' . $page;
|
||||
@@ -535,7 +540,7 @@ class module
|
||||
$l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat);
|
||||
$cat = strtolower($cat);
|
||||
$url = $this->module_url . "?mode=$cat&language=$language";
|
||||
|
||||
|
||||
if ($this->mode == $cat)
|
||||
{
|
||||
$template->assign_block_vars('t_block1', array(
|
||||
|
@@ -77,7 +77,7 @@ class install_install extends module
|
||||
|
||||
case 'database':
|
||||
$this->obtain_database_settings($mode, $sub);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'administrator':
|
||||
@@ -87,7 +87,7 @@ class install_install extends module
|
||||
|
||||
case 'config_file':
|
||||
$this->create_config_file($mode, $sub);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'advanced':
|
||||
@@ -105,7 +105,7 @@ class install_install extends module
|
||||
$this->add_language($mode, $sub);
|
||||
$this->add_bots($mode, $sub);
|
||||
$this->email_admin($mode, $sub);
|
||||
|
||||
|
||||
// Remove the lock file
|
||||
@unlink($phpbb_root_path . 'cache/install_lock');
|
||||
|
||||
@@ -184,8 +184,8 @@ class install_install extends module
|
||||
'S_EXPLAIN' => true,
|
||||
'S_LEGEND' => false,
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
// Check for url_fopen
|
||||
if (@ini_get('allow_url_fopen') == '1' || strtolower(@ini_get('allow_url_fopen')) == 'on')
|
||||
{
|
||||
@@ -204,8 +204,8 @@ class install_install extends module
|
||||
'S_EXPLAIN' => true,
|
||||
'S_LEGEND' => false,
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
// Check for getimagesize
|
||||
if (@function_exists('getimagesize'))
|
||||
{
|
||||
@@ -822,7 +822,7 @@ class install_install extends module
|
||||
$s_hidden_fields .= '<input type="hidden" name="' . $config_key . '" value="' . $data[$config_key] . '" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$s_hidden_fields .= ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
|
||||
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $data['language'] . '" />';
|
||||
|
||||
@@ -927,7 +927,7 @@ class install_install extends module
|
||||
$config_data .= "@define('DEBUG', true);\n";
|
||||
$config_data .= "@define('DEBUG_EXTRA', true);\n";
|
||||
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
|
||||
|
||||
|
||||
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
|
||||
if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) || is_writable($phpbb_root_path))
|
||||
{
|
||||
@@ -1038,8 +1038,11 @@ class install_install extends module
|
||||
$s_hidden_fields = ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
|
||||
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $data['language'] . '" />';
|
||||
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
|
||||
$data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true;
|
||||
$data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name;
|
||||
$data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'));
|
||||
$data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
|
||||
$data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
|
||||
@@ -1129,7 +1132,9 @@ class install_install extends module
|
||||
$this->p_master->redirect("index.$phpEx?mode=install");
|
||||
}
|
||||
|
||||
$cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
// HTTP_HOST is having the correct browser url in most cases...
|
||||
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
|
||||
$cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name;
|
||||
|
||||
// Try to come up with the best solution for cookie domain...
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
@@ -1327,11 +1332,11 @@ class install_install extends module
|
||||
'UPDATE ' . $data['table_prefix'] . "config
|
||||
SET config_value = '" . $db->sql_escape($data['admin_name']) . "'
|
||||
WHERE config_name = 'newest_username'",
|
||||
|
||||
|
||||
'UPDATE ' . $data['table_prefix'] . "config
|
||||
SET config_value = '" . md5(mt_rand()) . "'
|
||||
WHERE config_name = 'avatar_salt'",
|
||||
|
||||
|
||||
'UPDATE ' . $data['table_prefix'] . "users
|
||||
SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email1']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . hexdec(crc32($data['board_email1']) . strlen($data['board_email1'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "'
|
||||
WHERE username = 'Admin'",
|
||||
@@ -1590,7 +1595,7 @@ class install_install extends module
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$_module->move_module_by($row, 'move_up', 4);
|
||||
|
||||
// Move permissions intro screen module 4 up...
|
||||
@@ -1602,7 +1607,7 @@ class install_install extends module
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$_module->move_module_by($row, 'move_up', 4);
|
||||
|
||||
// Move manage users screen module 5 up...
|
||||
@@ -1614,7 +1619,7 @@ class install_install extends module
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$_module->move_module_by($row, 'move_up', 5);
|
||||
}
|
||||
|
||||
@@ -1629,7 +1634,7 @@ class install_install extends module
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$_module->move_module_by($row, 'move_down', 4);
|
||||
}
|
||||
|
||||
@@ -1854,7 +1859,7 @@ class install_install extends module
|
||||
'user_dateformat' => $lang['default_dateformat'],
|
||||
'user_allow_massemail' => 0,
|
||||
);
|
||||
|
||||
|
||||
$user_id = user_add($user_row);
|
||||
|
||||
if (!$user_id)
|
||||
|
Reference in New Issue
Block a user