Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2303

[3.3.x] Support Forum • Re: Ban all gmail "multiple dot" users

$
0
0
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:

<?php// standard hack preventdefine('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.

Statistics: Posted by HB — Sun Apr 14, 2024 5:49 pm



Viewing all articles
Browse latest Browse all 2303

Trending Articles