MyBB Community Forums

Full Version: PurgeSpammer a little too overzealous?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all

Our MyBB forum is being attacked by spammers every few days, unfortunately, and the PurgeSpammer function works great to remove all posts and ban the spammer in one click.

But it seems to also be banning valid IP addresses - IP addresses that I use to access the site!  Therefore, after purging the spammer, I find that I am banned until I unban banned IP addresses in ACP.

Is there a way to set up PurgeSpammer so that it doesn't ban IP addresses?  And if not, does anyone have a suggestion on a less heavy-handed method to remove spammers posts and block their accounts without banning IP addresses?

If you don't want to ban the user IP just open moderation.php and find this chunk of code near line 3054 and then delete / comment out:

				// Add the IP's to the banfilters
				foreach(array($user['regip'], $user['lastip']) as $ip)
					$ip = my_inet_ntop($db->unescape_binary($ip));
					$query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'");
					if($db->num_rows($query) == 0)
						$insert = array(
							"filter" => $db->escape_string($ip),
							"type" => 1,
							"dateline" => TIME_NOW
						$db->insert_query("banfilters", $insert);
extremely kind of you @effone, especially given your sentiment about bugs!  Smile
Just want to make sure, should I delete the whole thing that sir @effone showed? Thank you so much!
Quote:should I delete the whole thing that sir @effone showed?
(11-19-2018, 10:28 AM)mrdangem Wrote: [ -> ]Just want to make sure, should I delete the whole thing that sir @effone showed? Thank you so much!

Yes, but it's better to 'comment out' the entire portion that @effone stated.

I never delete code just in case it's needed in the future. 

I 'comment out' the code, then test it out, if it works, I move on leaving in the 'commented out' code. It doesn't hurt anything.

If it doesn't work, then I 'UNcomment out' the code and everything is "back to normal", so to speak. 

If you delete that code out and it doesn't work, then you have to re-do the code all over again. It can be a pain in the derriere.