PDA

View Full Version : How do I limit registration based upon email address?


beansbaxter
04-05-2006, 04:50 PM
Is it possible to setup new user registration only to email users who have certain email addresses?

An example: When a new user signs up, if they have an email address ending in yahoo.com then they can register and their account is enabled. If a user signs up with a hotmail.com email address, they can be registered but there accounts are not enabled unless they pay some sort of one-time fee.

Can this be done with vbulletin?

Hanoifishing
12-27-2007, 07:10 AM
Anybody have a solution for this.
My question's more simply than that.
Can VBB limit email register by one domain?
Example: Only users have an email ending in "abc.com" can register to my forum?
How can i do that?
Waiting for your replies!

WhaLberg
12-27-2007, 02:24 PM
Hanoifishing, yes, it is possible with a plugin. Add these codes to register_form_complete hook.


// allowed email address.
$domain = "domain.com";
// check if the user is using the allowed email address.
if (strpos($vbulletin->GPC['email'], $domain) === false)
{
eval(standard_error(fetch_error('you_are_not_allow ed_to_register')));
}


Add a phrase under "Error Messages" and enter "you_are_not_allowed_to_register" for varname and enter your message that you want to appear or feel free to change the error message.

That's all. Good luck.

Hanoifishing
12-27-2007, 11:13 PM
I've done this and it run successfully.
Thank you very much.

WhaLberg
12-28-2007, 08:50 AM
You are welcome. :)