Originally from this topic:
http://forum.phpvms.net/index.php?topic=272.0
<?php
class ForumRegister extends CodonModule
{
public function __construct()
{
CodonEvent::addListener('ForumRegister');
}
public function EventListener($eventinfo)
{
if($eventinfo[0] == 'registration_complete')
{
$userinfo = $eventinfo[2];
$fname = $userinfo['firstname'];
$lname = $userinfo['lastname'];
$pass = $userinfo['password1'];
$email = $userinfo['email'];
$code = $userinfo['code'];
$uinfo = PilotData::GetPilotByEmail($userinfo['email']);
$code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid);
$pilot_id = $fname.$lname.$code.$pilot_id;
$pilot_id_klein = strtolower($pilot_id);
$passMD5 = md5($pass);
$tm = time();
DB::query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_actkey, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '9','0.0', '0', '2','en','0099FF','1','5BN4938HB2','D M d, Y g:i a', '2', '".$tm."')");
}
}
}
?>
So far, confirmed working by one person. But I would feel more comfortable if it were using the phpBB API for adding users.