Potential scenario:

Allow users with a particular email address or token to skip the admin approval step and have their account approved ie: it sends the password/login link out immediately and they don't receive the awaiting approval email.

All other users with other email addresses need to be approved by an admin.

One potential solution I've thought of is to act on hook_user_insert to unblock and send the password email the user hook_mail_alter to disable the initial awaiting approval email.

I just feel this option is a bit hacky and I'm wondering if there is a better way of doing things.


Take a look at User Restrictions module for Drupal 7 and Access Rules for Drupal 6.


For registering users based on unique code check out regcode module

  • It looks like the user restrictions module is in a bad way at the moment! Also, it's less about restricting user emails that was just one example, another example would be the user has a registration code & they can bypass the admin approval – TEDavis Nov 28 '11 at 18:00
  • updated my answer accordingly. and contrib modules are definitely a better option compared to writing your own hack. – karthik Nov 28 '11 at 18:12
  • Thanks karthik I'll take a look at the regcode module, do you know if it allows the two sorts of signup then? ie: users with a regcode need admin approval but users with a regcode can bypass it? – TEDavis Nov 28 '11 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.