· 8 years ago · May 02, 2018, 12:08 AM
1<?php
2// $Id$
3
4/**
5 * @file
6 */
7
8function validate_email_user($op, &$edit, &$account, $category = NULL) {
9 $public_emails = array('yahoo.com', 'gmail.com', 'hotmail.com', 'aol.com', 'live.com', 'me.com');
10 if ($op == 'validate') {
11 $domain = explode('@', strtolower($edit['mail']));
12 foreach ($public_emails as $pub_domain) {
13 if($pub_domain == $domain['1']) {
14 form_set_error('mail', t('Account creation using a free email provider has been disabled. Please use your office email address.'));
15 }
16 }
17 }
18}