Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 06-29-2002, 07:17 PM
Bouddha's Avatar
Bouddha Bouddha is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 !
Reply With Quote
  #2  
Old 06-30-2002, 08:08 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 07-01-2002, 08:21 AM
Bouddha's Avatar
Bouddha Bouddha is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks simple and efficient.
I have to try now
Thx very much, I'll give you feedback
Reply With Quote
  #4  
Old 09-06-2003, 12:51 PM
tylast tylast is offline
 
Join Date: Jul 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #5  
Old 09-08-2003, 08:34 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 09-10-2003, 10:21 PM
tylast tylast is offline
 
Join Date: Jul 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 '));
}
Reply With Quote
  #7  
Old 09-11-2003, 09:38 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Isn't this VB3? My code is for vb2 and please note that VB3 hacks are disallowed until further notice from VB developers.
Reply With Quote
  #8  
Old 09-11-2003, 08:19 PM
tylast tylast is offline
 
Join Date: Jul 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't know about that, I'm new to this. Why is it prohibited anyway? Thanks for the help anyway.
Reply With Quote
  #9  
Old 09-11-2003, 08:29 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:56 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.04590 seconds
  • Memory Usage 2,239KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete