Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2004, 09:48 PM
Idodo Idodo is offline
 
Join Date: Sep 2004
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Looking for the opposite of "banned emails"

i need to allow users to register only with email providers that i choose (like ISPs).
there is too many free emails service and i can't ban them all.
so i need to allow users to register only from domains that i want.

Thanks,
Ido.
Reply With Quote
  #2  
Old 09-07-2004, 12:19 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

quick'n'dirty but should work:

open includes/functions_user.php find this function:

PHP Code:
// ###################### Start checkbannedemail #######################
function is_banned_email($email)
{
    global 
$vboptions$datastore;

    if (
$vboptions['enablebanning'] AND !empty($datastore['banemail']))
    {
        
$bannedemails preg_split('/\s+/'$datastore['banemail'], -1PREG_SPLIT_NO_EMPTY);

        foreach (
$bannedemails AS $bannedemail)
        {
            if (
is_valid_email($bannedemail))
            {
                
$regex '^' preg_quote($bannedemail'#') . '$';
            }
            else
            {
                
$regex preg_quote($bannedemail'#');
            }

            if (
preg_match("#$regex#i"$email))
            {
                return 
1;
            }
        }
    }

    return 
0;

and change it into:

PHP Code:
// ###################### Start checkbannedemail #######################
function is_banned_email($email)
{
    global 
$vboptions$datastore;

    if (
$vboptions['enablebanning'] AND !empty($datastore['banemail']))
    {
        
$bannedemails preg_split('/\s+/'$datastore['banemail'], -1PREG_SPLIT_NO_EMPTY);

        foreach (
$bannedemails AS $bannedemail)
        {
            if (
is_valid_email($bannedemail))
            {
                
$regex '^' preg_quote($bannedemail'#') . '$';
            }
            else
            {
                
$regex preg_quote($bannedemail'#');
            }

            if (
preg_match("#$regex#i"$email))
            {
                return 
0;
            }
        }
        return 
1;
    }

    return 
0;

that inverts the banned email checking of vb, so all emails you enter in the banning textfield will be allowed, and every mail else won't be.

(at least it should )
Reply With Quote
  #3  
Old 09-07-2004, 02:39 PM
Idodo Idodo is offline
 
Join Date: Sep 2004
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll check it right now
thanks!
Reply With Quote
  #4  
Old 09-07-2004, 04:18 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're welcome
Reply With Quote
  #5  
Old 01-08-2005, 09:17 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using this also, many thanks Xenon!
Reply With Quote
  #6  
Old 01-09-2005, 02:29 AM
bigcurt's Avatar
bigcurt bigcurt is offline
 
Join Date: Nov 2004
Location: KierDarby.php
Posts: 1,009
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Floris have this for his site. He blocks yahoo and aol lol.
Reply With Quote
  #7  
Old 01-21-2005, 06:39 PM
-=Sniper=- -=Sniper=- is offline
 
Join Date: May 2002
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any chance of expanding this request, so it would work like the following,

when someone tries to register though a email in the allowed list he/she has no problems, how ever if a unknown domain is used, the admin has the verify the user, if the admin verifies the user the domain is added to the accept list automatically or manually.

thanks
Reply With Quote
  #8  
Old 06-21-2005, 03:01 PM
JMikeS JMikeS is offline
 
Join Date: Jun 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Everyone using this successfully? I must use this for our forums.

Thanks,
Mike
Reply With Quote
  #9  
Old 06-15-2006, 08:23 AM
futuredood futuredood is offline
 
Join Date: Jan 2002
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can someone get this working for 3.5.4?
Reply With Quote
  #10  
Old 09-06-2006, 06:39 PM
JMikeS JMikeS is offline
 
Join Date: Jun 2005
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This doesn't work with 3.6, any suggestions? The original function is:

PHP Code:
// ###################### Start checkbannedemail #######################
function is_banned_email($email)
{
    global 
$vbulletin;

    if (
$vbulletin->options['enablebanning'] AND $vbulletin->banemail !== null)
    {
        
$bannedemails preg_split('/\s+/'$vbulletin->banemail, -1PREG_SPLIT_NO_EMPTY);

        foreach (
$bannedemails AS $bannedemail)
        {
            if (
is_valid_email($bannedemail))
            {
                
$regex '^' preg_quote($bannedemail'#') . '$';
            }
            else
            {
                
$regex preg_quote($bannedemail'#') . ($vbulletin->options['aggressiveemailban'] ? '' '$');
            }

            if (
preg_match("#$regex#i"$email))
            {
                return 
1;
            }
        }
    }

    return 
0;

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:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04416 seconds
  • Memory Usage 2,272KB
  • Queries Executed 11 (?)
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
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete