From beeb2281cd3c4c20ae960a1ebbe19e0d0b5a4b92 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 21 May 2007 12:15:16 +0000 Subject: 99 bugs on the wall ... #11339 #11283 ... 97 bugs on the wall ... git-svn-id: file:///svn/phpbb/trunk@7658 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 6788ecd900..a350ee8f4e 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -533,6 +533,14 @@ function phpbb_convert_authentication($mode) ORDER BY user_regdate ASC"; $result = $src_db->sql_query($sql); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + while ($row = $src_db->sql_fetchrow($result)) { $user_id = (int) phpbb_user_id($row['user_id']); @@ -710,7 +718,7 @@ function phpbb_convert_authentication($mode) if ($mode == 'start') { user_group_auth('guests', 'SELECT user_id, {GUESTS} FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS, false); - user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS, false); + user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS . " AND group_id <> $bot_group_id", false); // Selecting from old table if (!empty($config['increment_user_id'])) -- cgit v1.2.1 From 2a7186898d152ffe6b0084be216c17f3a55cc3f4 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 22 May 2007 21:49:45 +0000 Subject: oops. git-svn-id: file:///svn/phpbb/trunk@7664 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index a350ee8f4e..246316513d 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -533,18 +533,9 @@ function phpbb_convert_authentication($mode) ORDER BY user_regdate ASC"; $result = $src_db->sql_query($sql); - - $sql = 'SELECT group_id - FROM ' . GROUPS_TABLE . " - WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; - $result = $db->sql_query($sql); - $bot_group_id = (int) $db->sql_fetchfield('group_id'); - $db->sql_freeresult($result); - while ($row = $src_db->sql_fetchrow($result)) { $user_id = (int) phpbb_user_id($row['user_id']); - // Set founder admin... $sql = 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_FOUNDER . " @@ -552,6 +543,13 @@ function phpbb_convert_authentication($mode) $db->sql_query($sql); } $src_db->sql_freeresult($result); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); } // Grab forum auth information -- cgit v1.2.1 From 7cffec58d0db3cbed6f6e55785d3accd89efe8aa Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 23 May 2007 15:05:46 +0000 Subject: This probably broke things :| #10697 #11421 #11555 #11421 git-svn-id: file:///svn/phpbb/trunk@7666 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 246316513d..badac08999 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -83,6 +83,14 @@ function phpbb_insert_forums() $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' ON'); break; } + + // pruning disabled globally? + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}config + WHERE config_name = 'prune_enable'"; + $result = $src_db->sql_query($sql); + $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); + $src_db->sql_freeresult($result); $cats_added = array(); while ($row = $src_db->sql_fetchrow($result)) @@ -206,7 +214,7 @@ function phpbb_insert_forums() 'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), - 'enable_prune' => $row['prune_enable'], + 'enable_prune' => ($prune_enabled) ? $row['prune_enable'] : 0, 'prune_next' => null_to_zero($row['prune_next']), 'prune_days' => null_to_zero($row['prune_days']), 'prune_viewed' => 0, -- cgit v1.2.1 From e45c503bde5df9583dde575bec2fe3ff406ac071 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 25 May 2007 09:34:05 +0000 Subject: undoing the fix for #11421 - correcting post counts was not well liked. #11665 git-svn-id: file:///svn/phpbb/trunk@7674 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index badac08999..4346c6f4d1 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -59,6 +59,15 @@ function phpbb_insert_forums() $max_forum_id++; + // pruning disabled globally? + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}config + WHERE config_name = 'prune_enable'"; + $result = $src_db->sql_query($sql); + $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); + $src_db->sql_freeresult($result); + + // Insert categories $sql = 'SELECT cat_id, cat_title FROM ' . $convert->src_table_prefix . 'categories @@ -84,13 +93,7 @@ function phpbb_insert_forums() break; } - // pruning disabled globally? - $sql = "SELECT config_value - FROM {$convert->src_table_prefix}config - WHERE config_name = 'prune_enable'"; - $result = $src_db->sql_query($sql); - $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); - $src_db->sql_freeresult($result); + $cats_added = array(); while ($row = $src_db->sql_fetchrow($result)) -- cgit v1.2.1 From 7aeb6a4c4ad8eb11623bfeaa37b6ba2f51aee472 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 29 May 2007 17:01:07 +0000 Subject: #11417 git-svn-id: file:///svn/phpbb/trunk@7698 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 4346c6f4d1..5db255f7f5 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -581,10 +581,11 @@ function phpbb_convert_authentication($mode) } // Grab user auth information from 2.0.x board $sql = "SELECT ug.user_id, aa.* - FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}user_group ug, {$convert->src_table_prefix}groups g + FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}user_group ug, {$convert->src_table_prefix}groups g, {$convert->src_table_prefix}forums f WHERE g.group_id = aa.group_id AND g.group_single_user = 1 - AND ug.group_id = g.group_id"; + AND ug.group_id = g.group_id + AND f.forum_id = aa.forum_id"; $result = $src_db->sql_query($sql); $user_access = array(); -- cgit v1.2.1 From e41b3b89437c166588e2ae77f02c85d1c238665b Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 9 Jun 2007 17:00:50 +0000 Subject: #12279 - Thanks to ToonArmy git-svn-id: file:///svn/phpbb/trunk@7742 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 5db255f7f5..ca4f49d938 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1727,15 +1727,15 @@ function phpbb_check_username_collisions() case 'sqlite': $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( user_id INTEGER NOT NULL DEFAULT \'0\', - username_clean varchar(255) NOT NULL DEFAULT \'\', + username_clean varchar(255) NOT NULL DEFAULT \'\' )'; break; } $db->sql_return_on_error(true); $db->sql_query($drop_sql); - $db->sql_query($create_sql); $db->sql_return_on_error(false); + $db->sql_query($create_sql); // now select all user_ids and usernames and then convert the username (this can take quite a while!) $sql = 'SELECT user_id, username -- cgit v1.2.1 From 367f5103d96b192dfca453e6c1a9e4f1a96b8122 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 16 Jun 2007 13:49:49 +0000 Subject: - Oracle can't handle IN clauses with more than 1000 elements (Bug #12449) - Firebird can now work properly in PHP4 git-svn-id: file:///svn/phpbb/trunk@7767 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index ca4f49d938..5c7bf2f903 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1711,7 +1711,7 @@ function phpbb_check_username_collisions() break; case 'oracle': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv + $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( user_id number(8) NOT NULL, username_clean varchar2(255) DEFAULT \'\' )'; -- cgit v1.2.1 From 827ecf9f30b73943e4736043c33578f2b3acdecf Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 16 Jun 2007 14:18:27 +0000 Subject: #11927 git-svn-id: file:///svn/phpbb/trunk@7769 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 5c7bf2f903..ec282c8f46 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -92,8 +92,6 @@ function phpbb_insert_forums() $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' ON'); break; } - - $cats_added = array(); while ($row = $src_db->sql_fetchrow($result)) @@ -281,6 +279,10 @@ function phpbb_insert_forums() switch ($db->sql_layer) { + case 'postgres': + $db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));'); + break; + case 'mssql': case 'mssql_odbc': $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF'); -- cgit v1.2.1 From 65442c6bdddb2f8e5329bc9c340a070f197cfc0b Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 19 Jun 2007 15:24:40 +0000 Subject: #12555 git-svn-id: file:///svn/phpbb/trunk@7783 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/install/convertors/functions_phpbb20.php') diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index ec282c8f46..eca72b64bd 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -287,6 +287,20 @@ function phpbb_insert_forums() case 'mssql_odbc': $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF'); break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(forum_id) as max_id FROM ' . FORUMS_TABLE); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . FORUMS_TABLE . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . FORUMS_TABLE . '_seq START WITH ' . ($largest_id + 1)); + } + break; } } -- cgit v1.2.1