From 38efea8d5834853082006bf6bf61fc3cb49c8322 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 12:27:20 +0000 Subject: different time limit for installer git-svn-id: file:///svn/phpbb/trunk@6685 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 461b5807c2..011e7bfa35 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -27,7 +27,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); //error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL); -@set_time_limit(120); +@set_time_limit(0); // Include essential scripts include($phpbb_root_path . 'config.' . $phpEx); -- cgit v1.2.1 From ec80eb74aa5874f8790c3435bf4dd9fdf9614c6f Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 17:36:59 +0000 Subject: #5734 - replaced array_rand($array) with mt_rand(0, sizeof($array) - 1) as array_rand did not take my seed git-svn-id: file:///svn/phpbb/trunk@6705 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 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 011e7bfa35..fa691d9119 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -196,6 +196,33 @@ $dbms_type_map = array( 'VARBINARY' => '[varchar] (255)', ), + 'db2' => array( + 'INT:' => 'integer', + 'BINT' => 'float', + 'UINT' => 'integer', + 'UINT:' => 'integer', + 'TINT:' => 'smallint', + 'USINT' => 'smallint', + 'BOOL' => 'smallint', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'varchar(1000)', + 'STEXT' => 'varchar(3000)', + 'TEXT' => 'varchar(8000)', + 'MTEXT' => 'varchar(32672)', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT_UNI' => 'varchar(4000)', + 'MTEXT_UNI' => 'varchar(32672)', + 'TIMESTAMP' => 'integer', + 'DECIMAL' => 'float', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', + 'VARBINARY' => 'varchar(255)', + ), + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -308,7 +335,14 @@ $database_update_info = array( ), ), // Latest version - '3.0.b4' => array(), + '3.0.b4' => array( + // Add the following columns + 'add_columns' => array( + CONFIRM_TABLE => array( + 'seed' => array('UINT:10', 0), + ), + ), + ), ); // Determine mapping database type -- cgit v1.2.1 From 83443a362db2d4ccef25898d8192e2aa33cdbb68 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 17:40:28 +0000 Subject: none of you saw that! at least, not for this version :P git-svn-id: file:///svn/phpbb/trunk@6706 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fa691d9119..dae441f40b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -196,33 +196,6 @@ $dbms_type_map = array( 'VARBINARY' => '[varchar] (255)', ), - 'db2' => array( - 'INT:' => 'integer', - 'BINT' => 'float', - 'UINT' => 'integer', - 'UINT:' => 'integer', - 'TINT:' => 'smallint', - 'USINT' => 'smallint', - 'BOOL' => 'smallint', - 'VCHAR' => 'varchar(255)', - 'VCHAR:' => 'varchar(%d)', - 'CHAR:' => 'char(%d)', - 'XSTEXT' => 'varchar(1000)', - 'STEXT' => 'varchar(3000)', - 'TEXT' => 'varchar(8000)', - 'MTEXT' => 'varchar(32672)', - 'XSTEXT_UNI'=> 'varchar(100)', - 'STEXT_UNI' => 'varchar(255)', - 'TEXT_UNI' => 'varchar(4000)', - 'MTEXT_UNI' => 'varchar(32672)', - 'TIMESTAMP' => 'integer', - 'DECIMAL' => 'float', - 'VCHAR_UNI' => 'varchar(255)', - 'VCHAR_UNI:'=> 'varchar(%d)', - 'VCHAR_CI' => 'varchar(255)', - 'VARBINARY' => 'varchar(255)', - ), - 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', -- cgit v1.2.1 From 1c41450bd90f86f47521952e7f48339f103b8e5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 8 Dec 2006 15:20:57 +0000 Subject: - re-add script_path for "strange configurations" to let them force the generated urls correctly - show rank title if no rank image present in memberlist - other fixes. git-svn-id: file:///svn/phpbb/trunk@6730 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index dae441f40b..e5c0998be5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -490,6 +490,14 @@ if (version_compare($current_version, '3.0.b3', '<')) $no_updates = false; } +if (version_compare($current_version, '3.0.b4', '<')) +{ + // Add config value + set_config('script_path', '/'); + + $no_updates = false; +} + _write_result($no_updates, $errored, $error_ary); $error_ary = array(); -- cgit v1.2.1 From 4e2d04dd4af4ee8d7be21788fe7e079bfd53e7d7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 14:33:21 +0000 Subject: implemented updater changes git-svn-id: file:///svn/phpbb/trunk@6736 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 43 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 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 e5c0998be5..e9d429f45c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -60,6 +60,7 @@ require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); +$user = new user(); $cache = new cache(); $db = new $sql_db(); @@ -85,6 +86,7 @@ include($phpbb_root_path . 'language/' . $row['config_value'] . '/install.' . $p //set_error_handler('msg_handler'); // Define some variables for the database update +$inline_update = (request_var('type', 0)) ? true : false; // Database column types mapping $dbms_type_map = array( @@ -388,6 +390,21 @@ echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . 'sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); +} // Schema updates ?> @@ -548,11 +565,33 @@ _write_result($no_updates, $errored, $error_ary);
-

+ + +

-

+

+ +

+ +

»

+ +ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; +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(); -- cgit v1.2.1 From f40e2aba2261aaf79ee3b5ebe87b71dd6d30d1cb Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 10 Dec 2006 17:44:45 +0000 Subject: - finally correctly calculate current time for birthday calculation [Bug #6030] - allow searching forums with unsearchable subforums [Bug #6056] - addition of an optional HTTP_X_FORWARDED_FOR check in sessions, including bans - do not index forums which have indexing disabled on index recreation [Bug #6060] - properly handle html entities in the theme editor [Bug #6048] - anonymous access is no longer required for the LDAP auth plugin [Bug #6046] - corrected mcp_front queue link to point to approve_details [Bug #6134] - added direct (dis)approval to mcp_front queue items [Bug #6134] - proper mysql version test for fulltext-compatibility [Bug #6054] - added note to style/language "used by" column so it's clear that bots are included - correctly update bot last visit time [Bug #6108] git-svn-id: file:///svn/phpbb/trunk@6740 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 5 ++++- 1 file changed, 4 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 e9d429f45c..389008f393 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -314,7 +314,10 @@ $database_update_info = array( // Add the following columns 'add_columns' => array( CONFIRM_TABLE => array( - 'seed' => array('UINT:10', 0), + 'seed' => array('UINT:10', 0), + ), + SESSIONS_TABLE => array( + 'session_forwarded_for' => array('VCHAR:255', 0), ), ), ), -- cgit v1.2.1 From c02215f7ccaf98174f87795e312273a1d85eaf44 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 18:06:27 +0000 Subject: add the added config vars git-svn-id: file:///svn/phpbb/trunk@6741 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 5 ++++- 1 file changed, 4 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 389008f393..92e0e593fa 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -512,8 +512,11 @@ if (version_compare($current_version, '3.0.b3', '<')) if (version_compare($current_version, '3.0.b4', '<')) { - // Add config value + // Add config values set_config('script_path', '/'); + set_config('forwarded_for_check', '0'); + set_config('ldap_password', ''); + set_config('ldap_user', ''); $no_updates = false; } -- cgit v1.2.1 From 7eff1949cac08271fd745feb20564ee7dc9bee80 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 10 Dec 2006 18:14:47 +0000 Subject: #5242 git-svn-id: file:///svn/phpbb/trunk@6742 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 92e0e593fa..5717dbc4d2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -518,6 +518,16 @@ if (version_compare($current_version, '3.0.b4', '<')) set_config('ldap_password', ''); set_config('ldap_user', ''); + $sql = 'SELECT user_colour + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY user_id DESC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('newest_user_colour', $row['user_colour'], true); + $no_updates = false; } -- cgit v1.2.1 From 2e4cd16058cc548068a94047c9c31e5a9ad272d0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 15 Dec 2006 14:54:52 +0000 Subject: - fixed bug within the database update script - #6254 - #6242 - #6184 - #6160 - #6020 git-svn-id: file:///svn/phpbb/trunk@6770 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 5717dbc4d2..ae52373609 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -488,7 +488,7 @@ flush(); $no_updates = true; // some code magic -if (version_compare($current_version, '3.0.b3', '<')) +if (version_compare($current_version, '3.0.b3', '<=')) { // Set group_founder_manage for administrators group $sql = 'SELECT group_id @@ -510,7 +510,7 @@ if (version_compare($current_version, '3.0.b3', '<')) $no_updates = false; } -if (version_compare($current_version, '3.0.b4', '<')) +if (version_compare($current_version, '3.0.b4', '<=')) { // Add config values set_config('script_path', '/'); -- cgit v1.2.1 From 6938688e75e703208bd1087be8f37383da8e3f15 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 16 Dec 2006 13:16:22 +0000 Subject: let set_config() calls success instead of fail if the config value already exist. git-svn-id: file:///svn/phpbb/trunk@6773 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 20 +++++++++++++------- 1 file changed, 13 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 ae52373609..0f3f5b3aa2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -381,19 +381,25 @@ $errored = false;

:: sql_layer; ?>
sql_query($sql); -$row = $db->sql_fetchrow($result); + +while ($row = $db->sql_fetchrow($result)) +{ + $config[$row['config_name']] = $row['config_value']; +} $db->sql_freeresult($result); -echo $lang['PREVIOUS_VERSION'] . ' :: ' . $row['config_value'] . '
'; + +echo $lang['PREVIOUS_VERSION'] . ' :: ' . $config['version'] . '
'; echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . ''; -$current_version = strtolower($row['config_value']); +$current_version = strtolower($config['version']); $latest_version = strtolower($updates_to_version); -$orig_version = $row['config_value']; +$orig_version = $config['version']; // 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) -- cgit v1.2.1 From 6d0a00a446396ab72d8fb0475f4cd1c8ab9fa151 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 17:50:48 +0000 Subject: #6492 git-svn-id: file:///svn/phpbb/trunk@6793 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 149 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0f3f5b3aa2..6c1f030d6b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -321,6 +321,23 @@ $database_update_info = array( ), ), ), + // Latest version + '3.0.b5' => array( + // Remove the following keys + 'drop_keys' => array( + ZEBRA_TABLE => array( + 'user_id', + 'zebra_id', + ), + ), + // Add the following primary keys + 'add_primary_keys' => array( + ZEBRA_TABLE => array( + 'user_id', + 'zebra_id', + ), + ), + ), ); // Determine mapping database type @@ -472,6 +489,27 @@ foreach ($database_update_info as $version => $schema_changes) } } } + + // Remove keys? + if (!empty($schema_changes['drop_keys'])) + { + foreach ($schema_changes['drop_keys'] as $table => $indexes) + { + foreach ($indexes as $index_name) + { + sql_index_drop($map_dbms, $index_name, $table); + } + } + } + + // Add primary keys? + if (!empty($schema_changes['add_primary_keys'])) + { + foreach ($schema_changes['add_primary_keys'] as $table => $columns) + { + sql_create_primary_key($map_dbms, $table, $columns); + } + } } _write_result($no_updates, $errored, $error_ary); @@ -968,6 +1006,117 @@ function sql_column_add($dbms, $table_name, $column_name, $column_data) } } +function sql_index_drop($dbms, $index_name, $table_name) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + switch ($dbms) + { + case 'mssql': + $sql = 'DROP INDEX ' . $table_name . '\.' . $index_name . ' ON ' . $table_name; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'DROP INDEX ' . $index_name . ' ON ' . $table_name; + _sql($sql, $errored, $error_ary); + break; + + case 'firebird': + case 'oracle': + case 'postgres': + case 'sqlite': + $sql = 'DROP INDEX ' . $table_name . '_' . $index_name; + _sql($sql, $errored, $error_ary); + break; + } +} + +function sql_create_primary_key($dbms, $table_name, $column) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + switch ($dbms) + { + case 'firebird': + case 'postgres': + $sql = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'mssql': + $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD "; + $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED ("; + $sql .= '[' . implode("],\n\t\t[", $column) . ']'; + $sql .= ') ON [PRIMARY]'; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'oracle': + $sql = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'sqlite': + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = _sql($sql, $errored, $error_ary); + + if (!$result) + { + break; + } + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + // Create a backup table and populate it, destroy the existing one + $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql'])); + $db->sql_query('INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name); + $db->sql_query('DROP TABLE ' . $table_name); + + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $db->sql_query('CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'); + $db->sql_query('INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'); + $db->sql_query('DROP TABLE ' . $table_name . '_temp'); + + $db->sql_transaction('commit'); + break; + } +} + /** * Change column type (not name!) */ -- cgit v1.2.1 From 3182317ef19a1a5fd632c1e645534fb1b056a578 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Dec 2006 18:17:05 +0000 Subject: comment the version mapping more appropiatly. git-svn-id: file:///svn/phpbb/trunk@6795 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6c1f030d6b..97cf8ad8b6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -285,7 +285,7 @@ $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); // Only an example, but also commented out $database_update_info = array( - // Changes within this version + // Changes from 3.0.b3 to the next version '3.0.b3' => array( // Change the following columns... 'change_columns' => array( @@ -309,7 +309,7 @@ $database_update_info = array( ), ), ), - // Latest version + // Changes from 3.0.b4 to the next version '3.0.b4' => array( // Add the following columns 'add_columns' => array( @@ -320,9 +320,6 @@ $database_update_info = array( 'session_forwarded_for' => array('VCHAR:255', 0), ), ), - ), - // Latest version - '3.0.b5' => array( // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -1346,17 +1343,18 @@ function add_bots() foreach ($bot_list as $bot_name => $bot_ary) { $user_row = array( - 'user_type' => USER_IGNORE, - 'group_id' => $group_id, - 'username' => $bot_name, - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => '9E8DA7', - 'user_email' => '', - 'user_lang' => $config['default_lang'], - 'user_style' => 1, - 'user_timezone' => 0, - 'user_dateformat' => $config['default_dateformat'], + 'user_type' => USER_IGNORE, + 'group_id' => $group_id, + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => '9E8DA7', + 'user_email' => '', + 'user_lang' => $config['default_lang'], + 'user_style' => 1, + 'user_timezone' => 0, + 'user_dateformat' => $config['default_dateformat'], + 'user_allow_massemail' => 0, ); $user_id = user_add($user_row); -- cgit v1.2.1 From fb4e1920fcfc596eacdfa02f4752b83ca1e95508 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 15:35:24 +0000 Subject: #6372 git-svn-id: file:///svn/phpbb/trunk@6806 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 97cf8ad8b6..febd88665f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -569,6 +569,17 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('newest_user_colour', $row['user_colour'], true); + switch ($config['allow_name_chars']) + { + case '[\w]+': + set_config('allow_name_chars', '[a-z]+'); + break; + + case '[\w_\+\. \-\[\]]+': + set_config('allow_name_chars', '[-\]_+ [a-z]+'); + break; + } + $no_updates = false; } -- cgit v1.2.1 From b41365fcd41fc185fe197667d2f0bec13f6c30c2 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 27 Dec 2006 00:06:39 +0000 Subject: - display search type as page title for premade searches [Bug #6508] - flash enabled on user side by default, so that admins can actually change anything by activating it (still disabled by default) - properly implemented password complexity check [Bug #6584] - do not ldap_escape paramaters for the bind function [Bug #6208] - deleted words in edited post subjects weren't getting there search cache refreshed [Bug #6288] - made common word threshold configurable [Bug #6168] - recreated word match table entries after installation, side effect of bug #6060 - option to only allow ASCII usernames - adjusted search page pagination [Bug #6424] - correctly calculate unformatted search result extract length git-svn-id: file:///svn/phpbb/trunk@6814 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 febd88665f..42c7e101f8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -320,6 +320,10 @@ $database_update_info = array( 'session_forwarded_for' => array('VCHAR:255', 0), ), ), + 'change_columns' => array( + USERS_TABLE => array( + 'user_options' => array('UINT:11', 895), + ), // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -558,6 +562,7 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('forwarded_for_check', '0'); set_config('ldap_password', ''); set_config('ldap_user', ''); + set_config('fulltext_native_common_thres', '20'); $sql = 'SELECT user_colour FROM ' . USERS_TABLE . ' @@ -580,6 +585,28 @@ if (version_compare($current_version, '3.0.b4', '<=')) break; } + switch ($config['pass_complex']) + { + case '.*': + set_config('pass_complex', 'PASS_TYPE_ANY'); + break; + + case '[a-zA-Z]': + set_config('pass_complex', 'PASS_TYPE_CASE'); + break; + + case '[a-zA-Z0-9]': + set_config('pass_complex', 'PASS_TYPE_ALPHA'); + break; + + case '[a-zA-Z\W]': + set_config('pass_complex', 'PASS_TYPE_SYMBOL'); + break; + } + + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = 895 WHERE user_options = 893'; + _sql($sql, $errored, $error_ary); + $no_updates = false; } -- cgit v1.2.1 From 945afbc5fa427f6e6fa15f3e2f5c67969121b01e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 27 Dec 2006 17:43:55 +0000 Subject: Unused Code inside function update_forum_data [Bug #6606] Copy permissions protection for groups [Bug #6594] HTML issues in ACP [Bug #6580, #6578] Always send the correct encoding [related to bug #6576] Mass email fixes for first loop iteration [Bug #6570] Extension groups to be allowed in PM's and/or Posts [Bug #6558] Extension allowance checking clarified (no longer using forum id 0 for private messaging) Using request_var() array method for some variables [Bug #6556] Added confirmation for deletion of ranks/smilies/icons/word censores [Bug #6548, #6530, #6512, #6466] Only show postable forums in dropdown list for moving posts on forum deletion as well as correct re-indexing [Bug #6510, #6476, #6384] Jabber password being password field in jabber settings screen [Bug #6478] user activity language variable if viewing not own profile [Bug #6432] Show moderator group/user-name colour [Bug #6402] Log rank creation/updating/removing [Bug #6398] Update check permission changed from a_ to a_board [Bug #6392] git-svn-id: file:///svn/phpbb/trunk@6816 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 42c7e101f8..a003254df3 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -324,6 +324,7 @@ $database_update_info = array( USERS_TABLE => array( 'user_options' => array('UINT:11', 895), ), + ), // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -564,6 +565,10 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('ldap_user', ''); set_config('fulltext_native_common_thres', '20'); + // Remove config variables + $sql = 'DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'send_encoding'"; + _sql($sql, $errored, $error_ary); + $sql = 'SELECT user_colour FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') @@ -607,6 +612,10 @@ if (version_compare($current_version, '3.0.b4', '<=')) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = 895 WHERE user_options = 893'; _sql($sql, $errored, $error_ary); + $sql = 'UPDATE ' . MODULES_TABLE . " SET module_auth = 'acl_a_board' + WHERE module_class = 'acp' AND module_mode = 'version_check' AND module_auth = 'acl_a_'"; + _sql($sql, $errored, $error_ary); + $no_updates = false; } -- cgit v1.2.1 From 2b35b9d60d42c750485ba84b31818fad0b4e0a91 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 9 Jan 2007 14:10:44 +0000 Subject: - some bugfixes - bugfixes for the convertor (typecasting for example was totally broken) git-svn-id: file:///svn/phpbb/trunk@6865 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 a003254df3..90583c8a5a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -324,6 +324,11 @@ $database_update_info = array( USERS_TABLE => array( 'user_options' => array('UINT:11', 895), ), + FORUMS_TABLE => array( + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), + ), ), // Remove the following keys 'drop_keys' => array( -- cgit v1.2.1 From a841fe70a8234bf158165105339e32aa5ceb75a2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Jan 2007 18:41:49 +0000 Subject: ok, handled some bugs... the most important being validate_username (the variable passed to validate_data([...]array('username', [...])) and updating group listings while doing relevant group actions. Oh, and PM icons are working now. :o git-svn-id: file:///svn/phpbb/trunk@6894 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 90583c8a5a..64a4c46bb8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -329,6 +329,12 @@ $database_update_info = array( 'prune_viewed' => array('UINT', 0), 'prune_freq' => array('UINT', 0), ), + PRIVMSGS_RULES_TABLE => array( + 'rule_folder_id' => array('UINT', 0), + ), + PRIVMSGS_TO_TABLE => array( + 'folder_id' => array('UINT', 0), + ), ), // Remove the following keys 'drop_keys' => array( -- cgit v1.2.1 From e6f685c25f4f0414972498a2d3389ada3ea44bbc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 18 Jan 2007 10:00:39 +0000 Subject: fixing some bugs i introduced while fixing other bugs. :) git-svn-id: file:///svn/phpbb/trunk@6899 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 64a4c46bb8..5b909a1fe6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -330,10 +330,10 @@ $database_update_info = array( 'prune_freq' => array('UINT', 0), ), PRIVMSGS_RULES_TABLE => array( - 'rule_folder_id' => array('UINT', 0), + 'rule_folder_id' => array('INT:11', 0), ), PRIVMSGS_TO_TABLE => array( - 'folder_id' => array('UINT', 0), + 'folder_id' => array('INT:11', 0), ), ), // Remove the following keys -- cgit v1.2.1 From 576bb754e9f5b074c7c7c9bdc2debea4b5f65e1a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 21 Jan 2007 18:33:45 +0000 Subject: fixing some bugs, most being submitted grammatical/spelling errors. git-svn-id: file:///svn/phpbb/trunk@6915 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 5b909a1fe6..8fd30020a1 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.B4'; +$updates_to_version = '3.0.B5'; if (defined('IN_PHPBB') && defined('IN_INSTALL')) { -- cgit v1.2.1 From 01b491e8f5930adca696a09d13501ad6236aadb6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 24 Jan 2007 17:19:35 +0000 Subject: - fix severe bug with email hash calculation - fix bug in convertor not correctly converting config values git-svn-id: file:///svn/phpbb/trunk@6927 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 8fd30020a1..4d8fc449a0 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -627,6 +627,24 @@ if (version_compare($current_version, '3.0.b4', '<=')) WHERE module_class = 'acp' AND module_mode = 'version_check' AND module_auth = 'acl_a_'"; _sql($sql, $errored, $error_ary); + // Because the email hash could have been calculated wrongly, we will update it for every user. + // Since this is not used in a live environment there are not much... not used in a live environment, yes! + $sql = 'SELECT user_id, user_email + FROM ' . USERS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['user_email']) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_email_hash = ' . (crc32($row['user_email']) . strlen($row['user_email'])) . ' + WHERE user_id = ' . $row['user_id']; + _sql($sql, $errored, $error_ary); + } + } + $db->sql_freeresult($result); + $no_updates = false; } -- cgit v1.2.1 From 3c5c5154abddff39ec270ca82495a7923e4b254c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 27 Jan 2007 12:30:54 +0000 Subject: #7424 - rebuild username_clean column due to changes in utf8_clean_string() git-svn-id: file:///svn/phpbb/trunk@6934 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 25 ++++++++++++++++++------- 1 file changed, 18 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 4d8fc449a0..9870b47706 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -411,7 +411,7 @@ $errored = false;

:: sql_layer; ?>
sql_query($sql); while ($row = $db->sql_fetchrow($result)) { + $sql = 'UPDATE ' . USERS_TABLE . " + SET username_clean = '" . $db->sql_escape(utf8_clean_string($row['username'])) . "'"; + if ($row['user_email']) { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_email_hash = ' . (crc32($row['user_email']) . strlen($row['user_email'])) . ' - WHERE user_id = ' . $row['user_id']; - _sql($sql, $errored, $error_ary); + $sql .= ', user_email_hash = ' . (crc32($row['user_email']) . strlen($row['user_email'])); } + + $sql .= ' WHERE user_id = ' . $row['user_id']; + _sql($sql, $errored, $error_ary); } $db->sql_freeresult($result); @@ -1355,6 +1360,12 @@ function add_bots() $db->sql_query($sql); } } + else + { + // If the old bots are missing we can safely assume the user tries to execute the database update twice and + // fiddled around... + return; + } if (!function_exists('user_add')) { -- cgit v1.2.1 From 538ffb5bfb9dc2ebc9907adc3fc4ea020a442434 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 27 Jan 2007 16:41:14 +0000 Subject: some very tiny adjustements. git-svn-id: file:///svn/phpbb/trunk@6939 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 9870b47706..c2e672c863 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1289,6 +1289,7 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data) /** * Add search robots to the database +* @ignore */ function add_bots() { -- cgit v1.2.1 From 46bf79ec78906e2f36a8408a1edaf139ef6dd5b0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 28 Jan 2007 15:37:11 +0000 Subject: some important changes to let the update work. ;) git-svn-id: file:///svn/phpbb/trunk@6946 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 c2e672c863..666cb1aad3 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -436,7 +436,7 @@ if ($inline_update) { if ($current_version !== $latest_version) { - set_config('version_update_from', $row['config_value']); + set_config('version_update_from', $orig_version); } } else @@ -719,7 +719,7 @@ else { ?> -

+

»

-- cgit v1.2.1