<?php
//
// Copyright (c) 2002 Matthijs van de Water
//

define("IN_PHPBB"true);

$phpbb_root_path "./";

include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);

$body "Hi \$name,

Our board \$boardname has recently been converted to phpBB.
As a result of that, your password was changed.

Your new password is: \$pass

You can change it after you login at
\$url

\$sig
"
;

$from $board_config['board_email'];
$sig $board_config['board_email_sig'];
$boardname $board_config['sitename'];
$url 'http://' $board_config['server_name'] . $board_config['script_path'];
$subject $boardname " important info";

$sql "SELECT username, user_email, user_newpasswd FROM " USERS_TABLE " WHERE user_active = 1";

$result $db->sql_query($sql) or die("Error querying userinfo");

while ( 
$row $db->sql_fetchrow($result) )
{
    
$email $row['user_email'];
    
$name $row['username'];
    
$pass $row['user_newpasswd'];

    eval(
"\$emailbody = \"$body\";");
    
mail($email$subject$emailbody"From: $from");
    print 
$email " done...<br>";
    
flush();
}

print 
"<br><br><b>Process complete</b>";

// clear the cleartext password from the database... do this only if you're sure the emails have been send
// $db->sql_query("UPDATE " . USERS_TABLE . " SET user_newpasswd = ''");
?>