session_begin();
$auth->acl($user->data);
$user->setup();
$start = $request->variable('start', 0);
$num_items = 1000;
echo '
Updating user email hashes' . "\n";
$sql = 'SELECT user_id, user_email
FROM ' . USERS_TABLE . '
ORDER BY user_id ASC';
$result = $db->sql_query($sql);
$echos = 0;
while ($row = $db->sql_fetchrow($result))
{
$echos++;
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_email_hash = '" . $db->sql_escape(phpbb_email_hash($row['user_email'])) . "'
WHERE user_id = " . (int) $row['user_id'];
$db->sql_query($sql);
if ($echos == 200)
{
echo '
';
$echos = 0;
}
echo '.';
flush();
}
$db->sql_freeresult($result);
echo 'FINISHED';
// Done
$db->sql_close();