Skip to content

Instantly share code, notes, and snippets.

@boxbilling
Created March 22, 2012 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxbilling/2164235 to your computer and use it in GitHub Desktop.
Save boxbilling/2164235 to your computer and use it in GitHub Desktop.
BoxBilling Hook to forbid certain email extensions
<?php
class Hook_CheckFreeMail
{
public static function onBeforeClientSignUp(Box_Event $event)
{
$data = $event->getSubject();
list($t, $domain) = explode('@', $data['email']);
if(!isset($data['email']) || empty($data['email'])) {
throw new Box_Exception('Please enter e-mail. ');
}
else if(($domain=='hotmail.com') || ($domain=='msn.com')) {
throw new Box_Exception('Registrations using this e-mail provider are disabled. Please use another e-mail to register. ');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment