aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:09:11 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:09:11 +0100
commit35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40 (patch)
tree098e3b3e043f6c3e31c9c922287f76e5ec726e03 /phpBB/install/database_update.php
parentMerge commit 'release-3.0.7-RC1' (diff)
parentTagging the 3.0.7-RC2 release. (diff)
downloadphpbb-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar.gz
phpbb-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar.bz2
phpbb-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.zip
Merge commit 'release-3.0.7-RC2'
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 1d58276b10..9bb09747da 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.7-RC1';
+$updates_to_version = '3.0.7-RC2';
// Enter any version to update from to test updates. The version within the db will not be updated.
$debug_from_version = false;
@@ -906,6 +906,11 @@ function database_update_info()
),
),
),
+
+ // No changes from 3.0.7-RC1 to 3.0.7-RC2
+ '3.0.7-RC1' => array(),
+ // No changes from 3.0.7-RC2 to 3.0.7
+ '3.0.7-RC2' => array(),
);
}
@@ -1597,6 +1602,46 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // Changes from 3.0.7-RC1 to 3.0.7-RC2
+ case '3.0.7-RC1':
+
+ $sql = 'SELECT user_id, user_email, user_email_hash
+ FROM ' . USERS_TABLE . '
+ WHERE user_type <> ' . USER_IGNORE . "
+ AND user_email <> ''";
+ $result = $db->sql_query($sql);
+
+ $i = 0;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ // Snapshot of the phpbb_email_hash() function
+ // We cannot call it directly because the auto updater updates the DB first. :/
+ $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']);
+
+ if ($user_email_hash != $row['user_email_hash'])
+ {
+ $sql_ary = array(
+ 'user_email_hash' => $user_email_hash,
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ _sql($sql, $errored, $error_ary, ($i % 100 == 0));
+
+ ++$i;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ $no_updates = false;
+
+ break;
+
+ // No changes from 3.0.7-RC2 to 3.0.7
+ case '3.0.7-RC2':
+ break;
}
}