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