The Arcive of vBulletin Modifications Site. |
|
Automatically deny registration for users with multi-dotted email address Details »»
|
|||||||||||||||||||||||||||
|
Automatically deny registration for users with multi-dotted email address
Developer Last Online: Nov 2023
On my forum many bots have multi-dotted email address so I wanted to avoid them to create a new account on my forum.
The way to do this is create a new plugin to recognize these multi-dotted email address provided at time of registration and delete them automatically. Steps:
Code:
$this->validfields['email'][VF_CODE] = '
$max_dots = 1;
if ($retval = $dm->verify_useremail($data))
{
$parts = explode("@", $data);
if (is_array($parts) && substr_count($parts[0], ".") > $max_dots)
{
$dm->error("bademail");
$retval = false;
}
}
return $retval;
';
Special thanks to kh99 who provided this solution. Show Your Support
|
|||||||||||||||||||||||||||
| Благодарность от: | ||
| Comments |
|
#2
|
|||
|
|||
|
Many thank
|
|
#3
|
||||
|
||||
|
If you use email verification, that should catch the phony email addresses so they wouldn't be able to register, anyway.
|
|
#4
|
||||
|
||||
|
This plugin (not a MOD) was suggested to me based on my post that was answered by kh99 at https://vborg.vbsupport.ru/showpost....12&postcount=3
It doesn't delete registrants with multi-dotted emails, it merely prevents them from actually registering. |
|
#5
|
|||
|
|||
|
This is a good idea.
To prevent brain strain, can you easily tell me how to also check for semicolons or colons before the @? For a while I was getting Chinese bots with email address like gobbledygoop;more_gobbledygoop@somesite.com |
|
#6
|
||||
|
||||
|
You could write two additional plugins (give each a unique plugin name) using the code with only a slight modification.
Plugin to deny registration if email address contains any colons preceding the @ Code:
$this->validfields['email'][VF_CODE] = '
$max_colons = 0;
if ($retval = $dm->verify_useremail($data))
{
$parts = explode("@", $data);
if (is_array($parts) && substr_count($parts[0], ":") > $max_colons)
{
$dm->error("bademail");
$retval = false;
}
}
return $retval;
';
Code:
$this->validfields['email'][VF_CODE] = '
$max_semicolons = 0;
if ($retval = $dm->verify_useremail($data))
{
$parts = explode("@", $data);
if (is_array($parts) && substr_count($parts[0], ";") > $max_semicolons)
{
$dm->error("bademail");
$retval = false;
}
}
return $retval;
';
|
|
#7
|
||||
|
||||
|
You should be able to do a preg_match to cover all of them in a single piece of code.
|
|
#8
|
|||
|
|||
|
Thanks. I'll play around with this a bit and see if I can make it one if a or b or c statement.
|
|
#9
|
||||
|
||||
|
Maybe make it a setting where you can add what to exclude.
|
|
#10
|
|||
|
|||
|
That's probably a bit beyond my vBulletin skills.
|
![]() |
|
|