From b776d02682492077a4fafd8835d7c4a17e50762d Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 2 Jun 2009 14:12:23 +0000 Subject: Okay, a first ci of the new captcha plugins. We'll add dynamic template includes later, as well as documentation on how to use this. I'm prepared to get yelled at for bugs (oh, I know that there are plenty); but please blame spammers for broken styles and MODs. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9524 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c66ac859cf..fe855496e4 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.5'; +$updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -677,6 +677,9 @@ function database_update_info() // No changes from 3.0.5-RC1 to 3.0.5 '3.0.5-RC1' => array(), + + // No changes from 3.0.5 + '3.0.5' => array(), ); } @@ -1012,6 +1015,14 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.5-RC1 to 3.0.5 case '3.0.5-RC1': break; + + + + case '3.0.5': + // TODO: smarter detection here; problem without GD. + set_config('captcha_plugin', 'phpbb_captcha_nogd'); + + break; } } -- cgit v1.2.1 From a539fca62b10f53a5f5dadf07f9ab07340fdabf9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jun 2009 11:34:01 +0000 Subject: some corrections, only very minor things. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9554 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fe855496e4..a77896c470 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -677,7 +677,7 @@ function database_update_info() // No changes from 3.0.5-RC1 to 3.0.5 '3.0.5-RC1' => array(), - + // No changes from 3.0.5 '3.0.5' => array(), ); @@ -1015,13 +1015,12 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.5-RC1 to 3.0.5 case '3.0.5-RC1': break; - - - + case '3.0.5': // TODO: smarter detection here; problem without GD. set_config('captcha_plugin', 'phpbb_captcha_nogd'); + $no_updates = false; break; } } -- cgit v1.2.1 From 9f21f1ab5e2b70da18459ef26c14a2372bc0eb76 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 8 Jun 2009 12:36:26 +0000 Subject: Fix bug #44665 - Add index on log_time to the log table to prevent slowdown on boards with many log entries. Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9564 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a77896c470..171a8f1fc6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -678,8 +678,14 @@ function database_update_info() // No changes from 3.0.5-RC1 to 3.0.5 '3.0.5-RC1' => array(), - // No changes from 3.0.5 - '3.0.5' => array(), + // Changes from 3.0.5 + '3.0.5' => array( + 'add_index' => array( + LOG_TABLE => array( + 'log_time' => array('log_time'), + ), + ), + ), ); } -- cgit v1.2.1 From 863d7a7614a09dac545d3c3201e67c3beddb3960 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 12 Jun 2009 14:41:03 +0000 Subject: First ATOM Feed commit/integration - Idea and original RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9575 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 64 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 171a8f1fc6..bb48b57a13 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1022,9 +1022,69 @@ function change_database_data(&$no_updates, $version) case '3.0.5-RC1': break; + // Changes from 3.0.5 to 3.0.6-RC1 case '3.0.5': - // TODO: smarter detection here; problem without GD. - set_config('captcha_plugin', 'phpbb_captcha_nogd'); + // Let's see if the GD Captcha can be enabled... we simply look for what *is* enabled... + if (!empty($config['captcha_gd']) && !isset($config['captcha_plugin'])) + { + set_config('captcha_plugin', 'phpbb_captcha_gd'); + } + else if (!isset($config['captcha_plugin'])) + { + set_config('captcha_plugin', 'phpbb_captcha_nogd'); + } + + // Entries for the Feed Feature + set_config('feed_enable', '0'); + set_config('feed_limit', '10'); + + set_config('feed_overall_forums', '1'); + set_config('feed_overall_forums_limit', '15'); + + set_config('feed_overall_topics', '0'); + set_config('feed_overall_topics_limit', '15'); + + set_config('feed_forum', '1'); + set_config('feed_topic', '1'); + set_config('feed_news_id', ''); + + set_config('feed_item_statistics', '1'); + set_config('feed_exclude_id', ''); + + include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); + + $_module = new acp_modules(); + + // Set the module class + $_module->module_class = 'acp'; + + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_BOARD_CONFIGURATION' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); + + if ($category_id) + { + $module_data = array( + 'module_basename' => 'board', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_FEED_SETTINGS', + 'module_mode' => 'feed', + 'module_auth' => 'acl_a_board', + ); + + $_module->update_module_data($module_data, true); + } + + $_module->remove_cache_file(); $no_updates = false; break; -- cgit v1.2.1 From d843dbd046fa427d00d30ef06558043e46c6fc98 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 13 Jun 2009 14:48:45 +0000 Subject: Fix sql_column_exists for oracle (oracle uses uppercase table names) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9583 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index bb48b57a13..992db93452 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -912,7 +912,6 @@ function change_database_data(&$no_updates, $version) set_config('captcha_gd_wave', 0); set_config('captcha_gd_3d_noise', 1); set_config('captcha_gd_fonts', 1); - set_config('confirm_refresh', 1); // Maximum number of keywords @@ -949,6 +948,7 @@ function change_database_data(&$no_updates, $version) WHERE bot_agent = 'ichiro/2'"; _sql($sql, $errored, $error_ary); + // Before we are able to add a unique key to auth_option, we need to remove duplicate entries // We get duplicate entries first @@ -1637,7 +1637,7 @@ class updater_db_tools case 'oracle': $sql = "SELECT column_name FROM user_tab_columns - WHERE table_name = '{$table}'"; + WHERE LOWER(table_name) = '" . strtolower($table) . "'"; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { -- cgit v1.2.1 From 8d4ddc3b236a194b7f31e631e77366cd4f4adfd0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 13 Jun 2009 14:55:30 +0000 Subject: erm, we need to check if the feed module is already there git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9584 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 992db93452..948087dd3b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1070,18 +1070,34 @@ function change_database_data(&$no_updates, $version) if ($category_id) { - $module_data = array( - 'module_basename' => 'board', - 'module_enabled' => 1, - 'module_display' => 1, - 'parent_id' => $category_id, - 'module_class' => 'acp', - 'module_langname' => 'ACP_FEED_SETTINGS', - 'module_mode' => 'feed', - 'module_auth' => 'acl_a_board', - ); + // Check if we actually need to add the feed module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'board' + AND module_class = 'acp' + AND module_langname = 'ACP_FEED_SETTINGS' + AND module_mode = 'feed' + AND module_auth = 'acl_a_board' + AND parent_id = {$category_id}"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $module_data = array( + 'module_basename' => 'board', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_FEED_SETTINGS', + 'module_mode' => 'feed', + 'module_auth' => 'acl_a_board', + ); - $_module->update_module_data($module_data, true); + $_module->update_module_data($module_data, true); + } } $_module->remove_cache_file(); -- cgit v1.2.1 From e69fe56634225d771d4d47c2151d9828b1be2b5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 13 Jun 2009 16:04:54 +0000 Subject: - fix sql_column_exists for firebird (had same problem as oracle) - fix sql_column_change for firebird (interbase6 only supports TYPE and SET DEFAULT, but not the same syntax ass ADD COLUMN) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9586 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 948087dd3b..7f1edf2e28 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -497,7 +497,7 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true) { $errored = true; $error_ary['sql'][] = $db->sql_error_sql; - $error_ary['error_code'][] = $db->_sql_error(); + $error_ary['error_code'][] = $db->sql_error_returned; } $db->sql_return_on_error(false); @@ -1671,7 +1671,7 @@ class updater_db_tools case 'firebird': $sql = "SELECT RDB\$FIELD_NAME as FNAME FROM RDB\$RELATION_FIELDS - WHERE RDB\$RELATION_NAME = '{$table}'"; + WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'"; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { @@ -1824,10 +1824,12 @@ class updater_db_tools { case 'firebird': $sql .= " {$column_type} "; + $return_array['column_type_sql_type'] = " {$column_type} "; if (!is_null($column_data[1])) { $sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' '; + $return_array['column_type_sql_default'] = ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' '; } $sql .= 'NOT NULL'; @@ -2344,7 +2346,15 @@ class updater_db_tools { case 'firebird': // Change type... - $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql']; + if (!empty($column_data['column_type_sql_default'])) + { + $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type']; + $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" SET DEFAULT ' . ' ' . $column_data['column_type_sql_default']; + } + else + { + $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql']; + } break; case 'mssql': -- cgit v1.2.1 From d7d96223e7bae7cd60b13c6e7896d95838c3633c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 19 Jun 2009 09:51:50 +0000 Subject: - Display coloured usernames in ACP groups management screens - Changed behaviour of group_create() function to support specifying additional group columns - New groups option to excempt group leaders from group permissions git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9625 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7f1edf2e28..6f7216f82b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -13,6 +13,9 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; +// Which oldest version does this updater supports? +$oldest_from_version = '3.0.0'; + // 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')) { @@ -685,6 +688,11 @@ function database_update_info() 'log_time' => array('log_time'), ), ), + 'add_columns' => array( + GROUPS_TABLE => array( + 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), + ), + ), ), ); } @@ -1991,23 +1999,28 @@ class updater_db_tools switch ($this->sql_layer) { case 'firebird': + // Does not support AFTER statement, only POSITION (and there you need the column position) $statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql']; break; case 'mssql': + // Does not support AFTER, only through temporary table $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default']; break; case 'mysql_40': case 'mysql_41': - $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql']; + $after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : ''; + $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after; break; case 'oracle': + // Does not support AFTER, only through temporary table $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql']; break; case 'postgres': + // Does not support AFTER, only through temporary table $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql']; break; -- cgit v1.2.1 From 5d9cf2aa41c61dd35114223006c5e16c104c5a2b Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 19 Jun 2009 12:31:28 +0000 Subject: Make captchas stricter by oly having one entry per session; fix a bug in ucp_register that caused three captcha instances to be generated. Non-MySQL databases and garbage collecting needs extensive testing. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9626 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6f7216f82b..150ef20ca1 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -683,6 +683,11 @@ function database_update_info() // Changes from 3.0.5 '3.0.5' => array( + 'add_columns' => array( + CONFIRM_TABLE => array( + 'attempts' => array('UINT', 0), + ), + ), 'add_index' => array( LOG_TABLE => array( 'log_time' => array('log_time'), -- cgit v1.2.1 From d85a5ad036b2088fe742de29d9464678d2e19e23 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 19 Jun 2009 22:03:19 +0000 Subject: Fix bug #46785 - Hide avatars if type disabled and give global option to turn on/off Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9632 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 150ef20ca1..3848657809 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1115,6 +1115,15 @@ function change_database_data(&$no_updates, $version) $_module->remove_cache_file(); + if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) + { + set_config('allow_avatar', '1'); + } + else + { + set_config('allow_avatar', '0'); + } + $no_updates = false; break; } -- cgit v1.2.1 From 433de350c0fa2e1e09c23e6f5f29f118222d2df8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 20 Jun 2009 18:45:16 +0000 Subject: - [Feature] New "Newly Registered Users" group for assigning permissions to newly registered users. They will be removed from this group once they reach a defineable amount of posts. - [Feature] Ability to define if the "Newly Registered Users" group will be assigned as the default group to newly registered users. As a coincidence also Bug #46535 got fixed. Additionally the error message displayed with trigger_error() if accessing the private message tab in the ucp is now displayed inline in addition to a slightly different message for newly registered users to let them know that access permissions may be lifted over time. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9636 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 141 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 136 insertions(+), 5 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 3848657809..44bcf2a112 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -687,17 +687,18 @@ function database_update_info() CONFIRM_TABLE => array( 'attempts' => array('UINT', 0), ), + USERS_TABLE => array( + 'user_new' => array('BOOL', 1), + ), + GROUPS_TABLE => array( + 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), + ), ), 'add_index' => array( LOG_TABLE => array( 'log_time' => array('log_time'), ), ), - 'add_columns' => array( - GROUPS_TABLE => array( - 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), - ), - ), ), ); } @@ -1115,6 +1116,136 @@ function change_database_data(&$no_updates, $version) $_module->remove_cache_file(); + // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'NEWLY_REGISTERED'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$group_id) + { + $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)"; + _sql($sql, $errored, $error_ary); + + $group_id = $db->sql_nextid(); + } + + // Insert new user role... at the end of the chain + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_USER_NEW_MEMBER' + AND role_type = 'u_'"; + $result = $db->sql_query($sql); + $u_role = (int) $db->sql_fetchfield('role_id'); + $db->sql_freeresult($result); + + if (!$u_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'u_'"; + $result = $db->sql_query($sql); + $next_order_id = (int) $db->sql_fetchfield('max_order_id'); + $db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)"; + _sql($sql, $errored, $error_ary); + $u_role = $db->sql_nextid(); + + if (!$errored) + { + // Now add the correct data to the roles... + // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; + _sql($sql, $errored, $error_ary); + + // Add user role to group + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)"; + _sql($sql, $errored, $error_ary); + } + } + + // Insert new forum role + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' + AND role_type = 'f_'"; + $result = $db->sql_query($sql); + $f_role = (int) $db->sql_fetchfield('role_id'); + $db->sql_freeresult($result); + + if (!$f_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'f_'"; + $result = $db->sql_query($sql); + $next_order_id = (int) $db->sql_fetchfield('max_order_id'); + $db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)"; + _sql($sql, $errored, $error_ary); + $f_role = $db->sql_nextid(); + + if (!$errored) + { + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')"; + _sql($sql, $errored, $error_ary); + } + } + + // Set every members user_new column to 0 (old users) + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; + _sql($sql, $errored, $error_ary); + + // Newly registered users limit + if (!isset($config['new_member_post_limit'])) + { + set_config('new_member_post_limit', (!empty($config['enable_queue_trigger'])) ? $config['queue_trigger_posts'] : 0); + } + + if (!isset($config['new_member_group_default'])) + { + set_config('new_member_group_default', 0); + } + + // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts... + // Check if the role is already assigned... + $sql = 'SELECT forum_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND auth_role_id = ' . $f_role; + $result = $db->sql_query($sql); + $is_options = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + // Not assigned at all... :/ + if (!$is_options) + { + // Get postable forums + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type != ' . FORUM_LINK; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + _sql('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)', $errored, $error_ary); + } + $db->sql_freeresult($result); + } + + // Clear permissions... + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + $auth_admin = new auth_admin(); + $auth_admin->acl_clear_prefetch(); + if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) { set_config('allow_avatar', '1'); -- cgit v1.2.1 From c32f49679f635175d43de7264ee09782c56c628e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 23 Jun 2009 10:48:53 +0000 Subject: - add options for quick reply (forum-based and board-wide) - add option for minimum post chars (which is a required setting for quick reply, therefore we introduce it here) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9656 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 44bcf2a112..c3f8b40de6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1200,9 +1200,19 @@ function change_database_data(&$no_updates, $version) } } - // Set every members user_new column to 0 (old users) - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; - _sql($sql, $errored, $error_ary); + // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + $sql = 'SELECT 1 + FROM ' . USERS_TABLE . ' + WHERE user_new = 0'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; + _sql($sql, $errored, $error_ary); + } // Newly registered users limit if (!isset($config['new_member_post_limit'])) @@ -1246,13 +1256,27 @@ function change_database_data(&$no_updates, $version) $auth_admin = new auth_admin(); $auth_admin->acl_clear_prefetch(); - if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) + if (!isset($config['allow_avatar'])) + { + if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) + { + set_config('allow_avatar', '1'); + } + else + { + set_config('allow_avatar', '0'); + } + } + + // Minimum number of characters + if (!isset($config['min_post_chars'])) { - set_config('allow_avatar', '1'); + set_config('min_post_chars', '1'); } - else + + if (!isset($config['allow_quick_reply'])) { - set_config('allow_avatar', '0'); + set_config('allow_quick_reply', '1'); } $no_updates = false; -- cgit v1.2.1 From adaeec1ec9f7cd55522a5c4d0bf0538dbc0c6f99 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Sat, 27 Jun 2009 08:36:40 +0000 Subject: Fixed Bug #45115 - Signature parsing flags are not stored in DB Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9696 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c3f8b40de6..98f0596835 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -676,6 +676,10 @@ function database_update_info() 'forum_style' => array('UINT', 0), ), ), + 'change_columns' => array( + USERS_TABLE => array( + 'user_options' => array('UINT:11', 230271), + ), ), // No changes from 3.0.5-RC1 to 3.0.5 @@ -1279,6 +1283,23 @@ function change_database_data(&$no_updates, $version) set_config('allow_quick_reply', '1'); } + // Set every members user_options column to enable + // bbcode, smilies and URLs for signatures by default + $sql = 'SELECT user_options + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + $result = $db->sql_query_limit($sql, 1); + $user_option = (int) $db->sql_fetchfield('user_options'); + $db->sql_freeresult($result); + + // Check if we already updated the database by checking bit 15 which we used to store the sig_bbcode option + if (!($user_option & 1 << 15)) + { + // 229376 is the added value to enable all three signature options + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376'; + _sql($sql, $errored, $error_ary); + } + $no_updates = false; break; } -- cgit v1.2.1 From aeac2819e3dd632deb09de7a7fb2e479c791f5fa Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 30 Jun 2009 14:49:54 +0000 Subject: close the .4 array git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9710 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 98f0596835..85b9623ffe 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -680,6 +680,7 @@ function database_update_info() USERS_TABLE => array( 'user_options' => array('UINT:11', 230271), ), + ), ), // No changes from 3.0.5-RC1 to 3.0.5 -- cgit v1.2.1 From 55e15b4c8eea94f226a0169284bb51d7d9bcbcd4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 8 Jul 2009 13:52:18 +0000 Subject: Fix database updater and db tools to support multiple column changes/additions/removals with SQLite git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9735 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 238 +++++++++++++++++++++++++++++++++++--- 1 file changed, 220 insertions(+), 18 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 85b9623ffe..d7398ea953 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -11,7 +11,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = false; +$debug_from_version = '3.0.5'; // Which oldest version does this updater supports? $oldest_from_version = '3.0.0'; @@ -1292,7 +1292,7 @@ function change_database_data(&$no_updates, $version) $result = $db->sql_query_limit($sql, 1); $user_option = (int) $db->sql_fetchfield('user_options'); $db->sql_freeresult($result); - + // Check if we already updated the database by checking bit 15 which we used to store the sig_bbcode option if (!($user_option & 1 << 15)) { @@ -1631,6 +1631,14 @@ class updater_db_tools } $statements = array(); + $sqlite = false; + + // For SQLite we need to perform the schema changes in a much more different way + if ($this->db->sql_layer == 'sqlite' && $this->return_statements) + { + $sqlite_data = array(); + $sqlite = true; + } // Change columns? if (!empty($schema_changes['change_columns'])) @@ -1640,16 +1648,27 @@ class updater_db_tools foreach ($columns as $column_name => $column_data) { // If the column exists we change it, else we add it ;) - if ($this->sql_column_exists($table, $column_name)) + if ($column_exists = $this->sql_column_exists($table, $column_name)) { - $result = $this->sql_column_change($table, $column_name, $column_data); + $result = $this->sql_column_change($table, $column_name, $column_data, true); } else { - $result = $this->sql_column_add($table, $column_name, $column_data); + $result = $this->sql_column_add($table, $column_name, $column_data, true); } - if ($this->return_statements) + if ($sqlite) + { + if ($column_exists) + { + $sqlite_data[$table]['change_columns'][] = $result; + } + else + { + $sqlite_data[$table]['add_columns'][] = $result; + } + } + else if ($this->return_statements) { $statements = array_merge($statements, $result); } @@ -1665,16 +1684,27 @@ class updater_db_tools foreach ($columns as $column_name => $column_data) { // Only add the column if it does not exist yet, else change it (to be consistent) - if ($this->sql_column_exists($table, $column_name)) + if ($column_exists = $this->sql_column_exists($table, $column_name)) { - $result = $this->sql_column_change($table, $column_name, $column_data); + $result = $this->sql_column_change($table, $column_name, $column_data, true); } else { - $result = $this->sql_column_add($table, $column_name, $column_data); + $result = $this->sql_column_add($table, $column_name, $column_data, true); } - if ($this->return_statements) + if ($sqlite) + { + if ($column_exists) + { + $sqlite_data[$table]['change_columns'][] = $result; + } + else + { + $sqlite_data[$table]['add_columns'][] = $result; + } + } + else if ($this->return_statements) { $statements = array_merge($statements, $result); } @@ -1709,9 +1739,13 @@ class updater_db_tools // Only remove the column if it exists... if ($this->sql_column_exists($table, $column)) { - $result = $this->sql_column_remove($table, $column); + $result = $this->sql_column_remove($table, $column, true); - if ($this->return_statements) + if ($sqlite) + { + $sqlite_data[$table]['drop_columns'][] = $result; + } + else if ($this->return_statements) { $statements = array_merge($statements, $result); } @@ -1725,9 +1759,13 @@ class updater_db_tools { foreach ($schema_changes['add_primary_keys'] as $table => $columns) { - $result = $this->sql_create_primary_key($table, $columns); + $result = $this->sql_create_primary_key($table, $columns, true); - if ($this->return_statements) + if ($sqlite) + { + $sqlite_data[$table]['primary_key'] = $result; + } + else if ($this->return_statements) { $statements = array_merge($statements, $result); } @@ -1768,6 +1806,147 @@ class updater_db_tools } } + if ($sqlite) + { + foreach ($sqlite_data as $table_name => $sql_schema_changes) + { + // Create temporary table with original data + $statements[] = 'begin'; + + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = $this->db->sql_query($sql); + + if (!$result) + { + continue; + } + + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + // Create a backup table and populate it, destroy the existing one + $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']); + $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name; + $statements[] = 'DROP TABLE ' . $table_name; + + // Get the columns... + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $plain_table_cols = trim($matches[1]); + $new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols); + $column_list = array(); + + foreach ($new_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + // note down the primary key notation because sqlite only supports adding it to the end for the new table + $primary_key = false; + $_new_cols = array(); + + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities[0] == 'PRIMARY') + { + $primary_key = $declaration; + continue; + } + $_new_cols[] = $declaration; + } + + $new_table_cols = $_new_cols; + + // First of all... change columns + if (!empty($sql_schema_changes['change_columns'])) + { + foreach ($sql_schema_changes['change_columns'] as $column_sql) + { + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if (strpos($column_sql, $entities[0] . ' ') === 0) + { + $new_table_cols[$key] = $column_sql; + } + } + } + } + + if (!empty($sql_schema_changes['add_columns'])) + { + foreach ($sql_schema_changes['add_columns'] as $column_sql) + { + $new_table_cols[] = $column_sql; + } + } + + // Now drop them... + if (!empty($sql_schema_changes['drop_columns'])) + { + foreach ($sql_schema_changes['drop_columns'] as $column_name) + { + // Remove from column list... + $new_column_list = array(); + foreach ($column_list as $key => $value) + { + if ($value === $column_name) + { + continue; + } + + $new_column_list[] = $value; + } + + $column_list = $new_column_list; + + // Remove from table... + $_new_cols = array(); + foreach ($new_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if (strpos($column_name . ' ', $entities[0] . ' ') === 0) + { + continue; + } + $_new_cols[] = $declaration; + } + $new_table_cols = $_new_cols; + } + } + + // Primary key... + if (!empty($sql_schema_changes['primary_key'])) + { + $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')'; + } + // Add a new one or the old primary key + else if ($primary_key !== false) + { + $new_table_cols[] = $primary_key; + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');'; + $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; + $statements[] = 'DROP TABLE ' . $table_name . '_temp'; + + $statements[] = 'commit'; + } + } + if ($this->return_statements) { return $statements; @@ -2182,7 +2361,7 @@ class updater_db_tools /** * Add new column */ - function sql_column_add($table_name, $column_name, $column_data) + function sql_column_add($table_name, $column_name, $column_data, $inline = false) { $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); $statements = array(); @@ -2216,6 +2395,12 @@ class updater_db_tools break; case 'sqlite': + + if ($inline && $this->return_statements) + { + return $column_name . ' ' . $column_data['column_type_sql']; + } + if (version_compare(sqlite_libversion(), '3.0') == -1) { $sql = "SELECT sql @@ -2280,7 +2465,7 @@ class updater_db_tools /** * Drop column */ - function sql_column_remove($table_name, $column_name) + function sql_column_remove($table_name, $column_name, $inline = false) { $statements = array(); @@ -2308,6 +2493,12 @@ class updater_db_tools break; case 'sqlite': + + if ($inline && $this->return_statements) + { + return $column_name; + } + if (version_compare(sqlite_libversion(), '3.0') == -1) { $sql = "SELECT sql @@ -2401,7 +2592,7 @@ class updater_db_tools /** * Add primary key */ - function sql_create_primary_key($table_name, $column) + function sql_create_primary_key($table_name, $column, $inline = false) { $statements = array(); @@ -2428,6 +2619,12 @@ class updater_db_tools break; case 'sqlite': + + if ($inline && $this->return_statements) + { + return $column; + } + $sql = "SELECT sql FROM sqlite_master WHERE type = 'table' @@ -2541,7 +2738,7 @@ class updater_db_tools /** * Change column type (not name!) */ - function sql_column_change($table_name, $column_name, $column_data) + function sql_column_change($table_name, $column_name, $column_data, $inline = false) { $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); $statements = array(); @@ -2639,6 +2836,11 @@ class updater_db_tools case 'sqlite': + if ($inline && $this->return_statements) + { + return $column_name . ' ' . $column_data['column_type_sql']; + } + $sql = "SELECT sql FROM sqlite_master WHERE type = 'table' -- cgit v1.2.1 From 26bb3bbb6824166d05362f5516009fdf3477195f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 9 Jul 2009 13:28:25 +0000 Subject: print out error if users try to update phpBB versions no longer supported with the used database update script git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9743 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 53 +++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d7398ea953..249b0a8f69 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -11,7 +11,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = '3.0.5'; +$debug_from_version = false; // Which oldest version does this updater supports? $oldest_from_version = '3.0.0'; @@ -249,28 +249,25 @@ if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == echo '

' . $lang['ERROR'] . '


'; echo '

' . sprintf($lang['MYSQL_SCHEMA_UPDATE_REQUIRED'], $config['dbms_version'], $db->sql_server_info(true)) . '

'; -?> - - - - - - - - - - - -

' . $lang['ERROR'] . '


'; + echo '

' . sprintf($lang['DB_UPDATE_NOT_SUPPORTED'], $oldest_from_version, $current_version) . '

'; + + _print_footer(); + exit_handler(); + exit; +} + // If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything. if ($inline_update) { @@ -455,8 +452,21 @@ add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version); // Now we purge the session table as well as all cache files $cache->purge(); -?> +_print_footer(); + +garbage_collection(); + +if (function_exists('exit_handler')) +{ + exit_handler(); +} +/** +* Print out footer +*/ +function _print_footer() +{ + echo << @@ -471,14 +481,7 @@ $cache->purge(); - - Date: Tue, 14 Jul 2009 20:25:41 +0000 Subject: Feature Bug #45375 - Add option to disable remote upload avatars Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9757 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 249b0a8f69..31d7976033 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1276,6 +1276,18 @@ function change_database_data(&$no_updates, $version) } } + if (!isset($config['allow_avatar_remote_upload'])) + { + if ($config['allow_avatar_remote'] && $config['allow_avatar_upload']) + { + set_config('allow_avatar_remote_upload', '1'); + } + else + { + set_config('allow_avatar_remote_upload', '0'); + } + } + // Minimum number of characters if (!isset($config['min_post_chars'])) { -- cgit v1.2.1 From e3866c939d78b925844cd61d6ad567988f24e42d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jul 2009 20:35:53 +0000 Subject: Feature Bug #43375 - Ability to delete warnings and keep warnings permanently Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9758 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 31d7976033..e13bc1d546 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1122,6 +1122,49 @@ function change_database_data(&$no_updates, $version) } } + // Also install the "User Warning" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_USER_MANAGEMENT' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + // Check if we actually need to add the module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_USER_WARNINGS' + AND module_mode = 'warnings' + AND module_auth = 'acl_a_user' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'users', + 'module_enabled' => 1, + 'module_display' => 0, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_USER_WARNINGS', + 'module_mode' => 'warnings', + 'module_auth' => 'acl_a_user', + ); + + $_module->update_module_data($module_data, true); + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) -- cgit v1.2.1 From 7a5ba35cc73b31e78b844db80b8e5b52666ca51b Mon Sep 17 00:00:00 2001 From: "Marek A. R" Date: Fri, 17 Jul 2009 17:21:07 +0000 Subject: - Add smilies per page config setting to the database updater git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9774 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e13bc1d546..362a379ec1 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1073,6 +1073,9 @@ function change_database_data(&$no_updates, $version) set_config('feed_item_statistics', '1'); set_config('feed_exclude_id', ''); + // Entries for smiley pagination + set_config('smilies_per_page', '50'); + include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); $_module = new acp_modules(); -- cgit v1.2.1 From 6e4a7c03d14d6fcc03955fbe26c3d5f725eb929d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 21 Jul 2009 20:59:11 +0000 Subject: Users can report PMs to moderators which are then visible in a new MCP module git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9814 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 362a379ec1..3b6c614deb 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -701,11 +701,21 @@ function database_update_info() GROUPS_TABLE => array( 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), ), + PRIVMSGS_TABLE => array( + 'message_reported' => array('BOOL', 0), + ), + REPORTS_TABLE => array( + 'pm_id' => array('UINT', 0), + ), ), 'add_index' => array( LOG_TABLE => array( 'log_time' => array('log_time'), ), + REPORTS_TABLE => array( + 'post_id' => array('post_id'), + 'pm_id' => array('pm_id'), + ), ), ), ); @@ -1076,6 +1086,9 @@ function change_database_data(&$no_updates, $version) // Entries for smiley pagination set_config('smilies_per_page', '50'); + // Entry for reporting PMs + set_config('allow_pm_report', '1'); + include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); $_module = new acp_modules(); @@ -1168,6 +1181,58 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + + // Also install the "PM Reports" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'mcp' + AND module_langname = 'MCP_REPORTS' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + $modes = array( + 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), + 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), + 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), + ); + + foreach ($modes as $mode => $data) + { + // Check if we actually need to add the module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'mcp' + AND module_langname = '{$data['title']}' + AND module_mode = '$mode' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'users', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'mcp', + 'module_langname' => $data['title'], + 'module_mode' => $mode, + 'module_auth' => $data['auth'], + ); + + $_module->update_module_data($module_data, true); + } + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) -- cgit v1.2.1 From 54f78a50bc6162fd49e506892a455f7bb43e31fb Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 22 Jul 2009 13:09:22 +0000 Subject: insert pm_reports module with correct basename on update git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9829 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 3b6c614deb..c055449d5f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1217,7 +1217,7 @@ function change_database_data(&$no_updates, $version) if (!$row2) { $module_data = array( - 'module_basename' => 'users', + 'module_basename' => 'pm_reports', 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => $category_id, -- cgit v1.2.1 From 4739c7ba3957dfe585973dafe7465cb9fd8c6d1f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 24 Jul 2009 11:13:32 +0000 Subject: [Feature] Added new functionality to inactive users module: - Ability to set users per page. - Ability to sort by posts/number of reminders/last reminded date. - Show number of posts and ability to search posts. - Show number of reminders sent to user. - Show date of last reminder sent to user. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9845 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c055449d5f..6d596a8a00 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -11,7 +11,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = false; +$debug_from_version = '3.0.5'; // Which oldest version does this updater supports? $oldest_from_version = '3.0.0'; @@ -696,7 +696,9 @@ function database_update_info() 'attempts' => array('UINT', 0), ), USERS_TABLE => array( - 'user_new' => array('BOOL', 1), + 'user_new' => array('BOOL', 1), + 'user_reminded' => array('TINT:4', 0), + 'user_reminded_time'=> array('TIMESTAMP', 0), ), GROUPS_TABLE => array( 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), @@ -714,7 +716,7 @@ function database_update_info() ), REPORTS_TABLE => array( 'post_id' => array('post_id'), - 'pm_id' => array('pm_id'), + 'pm_id' => array('pm_id'), ), ), ), -- cgit v1.2.1 From fecc3383a24eafe9b84caea37720813a0f1f5cfe Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 28 Jul 2009 11:26:55 +0000 Subject: disable QR by default git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9878 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6d596a8a00..c2b5b3d3d1 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1409,7 +1409,7 @@ function change_database_data(&$no_updates, $version) if (!isset($config['allow_quick_reply'])) { - set_config('allow_quick_reply', '1'); + set_config('allow_quick_reply', '0'); } // Set every members user_options column to enable -- cgit v1.2.1 From b4f3a0eb2d20cd618a1ade5f2d38a90cb9c6d265 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 28 Jul 2009 21:33:31 +0000 Subject: Fix r9696, #45115. Move column change to the correct version. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9886 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c2b5b3d3d1..a00d928a12 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -679,11 +679,6 @@ function database_update_info() 'forum_style' => array('UINT', 0), ), ), - 'change_columns' => array( - USERS_TABLE => array( - 'user_options' => array('UINT:11', 230271), - ), - ), ), // No changes from 3.0.5-RC1 to 3.0.5 @@ -710,6 +705,11 @@ function database_update_info() 'pm_id' => array('UINT', 0), ), ), + 'change_columns' => array( + USERS_TABLE => array( + 'user_options' => array('UINT:11', 230271), + ), + ), 'add_index' => array( LOG_TABLE => array( 'log_time' => array('log_time'), -- cgit v1.2.1 From 1b8a1f73d77d3df21b8404611a130bb4ee19b822 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 28 Jul 2009 22:09:46 +0000 Subject: [Feature] Ability to copy permissions from one forum to several other forums. [Fix] Add log entry when copying forum permissions. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9887 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a00d928a12..b2460009f7 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1235,6 +1235,49 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + // Also install the "Copy forum permissions" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_FORUM_BASED_PERMISSIONS' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + // Check if we actually need to add the feed module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_FORUM_PERMISSIONS_COPY' + AND module_mode = 'setting_forum_copy' + AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'permissions', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', + 'module_mode' => 'setting_forum_copy', + 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', + ); + + $_module->update_module_data($module_data, true); + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) -- cgit v1.2.1 From e6f133dc55095b337ad311c761e82d4f026c0ea1 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 31 Jul 2009 08:16:36 +0000 Subject: Revert r9878 - QR was already disabled by default, for admin convenience we enable the global setting but no local setting, which results in OFF by default git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9895 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b2460009f7..709836ea88 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1452,7 +1452,7 @@ function change_database_data(&$no_updates, $version) if (!isset($config['allow_quick_reply'])) { - set_config('allow_quick_reply', '0'); + set_config('allow_quick_reply', '1'); } // Set every members user_options column to enable -- cgit v1.2.1 From 1f871950d8bbefe59e18c00ea3238591c0b73807 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 3 Aug 2009 15:46:56 +0000 Subject: #48985 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9916 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 709836ea88..e692750659 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -704,6 +704,9 @@ function database_update_info() REPORTS_TABLE => array( 'pm_id' => array('UINT', 0), ), + PROFILE_FIELDS_TABLE => array( + 'field_show_on_vt' => array('BOOL', 0), + ), ), 'change_columns' => array( USERS_TABLE => array( -- cgit v1.2.1 From ee65d2147b7e672c6dfdcd695f0b6314c40e42d2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 5 Aug 2009 15:28:46 +0000 Subject: fix r9713 for #36565 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9931 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e692750659..4380f0cb8c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -721,6 +721,9 @@ function database_update_info() 'post_id' => array('post_id'), 'pm_id' => array('pm_id'), ), + POSTS_TABLE => array( + 'post_username' => array('post_username'), + ), ), ), ); -- cgit v1.2.1 From 96a30afcca3ebd832c9b3083bb5c9a9f2a2dc54b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 11 Aug 2009 14:49:58 +0000 Subject: do not change column if column already exists. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9956 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4380f0cb8c..8252cd4968 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1860,10 +1860,12 @@ class updater_db_tools { foreach ($columns as $column_name => $column_data) { - // Only add the column if it does not exist yet, else change it (to be consistent) + // Only add the column if it does not exist yet if ($column_exists = $this->sql_column_exists($table, $column_name)) { - $result = $this->sql_column_change($table, $column_name, $column_data, true); + continue; + // This is commented out here because it can take tremendous time on updates +// $result = $this->sql_column_change($table, $column_name, $column_data, true); } else { -- cgit v1.2.1 From 09ad10a734c0993f9465e6ac3463951251602fc6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 12 Aug 2009 15:00:47 +0000 Subject: ok, i am very sorry, but this needs to be fixed. Generally, our config table is not really suited for holding large datasets. Because feed settings for the forums to enable news feeds and excluded forums rely on the forums itself we have decided to introduce a forum_options table where custom options can be stored. Additionally, for this to work across all DBMS we support, we added a new method to the DBAL for the bitwise AND operator. Also moved the forum/topic feed template variable to the location where they belong to (forum and topic view) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9965 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 8252cd4968..e77a170240 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -707,6 +707,9 @@ function database_update_info() PROFILE_FIELDS_TABLE => array( 'field_show_on_vt' => array('BOOL', 0), ), + FORUMS_TABLE => array( + 'forum_options' => array('UINT:20', 0), + ), ), 'change_columns' => array( USERS_TABLE => array( @@ -1086,10 +1089,7 @@ function change_database_data(&$no_updates, $version) set_config('feed_forum', '1'); set_config('feed_topic', '1'); - set_config('feed_news_id', ''); - set_config('feed_item_statistics', '1'); - set_config('feed_exclude_id', ''); // Entries for smiley pagination set_config('smilies_per_page', '50'); -- cgit v1.2.1 From 4525d1cb733e893762e87a4f597f8489a9917191 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 13 Aug 2009 14:51:47 +0000 Subject: - links to send statistics after install and update - link back to ACP main from send statistics - improved language / better explanation (incl. Bug #48555) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9969 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e77a170240..76de50186d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1284,6 +1284,49 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + // Also install the "Send statistics" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_SERVER_CONFIGURATION' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + // Check if we actually need to add the feed module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_SEND_STATISTICS' + AND module_mode = 'questionnaire' + AND module_auth = 'acl_a_server' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'send_statistics', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_SEND_STATISTICS', + 'module_mode' => 'send_statistics', + 'module_auth' => 'acl_a_server', + ); + + $_module->update_module_data($module_data, true); + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) -- cgit v1.2.1 From b4baa6a0941aa32db06ddabc56612616fe75605f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Aug 2009 15:25:20 +0000 Subject: Lifted minimum requirement for Firebird DBMS from 2.0+ to 2.1+. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9970 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 76de50186d..dc3fcfe956 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -222,6 +222,33 @@ if (empty($config['dbms_version'])) set_config('dbms_version', $db->sql_server_info(true)); } +// Firebird update from Firebord 2.0 to 2.1+ required? +if ($db->sql_layer == 'firebird') +{ + // We do not trust any PHP5 function enabled, we will simply test for a function new in 2.1 + $db->sql_return_on_error(true); + + $sql = 'SELECT 1 FROM RDB$DATABASE + WHERE BIN_AND(10, 1) = 0'; + $result = $db->sql_query($sql); + + if (!$result || $db->sql_error_triggered) + { + echo '

'; + echo '

' . $lang['ERROR'] . '


'; + + echo '

' . $lang['FIREBIRD_DBMS_UPDATE_REQUIRED'] . '

'; + + _print_footer(); + + exit_handler(); + exit; + } + + $db->sql_freeresult($result); + $db->sql_return_on_error(false); +} + // MySQL update from MySQL 3.x/4.x to > 4.1.x required? if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == 'mysqli') { -- cgit v1.2.1 From 5ecc57b87e0444c355574b61538c08a4a1c66aad Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 18 Aug 2009 08:22:17 +0000 Subject: Tiny typo change to r9743, #46425. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10013 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index dc3fcfe956..7656ea8952 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -13,7 +13,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = '3.0.5'; -// Which oldest version does this updater supports? +// Which oldest version does this updater support? $oldest_from_version = '3.0.0'; // Return if we "just include it" to find out for which version the database update is responsible for -- cgit v1.2.1 From 9382f6ba174e55ee0b43649e40282a6cb47800ff Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 24 Aug 2009 00:29:23 +0000 Subject: Fix bug #50245 - Check for correct module name when installing the "Send statistics" module. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10049 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7656ea8952..72bad95227 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1324,12 +1324,12 @@ function change_database_data(&$no_updates, $version) { $category_id = (int) $row['module_id']; - // Check if we actually need to add the feed module or if it is already added. ;) + // Check if we need to add the module or if it is already there. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " WHERE module_class = 'acp' AND module_langname = 'ACP_SEND_STATISTICS' - AND module_mode = 'questionnaire' + AND module_mode = 'send_statistics' AND module_auth = 'acl_a_server' AND parent_id = {$category_id}"; $result2 = $db->sql_query($sql); -- cgit v1.2.1 From 3f22f755a3a3da4f711454e25772f13c42014ecc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Aug 2009 17:22:21 +0000 Subject: correct mode is send_statistics, else installs will differ from updates. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10068 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 65 ++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 35 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 72bad95227..b9ac325778 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1181,11 +1181,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + if ($category_id) { - $category_id = (int) $row['module_id']; - // Check if we actually need to add the module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " @@ -1194,11 +1194,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = 'warnings' AND module_auth = 'acl_a_user' AND parent_id = {$category_id}"; - $result2 = $db->sql_query($sql); - $row2 = $db->sql_fetchrow($result2); - $db->sql_freeresult($result2); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row2) + if (!$row) { $module_data = array( 'module_basename' => 'users', @@ -1214,8 +1214,6 @@ function change_database_data(&$no_updates, $version) $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); - // Also install the "PM Reports" module $sql = 'SELECT module_id @@ -1225,15 +1223,15 @@ function change_database_data(&$no_updates, $version) AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + if ($category_id) { - $category_id = (int) $row['module_id']; - $modes = array( 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), - 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), - 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), + 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), + 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), ); foreach ($modes as $mode => $data) @@ -1245,11 +1243,11 @@ function change_database_data(&$no_updates, $version) AND module_langname = '{$data['title']}' AND module_mode = '$mode' AND parent_id = {$category_id}"; - $result2 = $db->sql_query($sql); - $row2 = $db->sql_fetchrow($result2); - $db->sql_freeresult($result2); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row2) + if (!$row) { $module_data = array( 'module_basename' => 'pm_reports', @@ -1266,7 +1264,6 @@ function change_database_data(&$no_updates, $version) } } } - $db->sql_freeresult($result); // Also install the "Copy forum permissions" module $sql = 'SELECT module_id @@ -1276,11 +1273,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + if ($category_id) { - $category_id = (int) $row['module_id']; - // Check if we actually need to add the feed module or if it is already added. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " @@ -1289,11 +1286,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = 'setting_forum_copy' AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' AND parent_id = {$category_id}"; - $result2 = $db->sql_query($sql); - $row2 = $db->sql_fetchrow($result2); - $db->sql_freeresult($result2); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row2) + if (!$row) { $module_data = array( 'module_basename' => 'permissions', @@ -1309,7 +1306,6 @@ function change_database_data(&$no_updates, $version) $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); // Also install the "Send statistics" module $sql = 'SELECT module_id @@ -1319,11 +1315,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = '' AND module_basename = ''"; $result = $db->sql_query($sql); + $category_id = (int) $db->sql_fetchfield('module_id'); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + if ($category_id) { - $category_id = (int) $row['module_id']; - // Check if we need to add the module or if it is already there. ;) $sql = 'SELECT * FROM ' . MODULES_TABLE . " @@ -1332,11 +1328,11 @@ function change_database_data(&$no_updates, $version) AND module_mode = 'send_statistics' AND module_auth = 'acl_a_server' AND parent_id = {$category_id}"; - $result2 = $db->sql_query($sql); - $row2 = $db->sql_fetchrow($result2); - $db->sql_freeresult($result2); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row2) + if (!$row) { $module_data = array( 'module_basename' => 'send_statistics', @@ -1352,7 +1348,6 @@ function change_database_data(&$no_updates, $version) $_module->update_module_data($module_data, true); } } - $db->sql_freeresult($result); $_module->remove_cache_file(); -- cgit v1.2.1 From 0dc8f103c9ab170f173ca1be4c04851d1c4fa6f8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 31 Aug 2009 09:38:53 +0000 Subject: ok, now we just define the modules we want to install on update and where they should appear. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10072 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 401 +++++++++++++++++--------------------- 1 file changed, 178 insertions(+), 223 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b9ac325778..d489521a20 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -575,6 +575,127 @@ function _write_result($no_updates, $errored, $error_ary) } } +function _add_modules($modules_to_install) +{ + global $phpbb_root_path, $phpEx, $db; + + include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); + + $_module = new acp_modules(); + + foreach ($modules_to_install as $module_mode => $module_data) + { + $_module->module_class = $module_data['class']; + + // Determine parent id first + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = '" . $db->sql_escape($module_data['class']) . "' + AND module_langname = '" . $db->sql_escape($module_data['cat']) . "' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + // There may be more than one categories with the same name + $categories = array(); + while ($row = $db->sql_fetchrow($result)) + { + $categories[] = (int) $row['module_id']; + } + $db->sql_freeresult($result); + + if (!sizeof($categories)) + { + continue; + } + + // Add the module to all categories found + foreach ($categories as $parent_id) + { + // Check if the module already exists + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = '" . $db->sql_escape($module_data['base']) . "' + AND module_class = '" . $db->sql_escape($module_data['class']) . "' + AND module_langname = '" . $db->sql_escape($module_data['title']) . "' + AND module_mode = '" . $db->sql_escape($module_mode) . "' + AND module_auth = '" . $db->sql_escape($module_data['auth']) . "' + AND parent_id = {$parent_id}"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // If it exists, we simply continue with the next category + if ($row) + { + continue; + } + + // Build the module sql row + $module_row = array( + 'module_basename' => $module_data['base'], + 'module_enabled' => (isset($module_data['enabled'])) ? (int) $module_data['enabled'] : 1, + 'module_display' => (isset($module_data['display'])) ? (int) $module_data['display'] : 1, + 'parent_id' => $parent_id, + 'module_class' => $module_data['class'], + 'module_langname' => $module_data['title'], + 'module_mode' => $module_mode, + 'module_auth' => $module_data['auth'], + ); + + $_module->update_module_data($module_row, true); + + // Ok, do we need to re-order the module, move it up or down? + if (!isset($module_data['after'])) + { + continue; + } + + $after_mode = $module_data['after'][0]; + $after_langname = $module_data['after'][1]; + + // First of all, get the module id for the module this one has to be placed after + $sql = 'SELECT left_id + FROM ' . MODULES_TABLE . " + WHERE module_class = '" . $db->sql_escape($module_data['class']) . "' + AND module_basename = '" . $db->sql_escape($module_data['base']) . "' + AND module_langname = '" . $db->sql_escape($after_langname) . "' + AND module_mode = '" . $db->sql_escape($after_mode) . "' + AND parent_id = '{$parent_id}'"; + $result = $db->sql_query($sql); + $first_left_id = (int) $db->sql_fetchfield('left_id'); + $db->sql_freeresult($result); + + if (!$first_left_id) + { + continue; + } + + // Ok, count the number of modules between $after_mode and the added module + $sql = 'SELECT COUNT(module_id) as num_modules + 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"; + $result = $db->sql_query($sql); + $steps = (int) $db->sql_fetchfield('num_modules'); + $db->sql_freeresult($result); + + // We need to substract 2 + $steps -= 2; + + if ($steps <= 0) + { + continue; + } + + // Ok, move module up $num_modules times. ;) + $_module->move_module_by($module_row, 'move_up', $steps); + } + } +} + /**************************************************************************** * ADD YOUR DATABASE SCHEMA CHANGES HERE * *****************************************************************************/ @@ -1124,230 +1245,64 @@ function change_database_data(&$no_updates, $version) // Entry for reporting PMs set_config('allow_pm_report', '1'); - include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); - - $_module = new acp_modules(); - - // Set the module class - $_module->module_class = 'acp'; - - $sql = 'SELECT module_id - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_BOARD_CONFIGURATION' - AND module_mode = '' - AND module_basename = ''"; - $result = $db->sql_query($sql); - $category_id = (int) $db->sql_fetchfield('module_id'); - $db->sql_freeresult($result); - - if ($category_id) - { - // Check if we actually need to add the feed module or if it is already added. ;) - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_basename = 'board' - AND module_class = 'acp' - AND module_langname = 'ACP_FEED_SETTINGS' - AND module_mode = 'feed' - AND module_auth = 'acl_a_board' - AND parent_id = {$category_id}"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - $module_data = array( - 'module_basename' => 'board', - 'module_enabled' => 1, - 'module_display' => 1, - 'parent_id' => $category_id, - 'module_class' => 'acp', - 'module_langname' => 'ACP_FEED_SETTINGS', - 'module_mode' => 'feed', - 'module_auth' => 'acl_a_board', - ); - - $_module->update_module_data($module_data, true); - } - } - - // Also install the "User Warning" module - $sql = 'SELECT module_id - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_USER_MANAGEMENT' - AND module_mode = '' - AND module_basename = ''"; - $result = $db->sql_query($sql); - $category_id = (int) $db->sql_fetchfield('module_id'); - $db->sql_freeresult($result); - - if ($category_id) - { - // Check if we actually need to add the module or if it is already added. ;) - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_USER_WARNINGS' - AND module_mode = 'warnings' - AND module_auth = 'acl_a_user' - AND parent_id = {$category_id}"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - $module_data = array( - 'module_basename' => 'users', - 'module_enabled' => 1, - 'module_display' => 0, - 'parent_id' => $category_id, - 'module_class' => 'acp', - 'module_langname' => 'ACP_USER_WARNINGS', - 'module_mode' => 'warnings', - 'module_auth' => 'acl_a_user', - ); - - $_module->update_module_data($module_data, true); - } - } - - // Also install the "PM Reports" module - $sql = 'SELECT module_id - FROM ' . MODULES_TABLE . " - WHERE module_class = 'mcp' - AND module_langname = 'MCP_REPORTS' - AND module_mode = '' - AND module_basename = ''"; - $result = $db->sql_query($sql); - $category_id = (int) $db->sql_fetchfield('module_id'); - $db->sql_freeresult($result); - - if ($category_id) - { - $modes = array( - 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), - 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), - 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), - ); - - foreach ($modes as $mode => $data) - { - // Check if we actually need to add the module or if it is already added. ;) - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_class = 'mcp' - AND module_langname = '{$data['title']}' - AND module_mode = '$mode' - AND parent_id = {$category_id}"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - $module_data = array( - 'module_basename' => 'pm_reports', - 'module_enabled' => 1, - 'module_display' => 1, - 'parent_id' => $category_id, - 'module_class' => 'mcp', - 'module_langname' => $data['title'], - 'module_mode' => $mode, - 'module_auth' => $data['auth'], - ); - - $_module->update_module_data($module_data, true); - } - } - } - - // Also install the "Copy forum permissions" module - $sql = 'SELECT module_id - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_FORUM_BASED_PERMISSIONS' - AND module_mode = '' - AND module_basename = ''"; - $result = $db->sql_query($sql); - $category_id = (int) $db->sql_fetchfield('module_id'); - $db->sql_freeresult($result); - - if ($category_id) - { - // Check if we actually need to add the feed module or if it is already added. ;) - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_FORUM_PERMISSIONS_COPY' - AND module_mode = 'setting_forum_copy' - AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' - AND parent_id = {$category_id}"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - $module_data = array( - 'module_basename' => 'permissions', - 'module_enabled' => 1, - 'module_display' => 1, - 'parent_id' => $category_id, - 'module_class' => 'acp', - 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', - 'module_mode' => 'setting_forum_copy', - 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', - ); - - $_module->update_module_data($module_data, true); - } - } - - // Also install the "Send statistics" module - $sql = 'SELECT module_id - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_SERVER_CONFIGURATION' - AND module_mode = '' - AND module_basename = ''"; - $result = $db->sql_query($sql); - $category_id = (int) $db->sql_fetchfield('module_id'); - $db->sql_freeresult($result); - - if ($category_id) - { - // Check if we need to add the module or if it is already there. ;) - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_class = 'acp' - AND module_langname = 'ACP_SEND_STATISTICS' - AND module_mode = 'send_statistics' - AND module_auth = 'acl_a_server' - AND parent_id = {$category_id}"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - $module_data = array( - 'module_basename' => 'send_statistics', - 'module_enabled' => 1, - 'module_display' => 1, - 'parent_id' => $category_id, - 'module_class' => 'acp', - 'module_langname' => 'ACP_SEND_STATISTICS', - 'module_mode' => 'send_statistics', - 'module_auth' => 'acl_a_server', - ); + // Install modules + $modules_to_install = array( + 'feed' => array( + 'base' => 'board', + 'class' => 'acp', + 'title' => 'ACP_FEED_SETTINGS', + 'auth' => 'acl_a_board', + 'cat' => 'ACP_BOARD_CONFIGURATION', + 'after' => array('signature', 'ACP_SIGNATURE_SETTINGS') + ), + 'warnings' => array( + 'base' => 'users', + 'class' => 'acp', + 'title' => 'ACP_USER_WARNINGS', + 'auth' => 'acl_a_user', + 'display' => 0, + 'cat' => 'ACP_CAT_USERS', + 'after' => array('feedback', 'ACP_USER_FEEDBACK') + ), + 'send_statistics' => array( + 'base' => 'send_statistics', + 'class' => 'acp', + 'title' => 'ACP_SEND_STATISTICS', + 'auth' => 'acl_a_server', + 'cat' => 'ACP_SERVER_CONFIGURATION' + ), + 'setting_forum_copy' => array( + 'base' => 'permissions', + 'class' => 'acp', + 'title' => 'ACP_FORUM_PERMISSIONS_COPY', + 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', + 'cat' => 'ACP_FORUM_BASED_PERMISSIONS', + 'after' => array('setting_forum_local', 'ACP_FORUM_PERMISSIONS') + ), + 'pm_reports' => array( + 'base' => 'pm_reports', + 'class' => 'mcp', + 'title' => 'MCP_PM_REPORTS_OPEN', + 'auth' => 'aclf_m_report', + 'cat' => 'MCP_REPORTS' + ), + 'pm_reports_closed' => array( + 'base' => 'pm_reports', + 'class' => 'mcp', + 'title' => 'MCP_PM_REPORTS_CLOSED', + 'auth' => 'aclf_m_report', + 'cat' => 'MCP_REPORTS' + ), + 'pm_report_details' => array( + 'base' => 'pm_reports', + 'class' => 'mcp', + 'title' => 'MCP_PM_REPORT_DETAILS', + 'auth' => 'aclf_m_report', + 'cat' => 'MCP_REPORTS' + ), + ); - $_module->update_module_data($module_data, true); - } - } + _add_modules($modules_to_install); $_module->remove_cache_file(); -- cgit v1.2.1 From 139f1d35302fc675b5e972e55c62d36cbc42af5c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 31 Aug 2009 14:57:04 +0000 Subject: fix r10076 for #48615 - Ability to specify amount of time user is able to delete his last post in topic. Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10080 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d489521a20..48dd55ac72 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1498,6 +1498,11 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); } + if (!isset($config['delete_time'])) + { + set_config('delete_time', $config['edit_time']); + } + $no_updates = false; break; } -- cgit v1.2.1 From 254dee274c0e2753edb171fcb71c71c8ed47222e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 1 Sep 2009 15:07:26 +0000 Subject: erm, wrong position git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10084 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 48dd55ac72..8ebe261d9e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -694,6 +694,8 @@ function _add_modules($modules_to_install) $_module->move_module_by($module_row, 'move_up', $steps); } } + + $_module->remove_cache_file(); } /**************************************************************************** @@ -1304,8 +1306,6 @@ function change_database_data(&$no_updates, $version) _add_modules($modules_to_install); - $_module->remove_cache_file(); - // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " -- cgit v1.2.1 From 2b5f04cf1c6987ec943ea3937e1d2c63b7982427 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 4 Sep 2009 10:25:31 +0000 Subject: changes for a little internal update test run git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10098 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 8ebe261d9e..b98ebfdd5f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,10 +8,10 @@ * */ -$updates_to_version = '3.0.6-dev'; +$updates_to_version = '3.0.6-alpha'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = '3.0.5'; +$debug_from_version = false; // Which oldest version does this updater support? $oldest_from_version = '3.0.0'; @@ -834,7 +834,7 @@ function database_update_info() // No changes from 3.0.5-RC1 to 3.0.5 '3.0.5-RC1' => array(), - // Changes from 3.0.5 + // Changes from 3.0.5 to 3.0.6-RC1 '3.0.5' => array( 'add_columns' => array( CONFIRM_TABLE => array( -- cgit v1.2.1 From 31856352be0f29fd7423cfe87bdfd791b03fb938 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 4 Sep 2009 15:19:26 +0000 Subject: Change version numbers to 3.0.6 and 3.0.6-RC1 for a final internal test run git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10105 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b98ebfdd5f..ab22c803ee 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.6-alpha'; +$updates_to_version = '3.0.6-RC1'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; -- cgit v1.2.1 From 0fe74ebceac75c559b8779f291ebb2df80309e92 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 4 Sep 2009 15:44:10 +0000 Subject: Add INDEX on user_regdate because this is the default ORDER BY in memberlist.php - thanks nickvergessen. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10106 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index ab22c803ee..54586c5650 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -877,6 +877,9 @@ function database_update_info() POSTS_TABLE => array( 'post_username' => array('post_username'), ), + USERS_TABLE => array( + 'user_regdate' => array('user_regdate'), + ), ), ), ); -- cgit v1.2.1 From fc5a21e16a6502a89fd7b541683f21e216c8cf2e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 4 Sep 2009 17:27:13 +0000 Subject: Revert r10106 - Index usage is very unlikely because of WHERE IN (). :-| git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10107 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 54586c5650..ab22c803ee 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -877,9 +877,6 @@ function database_update_info() POSTS_TABLE => array( 'post_username' => array('post_username'), ), - USERS_TABLE => array( - 'user_regdate' => array('user_regdate'), - ), ), ), ); -- cgit v1.2.1 From a5ec35e185126f5366a5749ad4f57325202b10f5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 10 Sep 2009 08:58:24 +0000 Subject: Fix database updater for PostgreSQL: Data needs to be GROUPed BY left_id, before we can ORDER BY left_id. Introduced in r10072. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10130 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index ab22c803ee..41983400fc 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -677,6 +677,7 @@ 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