MyBB Community Forums

Full Version: (Solved) Block / Ban user by specific profile data entered on sign up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I run a minecraft forum / server and I keep getting spam all the time. I have various anti-spam systems in place but non of them stop the spammers.

I have a custom profile field on my forum "Minecraft IGN" which is mandatory to fill in on sign up and recently I have noticed that the spam bots always put "website" as the answer.

So I was wondering if it was possible for someone to make me a plugin that bans the user after signup which puts "website" as the answer to Minecraft IGN.

Or even if someone was to show me how to do it myself, I have some experience in PHP

Thank you in advance.
Identify your custom profile field's fid.
Say it is fid3. Change in the following codes accordingly with the real one.

Now open:
inc/datahandlers/user.php
go to line no. nearabout 993 and find this code line:
$user = &$this->data;
Add just after that:
$user['usergroup'] = $user['profile_fields']['fid3'] == "website" ? 7 : $user['usergroup'];
^^ 7 is the default banned group id. Change it if you have custom banned group.

Save the file.
I guess thats all and entering "website" on that custom field the user will be registered under banned group.
(2013-12-28, 11:10 AM)effone Wrote: [ -> ]Identify your custom profile field's fid.
Say it is fid3. Change in the following codes accordingly with the real one.

Now open:
inc/datahandlers/user.php
go to line no. nearabout 993 and find this code line:
$user = &$this->data;
Add just after that:
$user['usergroup'] = $user['profile_fields']['fid3'] == "website" ? 7 : $user['usergroup'];
^^ 7 is the default banned group id. Change it if you have custom banned group.

Save the file.
I guess thats all and entering "website" on that custom field the user will be registered under banned group.

Thank you very much, that worked perfectly!

The war on spam is in my favour for now Smile