1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-27 17:49:27 +02:00
php-phpbb/phpBB/develop/calc_email_hash.php
Meik Sievertsen 2f4a618900 ok... i hope i haven't messed too much with the code and everything is still working.
Changes:
- Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed.
- A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added.

git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-05-29 12:25:56 +00:00

64 lines
1.5 KiB
PHP

<?php
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : calc_email_hash.php
// STARTED : Tue Feb 03, 2004
// COPYRIGHT : © 2004 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
//
// Security message:
//
// This script is potentially dangerous.
// Remove or comment the next line (die(".... ) to enable this script.
// Do NOT FORGET to either remove this script or disable it after you have used it.
//
die("Please read the first lines of this script for instructions on how to enable it");
@set_time_limit(300);
define('IN_PHPBB', 1);
define('PHPBB_ROOT_PATH', './../');
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
$start = 0;
do
{
// Batch query for group members, call group_user_del
$sql = "SELECT user_id, user_email
FROM {$table_prefix}users
LIMIT $start, 100";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
do
{
$sql = "UPDATE {$table_prefix}users
SET user_email_hash = " . (crc32(strtolower($row['user_email'])) . strlen($row['user_email'])) . '
WHERE user_id = ' . $row['user_id'];
$db->sql_query($sql);
$start++;
}
while ($row = $db->sql_fetchrow($result));
echo "<br />Batch -> $start\n";
flush();
}
else
{
$start = 0;
}
$db->sql_freeresult($result);
}
while ($start);
echo "<p><b>Done</b></p>\n";
?>