vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Moderate Registrations From Certain IP Addresses (https://vborg.vbsupport.ru/showthread.php?t=69011)

Tigga 09-01-2004 10:00 PM

Moderate Registrations From Certain IP Addresses
 
One of my clients asked me to create this for him a little while ago. It's a pretty simple hack, but seems to be pretty useful, so I thought I'd share it here as well. :)

What does it do?
Ever had problem users that keep registering and you can't ban their IP address because it's too common and other user's may be using the same IP/host? This hack may help you then. It gives you a new setting in your Admin CP where you may specify a list of IP addresses to moderate registrations from. Any new registrations from any of the IP addresses you specify will be added to the "(COPPA) Users Awaiting Moderation" group instead of the registered group. Simple, but effective. :)

File Modifications: 1
Queries to run: 3
Time to Install: 1 minute

Polo 09-02-2004 07:39 PM

Thanks for Sharing Brian, I may find this useful ;)

???`S?LV?R???` 09-02-2004 10:05 PM

nice..

jugo 09-03-2004 09:34 PM

Will this work with partial IPs like the normal IP banning options?

Tigga 09-06-2004 03:40 PM

Quote:

Originally Posted by juanph
Will this work with partial IPs like the normal IP banning options?

Yes. It works exactly the same as the IP banning option. :)

Dennis B 09-09-2004 12:38 AM

Very useful, much better than moderating everybody. :)
Thanks for sharing.

dwh 01-23-2005 06:51 PM

It looks very good but what if a future vbulletin version installs over those phraseids? Is there any system in place that frees up particular phraseids or make sure these hacks won't clash?

Tigga 01-23-2005 06:59 PM

Didn't realize I had the phraseid's in there. There's no way future versions of vB would use those though. The only way you would run into a problem is if you already had those phraseids in your db, in which case you'd get an error when trying to run the queries. I've removed the phraseids from the queries though.

dwh 02-02-2005 10:46 PM

While I really the idea behind this hack, I think you could approachthis better by focusing on implementing it in this section instead:

PHP Code:

if ($_REQUEST['a'] == 'act'

The reason being, in the current way you are allowing this user tocircumvent email verification. IMO, you should allow the user to gointo Users Awaiting Email Verification usergroup first. Then when itcomes to activation, at THAT point test for IPmoderation and put theuser there. Otherwise, you won't know if it's a good email in the firstplace.

Hope this makes sense.

dwh 02-08-2005 07:06 AM

Here you go I have a fix for the issue of this user not having to verify their email first.


Move down your whole code and modify it a bit. The new code should look like
Code:

                $vboptions['ipusermoderation'] = trim($vboptions['ipusermoderation']);
                if ($vboptions['ipusermoderation'])
                {
                        $addresses=explode('', preg_replace("/[[:space:]]+/", "",$vboptions['ipusermoderation']) );
                        foreach ($addresses AS $val)
                        {
                        if (strpos(' ' . IPADDRESS, ' ' . trim($val))!==false)
                                {
                                //thiswill be theusergroupidAFTER the user is verified
                                        $lateractivationid=4;
                                }
                                else
                                {
                                        $lateractivationid=2;
                                }
                        }
                }

And you want to place it right before this

Code:

                // sort out emails and usergroups
                if ($vboptions['verifyemail'])
                {

BUT you will have to ALSO change this line:

Code:

$activateid = build_user_activation_id($userid, 2, 0);
TO

Code:

$activateid = build_user_activation_id($userid, $lateractivationid, 0);
and you should be all set. WARNING, untested!


All times are GMT. The time now is 10:11 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.01136 seconds
  • Memory Usage 1,739KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete