vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Allow specific emails domain to register (https://vborg.vbsupport.ru/showthread.php?t=40446)

Bouddha 06-29-2002 07:17 PM

Allow specific emails domain to register
 
Coming from http://www.vbulletin.com/forum/showt...threadid=49278

I would like to allow only an email domain to register.
In the CP I can only select a list of domain to ban but what I want is banning all BUT @mydomain.com .
I don't think it's hard or already requested.

Thx in advance !

Logician 06-30-2002 08:08 PM

edit register.php, find:

PHP Code:

 if (!$allowregistration) { 

before that add:

PHP Code:

if (stristr($email'@')!='@yourdomain.com'
{
eval(
"standarderror(\"".gettemplate("email_notallowed")."\");"); exit;


(edit yourdomain.com)

AdminCP/Add New Template, template name: email_notallowed

Create your message which will be displayed to users who doesnt have this email according to your wish.

Bouddha 07-01-2002 08:21 AM

Looks simple and efficient.
I have to try now ;)
Thx very much, I'll give you feedback

tylast 09-06-2003 12:51 PM

Exactly what I've been looking for! However, I have two questions:

1) How would it look if I wanted to have 2 domains accepted instead of just one?
EX: say .gov and .mil

2) How would it look if I just want to accept based on the top-level domain? I don't want to have to add the 200+ subdomains that I have to deal with.
EX: @blah.yeah.gov
I would only want to allow the .gov/ I see that you refered to the @ symbol in the code. How would that work???

Thanks in advance!

Logician 09-08-2003 08:34 PM

1-
PHP Code:

if (strtolower(substr($email,-4))!='.gov' AND strtolower(substr($email,-4))!='.mil'

eval(
"standarderror(\"".gettemplate("email_notallowed")."\");"); exit; 


2- If you want to restrict registrations to 200 domains of your choice, well it is not possible with a few lines of code like in this hack. You either need to enter them one by one in the code which wouldn't be handy (especially when you need to modify them later), or you need a more sophisticated hack which is not a 2 min job. :)

tylast 09-10-2003 10:21 PM

I tried that code under the Start Signup, Start Add Member, and the Start Register sections. Which section does that code go in? The code looks simlar in each, but not exactly what you typed. When I tried what you gave me, all I got was a white blank screen at different point depending on where I inserted the code. This is what I have before inserting:

if ($_REQUEST['do'] == 'signup')
{

globalize($_REQUEST, array('month' => INT, 'year' => INT));

if (!$vboptions['allowregistration'])
{
eval(print_standard_error('error_noregister'));
}

if ($bbuserinfo['userid'] != 0 AND !$vboptions['allowmultiregs'])
{
eval(print_standard_error('error_alreadyregistered '));
}

Logician 09-11-2003 09:38 AM

Isn't this VB3? My code is for vb2 and please note that VB3 hacks are disallowed until further notice from VB developers.

tylast 09-11-2003 08:19 PM

I didn't know about that, I'm new to this. Why is it prohibited anyway? Thanks for the help anyway.

Erwin 09-11-2003 08:29 PM

Public releases of vB3 hacks are not allowed yet because it is still beta, and the code is still being changed. When it turns RC, we will open the floodgates.


All times are GMT. The time now is 03:32 PM.

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.01036 seconds
  • Memory Usage 1,734KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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