How can I require new users to use a certain email domain? I need to verify that all users of this website that receive a role with certain privileges already are a part of this organization, and it seems like the easiest way to do this would be to require that people 1) use the organization email system, and 2) use that email for registration on the Drupal site. I'm just not really familiar with how to set that requirement up.
Any help would really make my day.

seth

Comments

zbricoleur’s picture

...that uses hook_form_alter to specify a custom validation function for the email field of the registration form.

seth.vincent’s picture

What's needed is simple:

Home › Administer › User management › Access rules

Make one rule that denies email addresses of any kind: the mask would be %@%

Next counter that with a rule that allows email addresses from the desired domain. The mask would look like this: %@example.com

simple things are neat.

zbricoleur’s picture

Yep, that's a better solution than mine ^_^

miche’s picture

Thank you!! This is what I needed as well.

---------------------------------------------------
Michelle Lauer
michellelauer.com

andrew7’s picture

Can this be done in a non-reversible way? i.e. Can the user be assigned a role that persists even after he changes his email?