Back to vBulletin 4.x Add-ons

Automatically deny registration for users with multi-dotted email address
Mod Version: 1.00, by cloferba

vB Version: 4.2.0 Rating: (3 votes - 4.33 average) Installs: 18
Released: 27 May 2012 Last Update: Never Downloads: 0
Not Supported Uses Plugins Re-usable Code Translations  

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:
  • Create a new plugin using hook userdata_start
  • Use this code:
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;
';
It only checks the part before the '@', so set $max_dots to the number of dots you will allow (I think one dot in an email name probably isn't unusual, but that's up to you). Also, this uses the default 'bademail' phrase, but if you'd rather have a special error messages for "too many dots" you can create a phrase and use the varname in place of 'bademail'.

Special thanks to kh99 who provided this solution.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024