aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php16
-rw-r--r--phpBB/install/database_update.php85
-rw-r--r--[-rwxr-xr-x]phpBB/install/index.php0
-rw-r--r--phpBB/install/install_convert.php18
-rw-r--r--[-rwxr-xr-x]phpBB/install/install_install.php13
-rw-r--r--[-rwxr-xr-x]phpBB/install/install_main.php0
-rw-r--r--phpBB/install/schemas/schema_data.sql7
7 files changed, 96 insertions, 43 deletions
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index ae7c9959f1..63644d7212 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -31,8 +31,8 @@ unset($dbpasswd);
*/
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
- 'version' => '1.0.1',
- 'phpbb_version' => '3.0.1',
+ 'version' => '1.0.2',
+ 'phpbb_version' => '3.0.2',
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
@@ -191,7 +191,7 @@ if (!$get_info)
{
$src_db->sql_freeresult($result);
}
-
+
/**
* Tests for further MODs can be included here.
@@ -265,7 +265,7 @@ if (!$get_info)
* - empty string == execute nothing
* - string == function to execute
* - array == complex execution instructions
-*
+*
* Complex execution instructions:
* @todo test complex execution instructions - in theory they will work fine
*
@@ -307,7 +307,7 @@ if (!$get_info)
array('target', $convert->truncate_statement . SEARCH_WORDMATCH_TABLE),
array('target', $convert->truncate_statement . LOG_TABLE),
),
-
+
// with this you are able to import all attachment files on the fly. For large boards this is not an option, therefore commented out by default.
// Instead every file gets copied while processing the corresponding attachment entry.
// if (defined("MOD_ATTACHMENT")) { import_attachment_files(); phpbb_copy_thumbnails(); }
@@ -489,7 +489,7 @@ if (!$get_info)
array('poll_max_options', 1, ''),
array('poll_vote_change', 0, ''),
- 'left_join' => array ( 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1',
+ 'left_join' => array ( 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1',
'topics LEFT JOIN posts ON topics.topic_last_post_id = posts.post_id',
),
'where' => 'topics.topic_moved_id = 0',
@@ -687,7 +687,7 @@ if (!$get_info)
array('user_id', 'users.user_id', 'phpbb_user_id'),
array('folder_name', $user->lang['CONV_SAVED_MESSAGES'], ''),
array('pm_count', 0, ''),
-
+
'where' => 'users.user_id <> -1',
),
@@ -711,7 +711,7 @@ if (!$get_info)
'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND (privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)',
),
-
+
// Outbox
array(
'target' => PRIVMSGS_TO_TABLE,
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 211bbec8d1..43d8c06a27 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.1';
+$updates_to_version = '3.0.2-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -33,7 +33,7 @@ error_reporting(E_ALL);
// Include essential scripts
include($phpbb_root_path . 'config.' . $phpEx);
-if (!isset($dbms))
+if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update.");
}
@@ -496,6 +496,12 @@ $database_update_info = array(
GROUPS_TABLE => array('group_legend'),
),
),
+ // No changes from 3.0.1-RC1 to 3.0.1
+ '3.0.1-RC1' => array(),
+ // No changes from 3.0.1 to 3.0.2-RC1
+ '3.0.1' => array(),
+// uncomment once RC1 out - no changes from 3.0.2-RC1 to 3.0.2
+// '3.0.2-RC1' => array(),
);
// Determine mapping database type
@@ -581,6 +587,11 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
+/*if ($debug_from_version !== false)
+{
+ $config['version'] = $debug_from_version;
+}*/
+
echo $lang['PREVIOUS_VERSION'] . ' :: <strong>' . $config['version'] . '</strong><br />';
echo $lang['UPDATED_VERSION'] . ' :: <strong>' . $updates_to_version . '</strong></p>';
@@ -604,7 +615,7 @@ else
// Checks/Operations that have to be completed prior to starting the update itself
$exit = false;
-if (version_compare($current_version, '3.0.RC8', '<='))
+if (version_compare($current_version, '3.0.RC8', '<=')) /* && $debug_from_version === false) */
{
// Define missing language entries...
if (!isset($lang['CLEANING_USERNAMES']))
@@ -932,7 +943,7 @@ if (version_compare($current_version, '3.0.RC8', '<='))
foreach ($user_ids as $i => $user_id)
{
$row = $users[$user_id];
-
+
$rank_title = $rank_img = '';
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
@@ -1092,13 +1103,20 @@ for ($i = 0; $i < sizeof($versions); $i++)
$next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
- if (!sizeof($schema_changes))
+ // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
+ if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
{
continue;
}
- // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
- if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
+/* if ($debug_from_version !== false)
+ {
+ // Applying update schema for version array with key '$version'
+ // for version '$version' to '$next_version'
+ continue;
+ }*/
+
+ if (!sizeof($schema_changes))
{
continue;
}
@@ -1209,10 +1227,7 @@ $errored = $no_updates = false;
flush();
$no_updates = true;
-
-$versions = array(
- '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0'
-);
+$versions = array_keys($database_update_info);
// some code magic
for ($i = 0; $i < sizeof($versions); $i++)
@@ -1226,8 +1241,14 @@ for ($i = 0; $i < sizeof($versions); $i++)
continue;
}
- $no_updates = false;
- change_database_data($version);
+/* if ($debug_from_version !== false)
+ {
+ // Applying update schema for version array with key '$version'
+ // for version '$version' to '$next_version'
+ continue;
+ }*/
+
+ change_database_data($no_updates, $version);
}
_write_result($no_updates, $errored, $error_ary);
@@ -1246,6 +1267,9 @@ $errored = $no_updates = false;
flush();
+//if ($debug_from_version === false)
+// {
+
// update the version
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$updates_to_version'
@@ -1258,6 +1282,8 @@ $sql = 'UPDATE ' . USERS_TABLE . "
user_perm_from = 0";
_sql($sql, $errored, $error_ary);
+// }
+
/* Optimize/vacuum analyze the tables where appropriate
// this should be done for each version in future along with
// the version number update
@@ -1324,7 +1350,7 @@ $cache->purge();
</div>
</div>
</div>
-
+
<div id="page-footer">
Powered by phpBB &copy; 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>
</div>
@@ -1345,7 +1371,7 @@ if (function_exists('exit_handler'))
/**
* Function where all data changes are executed
*/
-function change_database_data($version)
+function change_database_data(&$no_updates, $version)
{
global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
@@ -1364,7 +1390,7 @@ function change_database_data($version)
$smileys[$row['smiley_id']] = $row['code'];
}
$db->sql_freeresult($result);
-
+
foreach ($smileys as $id => $code)
{
// 2.0 only entitized lt and gt; We need to do something about double quotes.
@@ -1392,6 +1418,7 @@ function change_database_data($version)
sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id'));
}
+ $no_updates = false;
break;
case '3.0.RC3':
@@ -1481,6 +1508,7 @@ function change_database_data($version)
set_config('allow_birthdays', '1');
set_config('cron_lock', '0', true);
+ $no_updates = false;
break;
case '3.0.RC4':
@@ -1678,6 +1706,7 @@ function change_database_data($version)
set_config('ldap_port', '');
set_config('ldap_user_filter', '');
+ $no_updates = false;
break;
case '3.0.RC5':
@@ -1699,7 +1728,7 @@ function change_database_data($version)
$sql = 'SELECT forum_id, forum_password
FROM ' . FORUMS_TABLE;
$result = _sql($sql, $errored, $error_ary);
-
+
while ($row = $db->sql_fetchrow($result))
{
if (!empty($row['forum_password']))
@@ -1708,9 +1737,10 @@ function change_database_data($version)
}
}
$db->sql_freeresult($result);
-
+
$db->sql_transaction('commit');
+ $no_updates = false;
break;
case '3.0.0':
@@ -1719,7 +1749,7 @@ function change_database_data($version)
SET topic_last_view_time = topic_last_post_time
WHERE topic_last_view_time = 0";
_sql($sql, $errored, $error_ary);
-
+
// Update smiley sizes
$smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
@@ -1728,18 +1758,27 @@ function change_database_data($version)
if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
{
list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
-
+
$sql = 'UPDATE ' . SMILIES_TABLE . '
SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
-
+
_sql($sql, $errored, $error_ary);
}
}
-
- // TODO: remove all form token min times
+ $no_updates = false;
+ break;
+
+ case '3.0.1-RC1':
+
+ set_config('referer_validation', '1');
+ set_config('check_attachment_content', '1');
+ set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
+
+ $no_updates = false;
break;
+
}
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index bbf7fe34d3..bbf7fe34d3 100755..100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 081b1a6c31..25d8551df4 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -298,7 +298,7 @@ class install_convert extends module
if (isset($convertor_data))
{
$sort[strtolower($convertor_data['forum_name'])] = sizeof($convertors);
-
+
$convertors[] = array(
'tag' => $m[1],
'forum_name' => $convertor_data['forum_name'],
@@ -585,7 +585,7 @@ class install_convert extends module
function convert_data($sub)
{
global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache;
- global $convert, $convert_row, $message_parser, $skip_rows;
+ global $convert, $convert_row, $message_parser, $skip_rows, $language;
require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
@@ -891,7 +891,7 @@ class install_convert extends module
{
$table = $convert->src_table_prefix . $m[1];
$tables_list[$table] = $table;
-
+
if (!empty($m[3]))
{
$aliases[] = $convert->src_table_prefix . $m[3];
@@ -948,7 +948,7 @@ class install_convert extends module
// Throw an error if some tables are missing
// We used to do some guessing here, but since we have a suggestion of possible values earlier, I don't see it adding anything here to do it again
-
+
if (sizeof($missing_tables) == sizeof($tables_list))
{
$this->p_master->error($user->lang['NO_TABLES_FOUND'] . ' ' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__);
@@ -1299,7 +1299,7 @@ class install_convert extends module
if ($errored)
{
$db->sql_return_on_error(true);
-
+
// Because it errored out we will try to insert the rows one by one... most of the time this
// is caused by duplicate entries - but we also do not want to miss one...
foreach ($waiting_rows as $waiting_sql)
@@ -1607,7 +1607,7 @@ class install_convert extends module
'TITLE' => $user->lang['UPDATE_TOPICS_POSTED'],
'RESULT' => $user->lang['DONE'],
));
-
+
if ($db->sql_error_triggered)
{
$template->assign_vars(array(
@@ -1617,7 +1617,7 @@ class install_convert extends module
));
}
$db->sql_return_on_error(false);
-
+
$this->finish_conversion();
return;
}
@@ -1949,7 +1949,7 @@ class install_convert extends module
$firstkey_set = false;
$firstkey = 0;
-
+
foreach ($fields[1] as $inner_key => $inner_value)
{
if (!$firstkey_set)
@@ -1974,7 +1974,7 @@ class install_convert extends module
{
$sql_flag = true;
}
-
+
// No function assigned?
if (empty($fields[2]))
{
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index f7d6d0a9c4..282afd5e23 100755..100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1021,6 +1021,12 @@ class install_install extends module
// 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'));
+ // HTTP HOST can carry a port number...
+ if (strpos($server_name, ':') !== false)
+ {
+ $server_name = substr($server_name, 0, strpos($server_name, ':'));
+ }
+
$data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true;
$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'));
@@ -1114,6 +1120,13 @@ class install_install extends module
// 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'));
+
+ // HTTP HOST can carry a port number...
+ if (strpos($server_name, ':') !== false)
+ {
+ $server_name = substr($server_name, 0, strpos($server_name, ':'));
+ }
+
$cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name;
// Try to come up with the best solution for cookie domain...
diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php
index e9f35efa1d..e9f35efa1d 100755..100644
--- a/phpBB/install/install_main.php
+++ b/phpBB/install/install_main.php
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 43ab04d77e..3dfe8ae0d9 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -64,6 +64,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_y_grid', '25');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_attachment_content', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
@@ -172,8 +173,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_time_reg', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_time_terms', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0');
@@ -184,6 +184,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 ('referer_validation', '1');
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');
@@ -213,7 +214,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.2-RC1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');