vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Registration validation for email extension (https://vborg.vbsupport.ru/showthread.php?t=256309)

printedgear 01-01-2011 02:44 PM

Registration validation for email extension
 
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):
Code:

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.


All times are GMT. The time now is 11:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01388 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete