From 5a429ee61e54f78da1120395c05d9fb5a2af7d04 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 1 Feb 2010 01:14:06 +0000 Subject: Change version numbers to 3.0.7 and 3.0.8-dev in preparation for development on next release git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10468 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c7205de89d..4efc52088f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.7-dev'; +$updates_to_version = '3.0.8-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index b8455f3347..cb704cad7c 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -241,7 +241,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.6'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.7'); 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'); -- cgit v1.2.1 From f90bab90c742fbbff89a9b9ae78b7c921a6e139c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 1 Feb 2010 01:18:21 +0000 Subject: Change version number to 3.0.8-dev in preparation for development on next release git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10469 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/schema_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index cb704cad7c..38088b291d 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -241,7 +241,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.7'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8-dev'); 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'); -- cgit v1.2.1 From 99c608e88c267e0fa7517da196e1701ba163c26a Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Thu, 4 Feb 2010 00:40:19 +0000 Subject: Bug #57265 - Convertors cannot read configuration files git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10473 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/convert_phpbb20.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 5a6603883b..1d6b79bbec 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -32,7 +32,7 @@ unset($dbpasswd); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.0.6', + 'phpbb_version' => '3.0.7', 'author' => 'phpBB Group', 'dbms' => $dbms, 'dbhost' => $dbhost, @@ -78,6 +78,15 @@ $tables = array( * * 'table_format' can take the value 'file' to indicate a config file. In this case array_name * is set to indicate the name of the array the config values are stored in +* Example of using a file: +* $config_schema = array( +* 'table_format' => 'file', +* 'filename' => 'NAME OF FILE', // If the file is not in the root directory, the path needs to be added with no leading slash +* 'array_name' => 'NAME OF ARRAY', // Only used if the configuration file stores the setting in an array. +* 'settings' => array( +* 'board_email' => 'SUPPORT_EMAIL', // target config name => source target name +* ) +* ); * 'table_format' can be an array if the values are stored in a table which is an assosciative array * (as per phpBB 2.0.x) * If left empty, values are assumed to be stored in a table where each config setting is -- cgit v1.2.1 From 1802b9ff9286a7fc24493e71b3432816cbdbfcd8 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Feb 2010 00:02:51 +0000 Subject: Support for Microsoft's Native SQL Server Driver for PHP - Patch by Chris Pucci at Microsoft [Bug #57055] If you are using SQL Server, please try to test this new dbal so we can safely include it in 3.0.8. If you want to try it on a current phpBB version you can apply the latest version of the patch to your board which you can find attached to the bug tracker ticket (look in the comments for the latest version, the one in the ticket itself is outdated): http://www.phpbb.com/bugs/phpbb3/ticket.php?ticket_id=57055 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10489 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 51 +++++++++++++++++++++++++++++++--- phpBB/install/install_convert.php | 2 ++ phpBB/install/install_install.php | 3 +- phpBB/install/schemas/mssql_schema.sql | 8 ------ 4 files changed, 51 insertions(+), 13 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4efc52088f..055fa78995 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1743,7 +1743,37 @@ class updater_db_tools 'VCHAR_CI' => '[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + + 'mssqlnative' => array( + 'INT:' => '[int]', + 'BINT' => '[float]', + 'UINT' => '[int]', + 'UINT:' => '[int]', + 'TINT:' => '[int]', + 'USINT' => '[int]', + 'BOOL' => '[int]', + 'VCHAR' => '[varchar] (255)', + 'VCHAR:' => '[varchar] (%d)', + 'CHAR:' => '[char] (%d)', + 'XSTEXT' => '[varchar] (1000)', + 'STEXT' => '[varchar] (3000)', + 'TEXT' => '[varchar] (8000)', + 'MTEXT' => '[text]', + 'XSTEXT_UNI'=> '[varchar] (100)', + 'STEXT_UNI' => '[varchar] (255)', + 'TEXT_UNI' => '[varchar] (4000)', + 'MTEXT_UNI' => '[text]', + 'TIMESTAMP' => '[int]', + 'DECIMAL' => '[float]', + 'DECIMAL:' => '[float]', + 'PDECIMAL' => '[float]', + 'PDECIMAL:' => '[float]', + 'VCHAR_UNI' => '[varchar] (255)', + 'VCHAR_UNI:'=> '[varchar] (%d)', + 'VCHAR_CI' => '[varchar] (255)', + 'VARBINARY' => '[varchar] (255)', + ), + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -1845,7 +1875,7 @@ class updater_db_tools * A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules. * @var array */ - var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite'); + var $supported_dbms = array('firebird', 'mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite'); /** * This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array). @@ -1890,6 +1920,10 @@ class updater_db_tools case 'mssql_odbc': $this->sql_layer = 'mssql'; break; + + case 'mssqlnative': + $this->sql_layer = 'mssqlnative'; + break; default: $this->sql_layer = $this->db->sql_layer; @@ -2322,6 +2356,7 @@ class updater_db_tools // same deal with PostgreSQL, we must perform more complex operations than // we technically could case 'mssql': + case 'mssqlnative': $sql = "SELECT c.name FROM syscolumns c LEFT JOIN sysobjects o ON c.id = o.id @@ -2425,7 +2460,7 @@ class updater_db_tools */ function sql_index_exists($table_name, $index_name) { - if ($this->sql_layer == 'mssql') + if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative') { $sql = "EXEC sp_statistics '$table_name'"; $result = $this->db->sql_query($sql); @@ -2530,7 +2565,7 @@ class updater_db_tools */ function sql_unique_index_exists($table_name, $index_name) { - if ($this->sql_layer == 'mssql') + if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative') { $sql = "EXEC sp_statistics '$table_name'"; $result = $this->db->sql_query($sql); @@ -2769,6 +2804,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $sql .= " {$column_type} "; $sql_default = " {$column_type} "; @@ -2918,6 +2954,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': // Does not support AFTER, only through temporary table $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default']; break; @@ -3042,6 +3079,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']'; break; @@ -3136,6 +3174,7 @@ class updater_db_tools switch ($this->sql_layer) { case 'mssql': + case 'mssqlnative': $statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name; break; @@ -3172,6 +3211,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD "; $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED ("; $sql .= '[' . implode("],\n\t\t[", $column) . ']'; @@ -3265,6 +3305,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]'; break; } @@ -3294,6 +3335,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]'; break; } @@ -3326,6 +3368,7 @@ class updater_db_tools break; case 'mssql': + case 'mssqlnative': $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql']; if (!empty($column_data['default'])) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 7f1b9de5b6..06c3a8b4a6 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -1248,6 +1248,7 @@ class install_convert extends module { case 'mssql': case 'mssql_odbc': + case 'mssqlnative': $db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' ON'); break; } @@ -1375,6 +1376,7 @@ class install_convert extends module { case 'mssql': case 'mssql_odbc': + case 'mssqlnative': $db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' OFF'); break; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 1cc1365752..f4989b5bd7 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1203,6 +1203,7 @@ class install_install extends module { case 'mssql': case 'mssql_odbc': + case 'mssqlnative': $sql_query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $sql_query); break; @@ -1375,7 +1376,7 @@ class install_install extends module $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config SET config_value = 'phpbb_captcha_gd' WHERE config_name = 'captcha_plugin'"; - + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config SET config_value = '1' WHERE config_name = 'captcha_gd'"; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 960c6eeaed..0827b14cc2 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -4,9 +4,6 @@ */ -BEGIN TRANSACTION -GO - /* Table: 'phpbb_attachments' */ @@ -1733,8 +1730,3 @@ ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD ) ON [PRIMARY] GO - - -COMMIT -GO - -- cgit v1.2.1 From 68cac354aac9df3866944685186733c4d7305aee Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 17 Feb 2010 12:58:52 +0000 Subject: Add 3.0.7-RC1 to the updater. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10497 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 055fa78995..909c390a9e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -906,6 +906,9 @@ function database_update_info() ), ), ), + + // No changes from 3.0.7-RC1 to 3.0.7 + '3.0.7-RC1' => array(), ); } @@ -1597,6 +1600,10 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + + // No changes from 3.0.7-RC1 to 3.0.7 + case '3.0.7-RC1': + break; } } -- cgit v1.2.1 From 30b83896a1718400307de7d531c16a152c0f6668 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 18 Feb 2010 01:17:30 +0000 Subject: Fix Bug #57755 - Make user_email_hash() function independent from system's architecture. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10499 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 909c390a9e..29d82be987 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1603,6 +1603,34 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.7-RC1 to 3.0.7 case '3.0.7-RC1': + + $sql = 'SELECT user_id, user_email, user_email_hash + FROM ' . USERS_TABLE . ' + WHERE user_type <> ' . USER_IGNORE . " + AND user_email <> ''"; + $result = $db->sql_query($sql); + + $i = 0; + while ($row = $db->sql_fetchrow($result)) + { + $user_email_hash = phpbb_email_hash($row['user_email']); + + if ($user_email_hash != $row['user_email_hash']) + { + $sql_ary = array( + 'user_email_hash' => $user_email_hash, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $row['user_id']; + __sql($sql, $errored, $error_ary, ($i % 100 == 0)); + + ++$i; + } + } + $db->sql_freeresult($result); + break; } } -- cgit v1.2.1 From c02fedb6c7a80da0be5bd84fe512b3ba6df9f9ee Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 18 Feb 2010 02:01:32 +0000 Subject: Revising r10499, #57755 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10503 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 29d82be987..5cb2cd28cc 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1601,7 +1601,7 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; - // No changes from 3.0.7-RC1 to 3.0.7 + // Changes from 3.0.7-RC1 to 3.0.7 case '3.0.7-RC1': $sql = 'SELECT user_id, user_email, user_email_hash @@ -1624,13 +1624,15 @@ function change_database_data(&$no_updates, $version) $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . (int) $row['user_id']; - __sql($sql, $errored, $error_ary, ($i % 100 == 0)); + _sql($sql, $errored, $error_ary, ($i % 100 == 0)); ++$i; } } $db->sql_freeresult($result); + $no_updates = false; + break; } } -- cgit v1.2.1 From 576722cead7f2de34db3e5a853662bca0e0601da Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 18 Feb 2010 02:06:20 +0000 Subject: Adding 3.0.7-RC2 to database updater git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10504 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 5cb2cd28cc..4db78331bd 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -907,8 +907,10 @@ function database_update_info() ), ), - // No changes from 3.0.7-RC1 to 3.0.7 + // No changes from 3.0.7-RC1 to 3.0.7-RC2 '3.0.7-RC1' => array(), + // No changes from 3.0.7-RC2 to 3.0.7 + '3.0.7-RC2' => array(), ); } @@ -1601,7 +1603,7 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; - // Changes from 3.0.7-RC1 to 3.0.7 + // Changes from 3.0.7-RC1 to 3.0.7-RC2 case '3.0.7-RC1': $sql = 'SELECT user_id, user_email, user_email_hash @@ -1634,6 +1636,10 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + + // No changes from 3.0.7-RC2 to 3.0.7 + case '3.0.7-RC2': + break; } } -- cgit v1.2.1 From e8f01ff74b58d9d73ff3c32507d843b8b14d92e5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 22 Feb 2010 19:33:27 +0000 Subject: We have to use a 'snapshot' of the function there, because it might not be available yet. - Bug #57755 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10520 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4db78331bd..df8aadfdb2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1615,7 +1615,9 @@ function change_database_data(&$no_updates, $version) $i = 0; while ($row = $db->sql_fetchrow($result)) { - $user_email_hash = phpbb_email_hash($row['user_email']); + // Snapshot of the phpbb_email_hash() function + // We cannot call it directly because the auto updater updates the DB first. :/ + $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']); if ($user_email_hash != $row['user_email_hash']) { -- cgit v1.2.1 From 47ce0f2a93ebe00c11c9951447693e922221be2e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 23 Feb 2010 23:35:48 +0000 Subject: Update: Store expected resulting file contents in cache and do not suggest further merges if the contents match, also fixes infinite merge loop [Bug #54075] If you were trying to update from 3.0.5 to 3.0.6 but were presented with a dialogue suggesting to merge the same file over and over take the install/install_update.php from 3.0.7-RC2 or current svn, and replace your 3.0.5 one with it. It works fine in 3.0.5. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10528 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_update.php | 105 +++++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 25 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 9f5a428029..a5e54a354a 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -240,6 +240,7 @@ class install_update extends module // Make sure the update list is destroyed. $cache->destroy('_update_list'); $cache->destroy('_diff_files'); + $cache->destroy('_expected_files'); break; case 'version_check': @@ -312,7 +313,14 @@ class install_update extends module case 'file_check': - // Make sure the previous file collection is no longer valid... + // retrieve info on what changes should have already been made to the files. + $expected_files = $cache->get('_expected_files'); + if (!$expected_files) + { + $expected_files = array(); + } + + // Now make sure the previous file collection is no longer valid... $cache->destroy('_diff_files'); $this->page_title = 'STAGE_FILE_CHECK'; @@ -349,7 +357,7 @@ class install_update extends module if ($get_new_list) { - $this->get_update_structure($update_list); + $this->get_update_structure($update_list, $expected_files); $cache->put('_update_list', $update_list); // Refresh the page if we are still not finished... @@ -384,6 +392,8 @@ class install_update extends module ); } + $new_expected_files = array(); + // Now assign the list to the template foreach ($update_list as $status => $filelist) { @@ -419,29 +429,38 @@ class install_update extends module $diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])); - $template->assign_block_vars($status, array( - 'STATUS' => $status, + if (isset($file_struct['as_expected']) && $file_struct['as_expected']) + { + $new_expected_files[$file_struct['filename']] = $expected_files[$file_struct['filename']]; + } + else + { + $template->assign_block_vars($status, array( + 'STATUS' => $status, - 'FILENAME' => $filename, - 'DIR_PART' => $dir_part, - 'FILE_PART' => $file_part, - 'NUM_CONFLICTS' => (isset($file_struct['conflicts'])) ? $file_struct['conflicts'] : 0, + 'FILENAME' => $filename, + 'DIR_PART' => $dir_part, + 'FILE_PART' => $file_part, + 'NUM_CONFLICTS' => (isset($file_struct['conflicts'])) ? $file_struct['conflicts'] : 0, - 'S_CUSTOM' => ($file_struct['custom']) ? true : false, - 'S_BINARY' => $s_binary, - 'CUSTOM_ORIGINAL' => ($file_struct['custom']) ? $file_struct['original'] : '', + 'S_CUSTOM' => ($file_struct['custom']) ? true : false, + 'S_BINARY' => $s_binary, + 'CUSTOM_ORIGINAL' => ($file_struct['custom']) ? $file_struct['original'] : '', - 'U_SHOW_DIFF' => $diff_url, - 'L_SHOW_DIFF' => ($status != 'up_to_date') ? $user->lang['SHOW_DIFF_' . strtoupper($status)] : '', + 'U_SHOW_DIFF' => $diff_url, + 'L_SHOW_DIFF' => ($status != 'up_to_date') ? $user->lang['SHOW_DIFF_' . strtoupper($status)] : '', - 'U_VIEW_MOD_FILE' => $diff_url . '&op=' . MERGE_MOD_FILE, - 'U_VIEW_NEW_FILE' => $diff_url . '&op=' . MERGE_NEW_FILE, - 'U_VIEW_NO_MERGE_MOD' => $diff_url . '&op=' . MERGE_NO_MERGE_MOD, - 'U_VIEW_NO_MERGE_NEW' => $diff_url . '&op=' . MERGE_NO_MERGE_NEW, - )); + 'U_VIEW_MOD_FILE' => $diff_url . '&op=' . MERGE_MOD_FILE, + 'U_VIEW_NEW_FILE' => $diff_url . '&op=' . MERGE_NEW_FILE, + 'U_VIEW_NO_MERGE_MOD' => $diff_url . '&op=' . MERGE_NO_MERGE_MOD, + 'U_VIEW_NO_MERGE_NEW' => $diff_url . '&op=' . MERGE_NO_MERGE_NEW, + )); + } } } + $cache->put('_expected_files', $new_expected_files); + $all_up_to_date = true; foreach ($update_list as $status => $filelist) { @@ -617,6 +636,7 @@ class install_update extends module // Before we do anything, let us diff the files and store the raw file information "somewhere" $get_files = false; $file_list = $cache->get('_diff_files'); + $expected_files = $cache->get('_expected_files'); if ($file_list === false || $file_list['status'] != -1) { @@ -632,6 +652,11 @@ class install_update extends module ); } + if (!isset($expected_files) || $expected_files === false) + { + $expected_files = array(); + } + $processed = 0; foreach ($update_list as $status => $files) { @@ -645,6 +670,7 @@ class install_update extends module // Skip this file if the user selected to not update it if (in_array($file_struct['filename'], $no_update)) { + $expected_files[$file_struct['filename']] = false; continue; } @@ -676,6 +702,15 @@ class install_update extends module return; } + if (file_exists($phpbb_root_path . $file_struct['filename'])) + { + $contents = file_get_contents($phpbb_root_path . $file_struct['filename']); + if (isset($expected_files[$file_struct['filename']]) && md5($contents) == $expected_files[$file_struct['filename']]) + { + continue; + } + } + $original_filename = ($file_struct['custom']) ? $file_struct['original'] : $file_struct['filename']; switch ($status) @@ -702,6 +737,7 @@ class install_update extends module break; } + $expected_files[$file_struct['filename']] = md5($contents); $file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']); $cache->put($file_list[$file_struct['filename']], base64_encode($contents)); @@ -747,6 +783,7 @@ class install_update extends module break; } + $expected_files[$file_struct['filename']] = md5($contents); $file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']); $cache->put($file_list[$file_struct['filename']], base64_encode($contents)); @@ -757,6 +794,7 @@ class install_update extends module } } } + $cache->put('_expected_files', $expected_files); } $file_list['status'] = -1; @@ -1217,7 +1255,7 @@ class install_update extends module /** * Collect all file status infos we need for the update by diffing all files */ - function get_update_structure(&$update_list) + function get_update_structure(&$update_list, $expected_files) { global $phpbb_root_path, $phpEx, $user; @@ -1303,7 +1341,7 @@ class install_update extends module else { // not modified? - $this->make_update_diff($update_list, $file, $file); + $this->make_update_diff($update_list, $file, $file, $expected_files); } $num_bytes_processed += (file_exists($this->new_location . $file)) ? filesize($this->new_location . $file) : 100 * 1024; @@ -1344,17 +1382,34 @@ class install_update extends module /** * Compare files for storage in update_list */ - function make_update_diff(&$update_list, $original_file, $file, $custom = false) + function make_update_diff(&$update_list, $original_file, $file, $expected_files, $custom = false) { global $phpbb_root_path, $user; - $update_ary = array('filename' => $file, 'custom' => $custom); + $update_ary = array('filename' => $file, 'custom' => $custom, 'as_expected' => false); if ($custom) { $update_ary['original'] = $original_file; } + if (file_exists($phpbb_root_path . $file)) + { + $content = file_get_contents($phpbb_root_path . $file); + + if (isset($expected_files[$file]) && // the user already selected what to do with this file + ($expected_files[$file] === false || // the user wanted this file to stay the same, so just assume it's alright + $expected_files[$file] === md5($content))) + { + // the file contains what it was supposed to contain after the merge + $update_ary['as_expected'] = true; + $update_ary['was_ignored'] = ($expected_files[$file] === false); + $update_list['up_to_date'][] = $update_ary; + + return; + } + } + // we only want to know if the files are successfully merged and newlines could result in errors (duplicate addition of lines and such things) // Therefore we check for empty diffs with two methods, preserving newlines and not preserving them (which mostly works best, therefore the first option) @@ -1364,7 +1419,7 @@ class install_update extends module { $tmp = array( 'file1' => file_get_contents($this->new_location . $original_file), - 'file2' => file_get_contents($phpbb_root_path . $file), + 'file2' => $content, ); // We need to diff the contents here to make sure the file is really the one we expect @@ -1403,7 +1458,7 @@ class install_update extends module { $tmp = array( 'file1' => file_get_contents($this->old_location . $original_file), - 'file2' => file_get_contents($phpbb_root_path . $file), + 'file2' => $content, ); // We need to diff the contents here to make sure the file is really the one we expect @@ -1414,7 +1469,7 @@ class install_update extends module $tmp = array( 'file1' => file_get_contents($this->new_location . $original_file), - 'file2' => file_get_contents($phpbb_root_path . $file), + 'file2' => $content, ); $diff = new diff($tmp['file1'], $tmp['file2'], $preserve_cr); -- cgit v1.2.1 From 58dc5a191c0203ea6d98c37df26b0830b3bf8203 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 Apr 2010 20:42:49 +0200 Subject: [ticket/7717] Localise default extension groups for attachments PHPBB3-7717 --- phpBB/install/database_update.php | 41 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7af0c86314..47d261dc46 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -913,6 +913,8 @@ function database_update_info() '3.0.7-RC2' => array(), // No changes from 3.0.7 to 3.0.7-PL1 '3.0.7' => array(), + // No changes from 3.0.7-PL1 to 3.0.8-RC1 + '3.0.7-PL1' => array(), ); } @@ -923,7 +925,7 @@ function database_update_info() *****************************************************************************/ function change_database_data(&$no_updates, $version) { - global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx; + global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $user; switch ($version) { @@ -1648,6 +1650,43 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.7 to 3.0.7-PL1 case '3.0.7': break; + + // Changes from 3.0.7-PL1 to 3.0.8-RC1 + case '3.0.7-PL1': + $user->add_lang('acp/attachments'); + $extension_groups = array( + $user->lang['EXT_GROUP_ARCHIVES'] => 'ARCHIVES', + $user->lang['EXT_GROUP_DOCUMENTS'] => 'DOCUMENTS', + $user->lang['EXT_GROUP_DOWNLOADABLE_FILES'] => 'DOWNLOADABLE_FILES', + $user->lang['EXT_GROUP_FLASH_FILES'] => 'FLASH_FILES', + $user->lang['EXT_GROUP_IMAGES'] => 'IMAGES', + $user->lang['EXT_GROUP_PLAIN_TEXT'] => 'PLAIN_TEXT', + $user->lang['EXT_GROUP_QUICKTIME_MEDIA'] => 'QUICKTIME_MEDIA', + $user->lang['EXT_GROUP_REAL_MEDIA'] => 'REAL_MEDIA', + $user->lang['EXT_GROUP_WINDOWS_MEDIA'] => 'WINDOWS_MEDIA', + ); + + $sql = 'SELECT group_id, group_name + FROM ' . EXTENSION_GROUPS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (isset($extension_groups[$row['group_name']])) + { + $sql_ary = array( + 'group_name' => $extension_groups[$row['group_name']], + ); + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE group_id = ' . (int) $row['group_id']; + _sql($sql, $errored, $error_ary); + } + } + $db->sql_freeresult($result); + + + $no_updates = false; + break; } } -- cgit v1.2.1 From d8b5594c14f6d2cc297484153d093606c45c6d03 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Apr 2010 20:53:57 +0200 Subject: [ticket/9119] Respect language selection on automated update. PHPBB3-9119 --- phpBB/install/install_update.php | 52 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index a5e54a354a..e717fe3dd4 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -72,7 +72,7 @@ class install_update extends module function main($mode, $sub) { - global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth; + global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; $this->tpl_name = 'install_update'; $this->page_title = 'UPDATE_INSTALLATION'; @@ -119,7 +119,17 @@ class install_update extends module $user->session_begin(); $auth->acl($user->data); - $user->setup('install'); + // Overwrite user's language with the selected one. + // Config needs to be changed to ensure that guests also get the selected language. + $config_default_lang = $config['default_lang']; + $config['default_lang'] = $language; + $user->data['user_lang'] = $language; + + $user->setup(array('common', 'acp/common', 'acp/board', 'install', 'posting')); + + // Reset the default_lang + $config['default_lang'] = $config_default_lang; + unset($config_default_lang); // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') @@ -133,6 +143,14 @@ class install_update extends module // still, the acp template is never stored in the database $user->theme['template_storedb'] = false; + $template->assign_vars(array( + 'S_USER_LANG' => $user->lang['USER_LANG'], + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_ENCODING' => 'UTF-8', + 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', + 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', + )); + // Get current and latest version if (($latest_version = $cache->get('_version_info')) === false) { @@ -234,7 +252,7 @@ class install_update extends module $template->assign_vars(array( 'S_INTRO' => true, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=version_check"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=version_check"), )); // Make sure the update list is destroyed. @@ -250,8 +268,8 @@ class install_update extends module 'S_UP_TO_DATE' => $up_to_date, 'S_VERSION_CHECK' => true, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), - 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"), + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"), 'LATEST_VERSION' => $this->latest_version, 'CURRENT_VERSION' => $this->current_version) @@ -305,8 +323,8 @@ class install_update extends module 'S_DB_UPDATE' => true, 'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->update_info['version']['to']) ? true : false, 'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&language=' . $user->data['user_lang']), - 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"), )); break; @@ -363,7 +381,7 @@ class install_update extends module // Refresh the page if we are still not finished... if ($update_list['status'] != -1) { - $refresh_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"); + $refresh_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"); meta_refresh(2, $refresh_url); $template->assign_vars(array( @@ -427,7 +445,7 @@ class install_update extends module $file_part = $filename; } - $diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])); + $diff_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])); if (isset($file_struct['as_expected']) && $file_struct['as_expected']) { @@ -475,9 +493,9 @@ class install_update extends module 'S_FILE_CHECK' => true, 'S_ALL_UP_TO_DATE' => $all_up_to_date, 'S_VERSION_UP_TO_DATE' => $up_to_date, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), - 'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), - 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"), + 'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"), + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"), )); if ($all_up_to_date) @@ -690,7 +708,7 @@ class install_update extends module $params[] = 'download=1'; } - $redirect_url = append_sid($this->p_master->module_url, "mode=$mode&sub=update_files&" . implode('&', $params)); + $redirect_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files&" . implode('&', $params)); meta_refresh(3, $redirect_url); $template->assign_vars(array( @@ -831,7 +849,7 @@ class install_update extends module $template->assign_vars(array( 'S_DOWNLOAD_FILES' => true, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"), 'RADIO_BUTTONS' => $radio_buttons, 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); @@ -945,8 +963,8 @@ class install_update extends module 'S_FTP_UPLOAD' => true, 'UPLOAD_METHOD' => $method, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), - 'U_DOWNLOAD_METHOD' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files&download=1"), + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"), + 'U_DOWNLOAD_METHOD' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files&download=1"), 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); @@ -1079,7 +1097,7 @@ class install_update extends module $template->assign_vars(array( 'S_UPLOAD_SUCCESS' => true, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check")) + 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check")) ); return; } -- cgit v1.2.1 From 36c19869865a8f46d9fa980b90db6d5283238bac Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 14 May 2010 02:59:00 +0200 Subject: [ticket/9545] Initial forum should display active topics by default. The initial forum 'Your first forum' should show topics (especially the 'Welcome to phpBB3' topic) in the active topics list after installing phpBB because this is the default setting for new forums (but not categories). The default database column value for forum_flags is 32 = FORUM_FLAG_POST_REVIEW, we therefore have to explicitly set forum_flags to FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS = 48 for this forum. PHPBB3-9545 --- phpBB/install/schemas/schema_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 38088b291d..e815615eef 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -509,7 +509,7 @@ INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_s # -- Forums INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, ''); -INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, ''); +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48); # -- Users / Anonymous user INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0); -- cgit v1.2.1 From 160d1bfd07ce016e34b52588bcbf4c7c71bd7fb0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 May 2010 13:03:56 +0200 Subject: [ticket/9578] ACP Posting tab is missing "Post settings" module. PHPBB3-9578 --- phpBB/install/database_update.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 47d261dc46..917a5401e5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1684,6 +1684,19 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + // Install modules + $modules_to_install = array( + 'post' => array( + 'base' => 'board', + 'class' => 'acp', + 'title' => 'ACP_POST_SETTINGS', + 'auth' => 'acl_a_board', + 'cat' => 'ACP_MESSAGES', + 'after' => array('message', 'ACP_MESSAGE_SETTINGS') + ), + ); + + _add_modules($modules_to_install); $no_updates = false; break; -- cgit v1.2.1 From 4637709f0a3701bdc3b44efeb08c919f73a3cb1e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 May 2010 13:13:53 +0200 Subject: [ticket/9628] _add_module 'after'-parameter does not work correctly. The modules were grouped by left_id so num_modules is always one (hopefully), but the number of rows is the actual value we'd like to know. Removing the GROUP BY resolves the issue. PHPBB3-9628 --- phpBB/install/database_update.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 47d261dc46..145b6b50ae 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -685,7 +685,6 @@ function _add_modules($modules_to_install) WHERE module_class = '" . $db->sql_escape($module_data['class']) . "' AND parent_id = {$parent_id} AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']} - GROUP BY left_id ORDER BY left_id"; $result = $db->sql_query($sql); $steps = (int) $db->sql_fetchfield('num_modules'); -- cgit v1.2.1 From 38fc35a497e375797afdce6bc3cba952b9ed5344 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Apr 2010 18:50:23 +0200 Subject: [ticket/9167] Detect and remove any dead left over shadow topics on update. PHPBB3-9167 --- phpBB/install/database_update.php | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 47d261dc46..7b27363125 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1684,6 +1684,51 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + // Delete shadow topics pointing to not existing topics + $batch_size = 500; + + // Set of affected forums we have to resync + $sync_forum_ids = array(); + + do + { + $sql_array = array( + 'SELECT' => 't1.topic_id, t1.forum_id', + 'FROM' => array( + TOPICS_TABLE => 't1', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TABLE => 't2'), + 'ON' => 't1.topic_moved_id = t2.topic_id', + ), + ), + 'WHERE' => 't1.topic_moved_id <> 0 + AND t2.topic_id IS NULL', + ); + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query_limit($sql, $batch_size); + + $topic_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $topic_ids[] = (int) $row['topic_id']; + + $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id']; + } + $db->sql_freeresult($result); + + if (!empty($topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids); + $db->sql_query($sql); + } + } + while (sizeof($topic_ids) == $batch_size); + + // Sync the forums we have deleted shadow topics from. + sync('forum', 'forum_id', $sync_forum_ids, true, true); $no_updates = false; break; -- cgit v1.2.1 From d00f2ec1832f6c391a1526a1263d45ed98d17e23 Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Sat, 3 Jul 2010 22:12:25 -0500 Subject: [ticket/9690] Add forthcoming Bing Bot to list of recognized bots Microsoft will rename MSN Bot to Bing Bot later this year, and change its user agent. This updates phpBB to be aware of Bing Bot PHPBB3-9690 --- phpBB/install/database_update.php | 52 +++++++++++++++++++++++++++++++++++++++ phpBB/install/install_install.php | 1 + 2 files changed, 53 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 47d261dc46..708abcb64d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1685,6 +1685,58 @@ function change_database_data(&$no_updates, $version) $db->sql_freeresult($result); + // add Bing Bot + $sql = 'SELECT group_id, group_colour + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$group_row) + { + // default fallback, should never get here + $group_row['group_id'] = 6; + $group_row['group_colour'] = '9E8DA7'; + } + + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + $bot_name = 'Bing [Bot]'; + $bot_agent = 'bingbot/'; + $bot_ip = ''; + + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_row['group_id'], + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => $config['default_lang'], + 'user_style' => $config['default_style'], + 'user_timezone' => 0, + 'user_dateformat' => $config['default_dateformat'], + 'user_allow_massemail' => 0, + ); + + $user_id = user_add($user_row); + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_agent, + 'bot_ip' => (string) $bot_ip, + )); + + _sql($sql, $errored, $error_ary); + // end Bing Bot addition + $no_updates = false; break; } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f4989b5bd7..4c22db07b2 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -2108,6 +2108,7 @@ class install_install extends module 'Alta Vista [Bot]' => array('Scooter/', ''), 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''), 'Baidu [Spider]' => array('Baiduspider+(', ''), + 'Bing [Bot]' => array('bingbot/', ''), 'Exabot [Bot]' => array('Exabot/', ''), 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''), 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), -- cgit v1.2.1 From 9c61455d264d92194f66549d244ec68cdb3c9ead Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Sun, 6 Jun 2010 08:42:27 -0500 Subject: [ticket/9637] Do not cache SQL server version in all cases Because the existing cache is global, there is no way to differentiate between each of two databases which may be two different DBAL objects pointing to servers with wildly different versions of an RDBMS. phpBB only has this situation in the UCF, thus only one file changed outside the DBAL. I have added a second optional parameter, $use_cache to each of the implementations of dbal::sql_server_info() PHPBB3-9637 --- phpBB/install/install_convert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 06c3a8b4a6..8c3ffd61a8 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -685,7 +685,7 @@ class install_convert extends module // Thanks MySQL, for silently converting... case 'mysql': case 'mysql4': - if (version_compare($src_db->sql_server_info(true), '4.1.3', '>=')) + if (version_compare($src_db->sql_server_info(true, false), '4.1.3', '>=')) { $convert->mysql_convert = true; } -- cgit v1.2.1 From 2ba6360e439386a8e56d93a88ecaefb3c0f5904c Mon Sep 17 00:00:00 2001 From: Gabriel Vazquez Date: Tue, 6 Jul 2010 12:03:02 +0200 Subject: [ticket/9140] Check current board version in incremental update packages Since we do not want to limit the updater functionality we only display a prominent warning when the current board version does not match the version the update files are meant to update from. PHPBB3-9140 --- phpBB/install/install_update.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index e717fe3dd4..6184cbbc33 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -192,6 +192,17 @@ class install_update extends module return; } + // Check if the update files are actually meant to update from the current version + if ($config['version'] != $this->update_info['version']['from']) + { + $this->unequal_version = true; + + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to']), + )); + } + // Check if the update files stored are for the latest version... if ($this->latest_version != $this->update_info['version']['to']) { -- cgit v1.2.1 From e5d5d581727ce61e653fdfc9a30effb69799aac5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 23 Jul 2010 12:48:01 +0200 Subject: [ticket/9091] Extract IPv4 address from addresses mapped into IPv6. PHPBB3-9091 --- phpBB/install/database_update.php | 1 + phpBB/install/install_install.php | 1 + 2 files changed, 2 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 83bbbf4577..4524dd20bf 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -119,6 +119,7 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false); unset($dbpasswd); $user->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; +$user->ip = (stripos($user->ip, '::ffff:') === 0) ? substr($user->ip, 7) : $user->ip; $sql = "SELECT config_value FROM " . CONFIG_TABLE . " diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 4c22db07b2..2800c26609 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1236,6 +1236,7 @@ class install_install extends module $current_time = time(); $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; + $user_ip = (stripos($user_ip, '::ffff:') === 0) ? substr($user_ip, 7) : $user_ip; if ($data['script_path'] !== '/') { -- cgit v1.2.1 From 66fc086742d052cada3e582f6a08ca48bd0b0714 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Sat, 24 Jul 2010 11:47:36 +0200 Subject: [ticket/9748] Replace
before converting < and > to their entities. PHPBB3-9748 --- phpBB/install/convertors/functions_phpbb20.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index b80c7673e3..78224dd5da 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1239,9 +1239,9 @@ function phpbb_prepare_message($message) // Already the new user id ;) $user_id = $convert->row['poster_id']; + $message = str_replace('
', "\n", $message); $message = str_replace('<', '<', $message); $message = str_replace('>', '>', $message); - $message = str_replace('
', "\n", $message); // make the post UTF-8 $message = phpbb_set_encoding($message); -- cgit v1.2.1 From 4c95ed0eeb497d3febe3169614e9385cefa648d2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 10 Aug 2010 16:11:39 +0200 Subject: [ticket/9519] Replace remaining is_writable() calls with phpbb_is_writable(). acm_memory.php is untested. install/install_convert.php and includes/functions_convert.php are going to be tested and committed afterwards. PHPBB3-9519 --- phpBB/install/install_install.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 4c22db07b2..6c23460de9 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -486,7 +486,7 @@ class install_install extends module $write = $exists = true; if (file_exists($phpbb_root_path . $dir)) { - if (!@is_writable($phpbb_root_path . $dir)) + if (!phpbb_is_writable($phpbb_root_path . $dir)) { $write = false; } @@ -906,7 +906,7 @@ class install_install extends module $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)) + if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path)) { // Assume it will work ... if nothing goes wrong below $written = true; -- cgit v1.2.1 From 884cc2ac9b49ba88e448764b5e91cb99cf79df81 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 13 Aug 2010 16:40:56 +0200 Subject: [ticket/9519] Replace remaining is_writable() calls with phpbb_is_writable(). includes/functions_convert.php and install/install_convert.php tested by Dicky. PHPBB3-9519 --- phpBB/install/install_convert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 8c3ffd61a8..814b50cf68 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -835,7 +835,7 @@ class install_convert extends module $this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__); } - if (!$local_path || !@is_writable($phpbb_root_path . $local_path)) + if (!$local_path || !phpbb_is_writable($phpbb_root_path . $local_path)) { if (!$local_path) { -- cgit v1.2.1 From b83163634f98de0e76e5332c1e4511dbc1483e56 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 21 Aug 2010 01:26:23 +0800 Subject: [ticket/9613] Fix missing database part for unread posts search load switch. A record for load_unreads_search parameter had to be added to CONFIG_TABLE. PHPBB3-9613 --- phpBB/install/database_update.php | 3 +++ phpBB/install/schemas/schema_data.sql | 1 + 2 files changed, 4 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fec09f89db..a5457c722f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1795,6 +1795,9 @@ function change_database_data(&$no_updates, $version) // Sync the forums we have deleted shadow topics from. sync('forum', 'forum_id', $sync_forum_ids, true, true); + // Unread posts search load switch + set_config('load_unreads_search', '1'); + $no_updates = false; break; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index e815615eef..a25b68ba39 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -168,6 +168,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_unreads_search', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); -- cgit v1.2.1 From bb191a1d696994c1d27bbd0457457cf538dff7ee Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 2 Sep 2010 19:38:34 +0200 Subject: [ticket/8944] Add index length to CREATE INDEX for MySQL4 in database_update Fixes following SQL error when updating the database to 3.0.6. BLOB column 'post_username' used in key specification without a key length PHPBB3-8944 --- phpBB/install/database_update.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fec09f89db..019469b061 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -880,7 +880,7 @@ function database_update_info() 'pm_id' => array('pm_id'), ), POSTS_TABLE => array( - 'post_username' => array('post_username'), + 'post_username' => array('post_username:255'), ), ), ), @@ -2141,7 +2141,7 @@ class updater_db_tools * drop_columns: Removing/Dropping columns * add_primary_keys: adding primary keys * add_unique_index: adding an unique index - * add_index: adding an index + * add_index: adding an index (can be column:index_size if you need to provide size) * * The values are in this format: * {TABLE NAME} => array( @@ -3520,6 +3520,12 @@ class updater_db_tools { $statements = array(); + // remove index length unless MySQL4 + if ('mysql_40' != $this->sql_layer) + { + $column = preg_replace('#:.*$#', '', $column); + } + switch ($this->sql_layer) { case 'firebird': @@ -3530,6 +3536,16 @@ class updater_db_tools break; case 'mysql_40': + // add index size to definition as required by MySQL4 + foreach ($column as $i => $col) + { + if (false !== strpos($col, ':')) + { + list($col, $index_size) = explode(':', $col); + $column[$i] = "$col($index_size)"; + } + } + // no break case 'mysql_41': $statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')'; break; -- cgit v1.2.1 From b9afa26280bcb2aa6d11f8b15faec4aad23dced8 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 21 Oct 2010 10:22:03 +0200 Subject: [ticket/9807] Update existing module permissions in database PHPBB3-9807 --- phpBB/install/database_update.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 019469b061..ce0e9a6480 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1697,6 +1697,14 @@ function change_database_data(&$no_updates, $version) _add_modules($modules_to_install); + // update + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'avatar\''; + _sql($sql, $errored, $error_ary); + // add Bing Bot $sql = 'SELECT group_id, group_colour FROM ' . GROUPS_TABLE . " -- cgit v1.2.1 From f7e37dae867ef28295f00bbe2d27ebf065a8a3fd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 8 Nov 2010 01:16:37 +0100 Subject: [ticket/9885] Fix extension group name updater. Loop through all languages. Fix a regression introduced by 58dc5a191c0203ea6d98c37df26b0830b3bf8203. The problem is that $user->add_lang() includes language strings from the board root folder instead of the update folder. Because the database updater is run first, the root folder files have not been upgrade yet. Thus, the language strings we're looking for cannot be found. Since the language strings we are looking for have been moved from the install.php language file to acp/attachments.php it should be possible to always find them in either file. When there is an acp/attachments.php file in the update package, it can also be used. We now also loop through all the installed languages as well, because the board could have been installed in a language other than the admin's current language. PHPBB3-9885 PHPBB3-7717 --- phpBB/install/database_update.php | 70 +++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e65237266b..7443185935 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -925,7 +925,7 @@ function database_update_info() *****************************************************************************/ function change_database_data(&$no_updates, $version) { - global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $user; + global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx; switch ($version) { @@ -1653,33 +1653,55 @@ function change_database_data(&$no_updates, $version) // Changes from 3.0.7-PL1 to 3.0.8-RC1 case '3.0.7-PL1': - $user->add_lang('acp/attachments'); - $extension_groups = array( - $user->lang['EXT_GROUP_ARCHIVES'] => 'ARCHIVES', - $user->lang['EXT_GROUP_DOCUMENTS'] => 'DOCUMENTS', - $user->lang['EXT_GROUP_DOWNLOADABLE_FILES'] => 'DOWNLOADABLE_FILES', - $user->lang['EXT_GROUP_FLASH_FILES'] => 'FLASH_FILES', - $user->lang['EXT_GROUP_IMAGES'] => 'IMAGES', - $user->lang['EXT_GROUP_PLAIN_TEXT'] => 'PLAIN_TEXT', - $user->lang['EXT_GROUP_QUICKTIME_MEDIA'] => 'QUICKTIME_MEDIA', - $user->lang['EXT_GROUP_REAL_MEDIA'] => 'REAL_MEDIA', - $user->lang['EXT_GROUP_WINDOWS_MEDIA'] => 'WINDOWS_MEDIA', - ); - - $sql = 'SELECT group_id, group_name - FROM ' . EXTENSION_GROUPS_TABLE; + // Update file extension group names to use language strings. + $sql = 'SELECT lang_dir + FROM ' . LANG_TABLE; $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) + $extension_groups_updated = array(); + while ($lang_dir = $db->sql_fetchfield('lang_dir')) { - if (isset($extension_groups[$row['group_name']])) + $lang_dir = basename($lang_dir); + + // The language strings we need are either in language/.../acp/attachments.php + // in the update package if we're updating to 3.0.8-RC1 or later, + // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier. + // On an already updated board, they can also already be in language/.../acp/attachments.php + // in the board root. + $lang_files = array( + "{$phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.$phpEx", + "{$phpbb_root_path}language/$lang_dir/install.$phpEx", + "{$phpbb_root_path}language/$lang_dir/acp/attachments.$phpEx", + ); + + foreach ($lang_files as $lang_file) { - $sql_ary = array( - 'group_name' => $extension_groups[$row['group_name']], - ); - $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE group_id = ' . (int) $row['group_id']; - _sql($sql, $errored, $error_ary); + if (!file_exists($lang_file)) + { + continue; + } + + $lang = array(); + include($lang_file); + + foreach($lang as $lang_key => $lang_val) + { + if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) + { + continue; + } + + $sql_ary = array( + 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_name = '" . $db->sql_escape($lang_val) . "'"; + _sql($sql, $errored, $error_ary); + + $extension_groups_updated[$lang_key] = true; + } } } $db->sql_freeresult($result); -- cgit v1.2.1 From 794c0f6b68e678b1384fd5d7627d9a81dfb04568 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 7 Nov 2010 22:48:52 +0100 Subject: [develop-olympus] Bumping version number for 3.0.8-RC1. --- phpBB/install/convertors/convert_phpbb20.php | 2 +- phpBB/install/database_update.php | 4 ++-- phpBB/install/schemas/schema_data.sql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index dfade990d2..efe2bc2962 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -32,7 +32,7 @@ unset($dbpasswd); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.0.7-PL1', + 'phpbb_version' => '3.0.8', 'author' => 'phpBB Group', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e65237266b..86b83bb542 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-dev'; +$updates_to_version = '3.0.8-RC1'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -3754,4 +3754,4 @@ class updater_db_tools } } -?> \ No newline at end of file +?> diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index a25b68ba39..f1f482b66d 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -242,7 +242,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.8-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8-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'); -- cgit v1.2.1 From b88f35caef616a3bded1193c67f7b84086644ff5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 8 Nov 2010 23:22:06 +0100 Subject: [ticket/9888] Update fails when Bing [Bot] was already added to the users table Added a check whether the user already exists before we try to add it. PHPBB3-9888 --- phpBB/install/database_update.php | 91 ++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 40 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e65237266b..b3ae38a7b6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1707,55 +1707,66 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); // add Bing Bot - $sql = 'SELECT group_id, group_colour - FROM ' . GROUPS_TABLE . " - WHERE group_name = 'BOTS'"; + $bot_name = 'Bing [Bot]'; + $bot_name_clean = utf8_clean_string($bot_name); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'"; $result = $db->sql_query($sql); - $group_row = $db->sql_fetchrow($result); + $bing_already_added = (bool) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); - if (!$group_row) + if (!$bing_already_added) { - // default fallback, should never get here - $group_row['group_id'] = 6; - $group_row['group_colour'] = '9E8DA7'; - } + $bot_agent = 'bingbot/'; + $bot_ip = ''; + $sql = 'SELECT group_id, group_colour + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!function_exists('user_add')) - { - include($phpbb_root_path . 'includes/functions_user.' . $phpEx); - } + if (!$group_row) + { + // default fallback, should never get here + $group_row['group_id'] = 6; + $group_row['group_colour'] = '9E8DA7'; + } - $bot_name = 'Bing [Bot]'; - $bot_agent = 'bingbot/'; - $bot_ip = ''; - - $user_row = array( - 'user_type' => USER_IGNORE, - 'group_id' => $group_row['group_id'], - 'username' => $bot_name, - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => $group_row['group_colour'], - 'user_email' => '', - 'user_lang' => $config['default_lang'], - 'user_style' => $config['default_style'], - 'user_timezone' => 0, - 'user_dateformat' => $config['default_dateformat'], - 'user_allow_massemail' => 0, - ); + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } - $user_id = user_add($user_row); + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_row['group_id'], + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => $config['default_lang'], + 'user_style' => $config['default_style'], + 'user_timezone' => 0, + 'user_dateformat' => $config['default_dateformat'], + 'user_allow_massemail' => 0, + ); - $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'bot_active' => 1, - 'bot_name' => (string) $bot_name, - 'user_id' => (int) $user_id, - 'bot_agent' => (string) $bot_agent, - 'bot_ip' => (string) $bot_ip, - )); + $user_id = user_add($user_row); - _sql($sql, $errored, $error_ary); + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_agent, + 'bot_ip' => (string) $bot_ip, + )); + + _sql($sql, $errored, $error_ary); + } // end Bing Bot addition // Delete shadow topics pointing to not existing topics -- cgit v1.2.1 From d722eeb64b0a8906ae62e814156de3582c16b820 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 8 Nov 2010 23:03:20 +0100 Subject: [ticket/9886] Update fails on PostgreSQL because of an error in _add_module PHPBB3-9886 --- phpBB/install/database_update.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e65237266b..fd7591268d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -685,8 +685,7 @@ function _add_modules($modules_to_install) FROM ' . MODULES_TABLE . " WHERE module_class = '" . $db->sql_escape($module_data['class']) . "' AND parent_id = {$parent_id} - AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']} - ORDER BY left_id"; + AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}"; $result = $db->sql_query($sql); $steps = (int) $db->sql_fetchfield('num_modules'); $db->sql_freeresult($result); -- cgit v1.2.1 From c9c19874d6de1af67d4240ff85618dd16ee57b29 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 9 Nov 2010 21:03:29 +0100 Subject: [ticket/9884] Reduce queue interval to 60 seconds, email package size to 20 PHPBB3-9884 --- phpBB/install/database_update.php | 11 +++++++++++ phpBB/install/schemas/schema_data.sql | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 46b74c884c..8d67d2353d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1840,6 +1840,17 @@ function change_database_data(&$no_updates, $version) // Unread posts search load switch set_config('load_unreads_search', '1'); + // Reduce queue interval to 60 seconds, email package size to 20 + if ($config['queue_interval'] == 600) + { + set_config('queue_interval', '60'); + } + + if ($config['email_package_size'] == 50) + { + set_config('email_package_size', '20'); + } + $no_updates = false; break; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index f1f482b66d..cbee2c9ba1 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -94,7 +94,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0') INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1'); @@ -209,7 +209,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50' INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10'); 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 ('queue_interval', '60'); 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'); -- cgit v1.2.1 From 9d55794e33c32a94f3630a2708c288c7b8ea6eef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 Nov 2010 17:56:05 +0100 Subject: [ticket/9891] Updater drops language-selection after database-update PHPBB3-9891 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 95f7cdae87..01e8ef7658 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -477,7 +477,7 @@ else

-

" class="button1">

+

" class="button1">

Date: Wed, 10 Nov 2010 18:26:02 +0100 Subject: [ticket/9140] Check current board version in incremental update packages We need to use $this->current_version in this case instead of $config['version']. Otherwise the message will be displayed after the database got updated from database_update.php. Using PHPBB_VERSION from includes/constants.php is not the right selection either, because than the message is displayed after the files got updated and are checked one last time. PHPBB3-9140 --- phpBB/install/install_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 6184cbbc33..ec76f2a407 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -193,13 +193,13 @@ class install_update extends module } // Check if the update files are actually meant to update from the current version - if ($config['version'] != $this->update_info['version']['from']) + if ($this->current_version != $this->update_info['version']['from']) { $this->unequal_version = true; $template->assign_vars(array( 'S_ERROR' => true, - 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to']), + 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $this->current_version, $this->update_info['version']['from'], $this->update_info['version']['to']), )); } -- cgit v1.2.1 From af4c2a3eb15fc4318b23dcb7794c230cf3ec2a0f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 19 Nov 2010 11:36:14 +0100 Subject: [prep-release-3.0.8] Incrementing version number to 3.0.8 and update changelog --- phpBB/install/database_update.php | 16 +++++++++++----- phpBB/install/schemas/schema_data.sql | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'phpBB/install') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 01e8ef7658..0ec9f24190 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-RC1'; +$updates_to_version = '3.0.8'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -914,6 +914,8 @@ function database_update_info() '3.0.7' => array(), // No changes from 3.0.7-PL1 to 3.0.8-RC1 '3.0.7-PL1' => array(), + // No changes from 3.0.8-RC1 to 3.0.8 + '3.0.8-RC1' => array(), ); } @@ -1672,7 +1674,7 @@ function change_database_data(&$no_updates, $version) "{$phpbb_root_path}language/$lang_dir/install.$phpEx", "{$phpbb_root_path}language/$lang_dir/acp/attachments.$phpEx", ); - + foreach ($lang_files as $lang_file) { if (!file_exists($lang_file)) @@ -1852,6 +1854,10 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + + // No changes from 3.0.8-RC1 to 3.0.8 + case '3.0.8-RC1': + break; } } @@ -1998,7 +2004,7 @@ class updater_db_tools 'VCHAR_CI' => '[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'mssqlnative' => array( 'INT:' => '[int]', 'BINT' => '[float]', @@ -2028,7 +2034,7 @@ class updater_db_tools 'VCHAR_CI' => '[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -2175,7 +2181,7 @@ class updater_db_tools case 'mssql_odbc': $this->sql_layer = 'mssql'; break; - + case 'mssqlnative': $this->sql_layer = 'mssqlnative'; break; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index cbee2c9ba1..e3c9d1e13a 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -242,7 +242,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.8-RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8'); 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'); -- cgit v1.2.1