Disable error logging for banned users

Started by Mr Robville, March 06, 2014, 05:33:51 PM

Previous topic - Next topic

Mr Robville

This question is a bit similar to what I've asked before, but this is generally related to disabling ban errors.
I've noticed that a certain range of IP's who are spambots are browsing my forum and occasionally try to register. While the security mods have stopped all attempts so far, I thought it would be best to keep the bots away from the fence by banning the whole IP range. However, this results in quite a few errors due to spambots that receive the "Sorry guest, you are banned" error.

I actively use the error log for any mods or other functions, but I could not care less for any errors that banned bots/users receive. Whenever I ban someone/something, I don't want anything to do with it anymore. Not even knowing about their login attempts.

Is there an easy way of disabling the ban-related errors from the error log?
I found this topic somewhere else:
https://github.com/Arantor/SMF2.1/commit/d6c4f4eb8243177afcd27322976438108f42102e
But I got stuck at the mySQL part.
"What goes on the internet, stays on the internet"
...Except your forum database if you forget to back it up.

Kindred

don't use the smf ban system for things like that.

If you plan to ban IP ranges (whcih is a bad idea, for most sites, given the temporary nature of most IPs) then you should be doing so from your htaccess file, not from smf bans -- because smf bans eat up resources.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

That MODification by Arantor is a lot more generic because it allows to choose whether or not to log those.
For you to NOT log those, you should just need to adjust this line:


// You banned, sucka!
fatal_error(sprintf($txt['your_ban'], $old_name) . (empty($_SESSION['ban']['cannot_access']['reason']) ? '' : '<br />' . $_SESSION['ban']['cannot_access']['reason']) . '<br />' . (!empty($_SESSION['ban']['expire_time']) ? sprintf($txt['your_ban_expires'], timeformat($_SESSION['ban']['expire_time'], false)) : $txt['your_ban_expires_never']), 'user');

And replace that 'user' at the end, with "false" (no quotes)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Mr Robville

Thanks a lot! I shall change the line of code and see if I can set the IP blocking through DirectAdmin. I haven't been able to figure out how to do so yet.
"What goes on the internet, stays on the internet"
...Except your forum database if you forget to back it up.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: