Ban all gmail "multiple dot" users

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26828
Joined: Fri Aug 29, 2008 9:49 am

Re: Ban all gmail "multiple dot" users

Post by Mick »

vatreni wrote: Tue Apr 09, 2024 11:54 amhave added a couple of questions to my Q&As
As has already been said, use only one Q&A, if you have more than one and one gets beaten you won’t know which one it was and you’ll have to change all of them.
vatreni wrote: Tue Apr 09, 2024 11:54 amthey are of the type "what colour”
Bots know all the colours and will guess them eventually.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
HB
Registered User
Posts: 230
Joined: Mon May 16, 2005 9:30 pm

Re: Ban all gmail "multiple dot" users

Post by HB »

I'm a fan of the Sortables Captcha. But I was curious if there were any "gmail dupes" in my forum, so I wrote this script:

Code: Select all

<?php

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx); 

global $db, $auth, $user, $auth;

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

$sql = "SELECT username, user_id, user_email, user_posts FROM " . USERS_TABLE . " WHERE user_email LIKE '%gmail.com'";
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

$gmails = array();
foreach ($rows as $row) {
    $gmail = str_replace('gmail.com', '', $row['user_email']);
    $gmail = str_replace('.', '', $gmail);
    
    if (array_key_exists($gmail, $gmails)) {
        $gmails[$gmail][] = $row;
    } else {
        $gmails[$gmail] = array($row);
    }
}

foreach ($gmails as $gmail => $dupes) {
    if (count($dupes) > 1) {
        foreach ($dupes as $row) {
            echo "Found duplicate ${row['user_email']} for user ${row['username']} (${row['user_id']}) posts: ${row['user_posts']} <br>";
        }
        echo "<br>";
    }
}

?>
There were 5 matches out of ~34K members. All of them appeared to be innocent cases of someone forgetting their login and creating a new one.
Dan Kehn
vatreni
Registered User
Posts: 39
Joined: Sat Jul 16, 2022 1:07 pm

Re: Ban all gmail "multiple dot" users

Post by vatreni »

Interesting, thanks

Following Mick's advice I have reduced to 1 Q&A and still no spam sign ups

Return to “[3.3.x] Support Forum”