aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-12-08 15:20:57 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-12-08 15:20:57 +0000
commit1c41450bd90f86f47521952e7f48339f103b8e5d (patch)
tree3ec8b226ce76e5ba5de810e7e1325047851f3716 /phpBB/install
parent4519c510663b5c5168d6594d9eb96819a0c6bae0 (diff)
downloadforums-1c41450bd90f86f47521952e7f48339f103b8e5d.tar
forums-1c41450bd90f86f47521952e7f48339f103b8e5d.tar.gz
forums-1c41450bd90f86f47521952e7f48339f103b8e5d.tar.bz2
forums-1c41450bd90f86f47521952e7f48339f103b8e5d.tar.xz
forums-1c41450bd90f86f47521952e7f48339f103b8e5d.zip
- re-add script_path for "strange configurations" to let them force the generated urls correctly
- show rank title if no rank image present in memberlist - other fixes. git-svn-id: file:///svn/phpbb/trunk@6730 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php8
-rwxr-xr-xphpBB/install/install_install.php40
-rw-r--r--phpBB/install/install_update.php3
-rw-r--r--phpBB/install/schemas/schema_data.sql1
4 files changed, 44 insertions, 8 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index dae441f40b..e5c0998be5 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -490,6 +490,14 @@ if (version_compare($current_version, '3.0.b3', '<'))
$no_updates = false;
}
+if (version_compare($current_version, '3.0.b4', '<'))
+{
+ // Add config value
+ set_config('script_path', '/');
+
+ $no_updates = false;
+}
+
_write_result($no_updates, $errored, $error_ary);
$error_ary = array();
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index e88e13a05e..f5cf049327 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -987,6 +987,19 @@ class install_install extends module
$server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
$cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
+ if ($script_path === '')
+ {
+ $name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
+ if (!$name)
+ {
+ $name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
+ }
+
+ // Replace backslashes and doubled slashes (could happen on some proxy setups)
+ $name = str_replace(array('\\', '//', '/install'), '/', $name);
+ $script_path = trim(dirname($name));
+ }
+
foreach ($this->advanced_config_options as $config_key => $vars)
{
if (!is_array($vars) && strpos($config_key, 'legend') === false)
@@ -1166,6 +1179,22 @@ class install_install extends module
$user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
+ if ($script_path !== '/')
+ {
+ // Adjust destination path (no trailing slash)
+ if ($script_path[sizeof($script_path) - 1] == '/')
+ {
+ $script_path = substr($script_path, 0, -1);
+ }
+
+ $script_path = str_replace(array('../', './'), '', $script_path);
+
+ if ($script_path[0] != '/')
+ {
+ $script_path = '/' . $script_path;
+ }
+ }
+
// Set default config and post data, this applies to all DB's
$sql_ary = array(
'INSERT INTO ' . $table_prefix . "config (config_name, config_value)
@@ -1235,18 +1264,14 @@ class install_install extends module
WHERE config_name = 'force_server_vars'",
'UPDATE ' . $table_prefix . "config
- SET config_value = '" . $db->sql_escape($server_name) . "'
- WHERE config_name = 'server_name'",
+ SET config_value = '" . $db->sql_escape($script_path) . "'
+ WHERE config_name = 'script_path'",
'UPDATE ' . $table_prefix . "config
SET config_value = '" . $db->sql_escape($server_protocol) . "'
WHERE config_name = 'server_protocol'",
'UPDATE ' . $table_prefix . "config
- SET config_value = '" . $db->sql_escape($server_port) . "'
- WHERE config_name = 'server_port'",
-
- 'UPDATE ' . $table_prefix . "config
SET config_value = '" . $db->sql_escape($admin_name) . "'
WHERE config_name = 'newest_username'",
@@ -2025,7 +2050,7 @@ class install_install extends module
* The variables that we will be passing between pages
* Used to retrieve data quickly on each page
*/
- var $request_vars = array('language', 'dbms', 'dbhost', 'dbport', 'dbuser', 'dbpasswd', 'dbname', 'table_prefix', 'default_lang', 'admin_name', 'admin_pass1', 'admin_pass2', 'board_email1', 'board_email2', 'img_imagick', 'ftp_path', 'ftp_user', 'ftp_pass', 'email_enable', 'smtp_delivery', 'smtp_host', 'smtp_auth', 'smtp_user', 'smtp_pass', 'cookie_secure', 'force_server_vars', 'server_protocol', 'server_name', 'server_port');
+ var $request_vars = array('language', 'dbms', 'dbhost', 'dbport', 'dbuser', 'dbpasswd', 'dbname', 'table_prefix', 'default_lang', 'admin_name', 'admin_pass1', 'admin_pass2', 'board_email1', 'board_email2', 'img_imagick', 'ftp_path', 'ftp_user', 'ftp_pass', 'email_enable', 'smtp_delivery', 'smtp_host', 'smtp_auth', 'smtp_user', 'smtp_pass', 'cookie_secure', 'force_server_vars', 'server_protocol', 'server_name', 'server_port', 'script_path');
/**
* The information below will be used to build the input fields presented to the user
@@ -2064,6 +2089,7 @@ class install_install extends module
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true),
'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true),
+ 'script_path' => array('lang' => 'SCRIPT_PATH', 'type' => 'text::255', 'explain' => true),
);
/**
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 2a6de60d47..fed66a0a07 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -412,6 +412,7 @@ class install_update extends module
// To ease the update process create a file location map
$update_list = $cache->get('_update_list');
+ $script_path = ($config['force_server_vars']) ? (($config['script_path'] == '/') ? '/' : $config['script_path'] . '/') : $user->page['root_script_path'];
foreach ($update_list as $status => $files)
{
@@ -429,7 +430,7 @@ class install_update extends module
$template->assign_block_vars('location', array(
'SOURCE' => htmlspecialchars($file_struct['filename']),
- 'DESTINATION' => $user->page['root_script_path'] . htmlspecialchars($file_struct['filename']),
+ 'DESTINATION' => $script_path . htmlspecialchars($file_struct['filename']),
));
}
}
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 0cea5a5f72..795ca8becd 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -170,6 +170,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '600');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_indexing_state', '');