aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-24 17:19:35 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-24 17:19:35 +0000
commit01b491e8f5930adca696a09d13501ad6236aadb6 (patch)
tree18d1294a528b2ca227a766ae456457c3d747d151 /phpBB/install/database_update.php
parent5f0b61065fdd107d32fa1f2c0b80981a239218a7 (diff)
downloadforums-01b491e8f5930adca696a09d13501ad6236aadb6.tar
forums-01b491e8f5930adca696a09d13501ad6236aadb6.tar.gz
forums-01b491e8f5930adca696a09d13501ad6236aadb6.tar.bz2
forums-01b491e8f5930adca696a09d13501ad6236aadb6.tar.xz
forums-01b491e8f5930adca696a09d13501ad6236aadb6.zip
- 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
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php18
1 files changed, 18 insertions, 0 deletions
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;
}