PDA

View Full Version : Registration validation for email extension


printedgear
01-01-2011, 02:44 PM
I'm creating a website for the military. I'd like the registration to query if their registration email address is coming from a .mil addres. If it is, they get a "Verified" status and get plugged into a verified group. Is this possible? If not, is there another way to do it? Thanks!

BirdOPrey5
01-01-2011, 04:35 PM
Install this mod: https://vborg.vbsupport.ru/showthread.php?p=2141404

The go to your Admin CP -> Products & Plugins -> Plugin Manager

Edit the plugin called: Register Group

Delete all the PHP code and replace it with the following (copy and paste it in):

global $vbulletin;
if ($vbulletin->options['reg_group_enable'])
{
if ($vbulletin->options['reg_group'])
{
if (preg_match("/mil$/" , $vbulletin->userinfo['email']))
{
$newuser = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user
ORDER BY userid DESC");
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user
SET usergroupid = '" . $vbulletin->options['reg_group'] . "'
WHERE userid = '".$newuser['userid']."' ");
}
}
}


Now go setup the mod per instructions... it will move only people's who's email addresses end in "mil" to the usergroup you specify in options. Everyone else will go into the default "registered users" group.

printedgear
01-02-2011, 12:43 AM
You are amazing! This will be great. If they change their email address afterwards to a .com will they still be registered under the same .mil email address? I'd like to verify they're in the military, but allow them to transfer their email address back home.

BirdOPrey5
01-02-2011, 01:01 AM
Once they register you or they can change their email and their group will stay the same.