Created
March 22, 2012 20:49
-
-
Save boxbilling/2164235 to your computer and use it in GitHub Desktop.
BoxBilling Hook to forbid certain email extensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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