This is how I have it now:
/**
* Registration::ProcessRegistration()
*
* @return
*/
protected function ProcessRegistration()
{
// Yes, there was an error
if(!$this->VerifyData()) {
$this->ShowForm();
return;
}
$vbv="VBV";
$data = array(
'firstname' => $this->post->firstname,
'lastname' => $this->post->lastname,
'email' => $this->post->email,
'password' => $this->post->password1,
'code' => $vbv,
'location' => $this->post->location,
'hub' => $this->post->hub,
'confirm' => false
);
if(CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) {
return false;
}
// Check email for known spammer
$url = 'http://www.stopforumspam.com/api?email='.$data['email'].'&ip='.$_SERVER['REMOTE_ADDR'];
$file = new CodonWebService();
$contents = $file->get($url);
$response = simplexml_load_string($contents);
$reject = FALSE;
foreach($response->appears as $row)
{
if($row == 'yes'){$reject = TRUE;}
}
if($reject == TRUE){
$this->set('message', 'Your email or IP address appears on our spam database, we therefore assume
you are a spammer and are rejecting your registration request. If you feel this is incorrect please contact us.');
$this->render('core_error.tpl');
//send email that spam registration rejected
$email = 'your email here';
$sub = 'Spam Registration Rejected';;
$message = 'Spam pilot registration rejected using email '.$data['email'].' and
IP address '.$_SERVER['REMOTE_ADDR'].' on '.date('m/d/Y', time()).' at '.date('g:ia', time());
Util::SendEmail($email, $sub, $message);
return false;
}
//end spam check
$ret = RegistrationData::CheckUserEmail($data['email']);
if($ret) {
$this->set('error', Lang::gs('email.inuse'));
$this->render('registration_error.tpl');
return false;
}