UBB.Dev
Posted By: Gizmo [7.5.7+] Stop Forum Spam - Login Detection - 12/02/2013 7:00 AM
Author: Gizmo/Gremelin (James of VNC Web Services)

Requirements:
Valid UBB.Threads 7.5.7 install and license (note, this will run on previous builds, but you'll need to apply the Stop Forum Spam modification beforehand).

About:
It occoured to me one night, while working on a client site, that spammers weren't just the "drive by" variety anymore (whereby they sign up, spam, and go on); in today's world we see an increasing number of "sleeper" spammers (whereby someone registers, they wait a while, and then spam). It hit me that when they register, they're a legit "no spam" user in spam databases, but when they begin their trouble they already have bypassed registration checks through any multitude of software packages.

I then decided to revisit my original Stop Forum Spam modification and look at the template mod for the registration check and apply the settings to the UBB.Threads login screen; as, since they're already registered and seemingly "legit", the login check would validate them every time they attempt to login; thus if they're now listed as a spammer, they can't login and, well, spam.


NOTE: If you're having problems with API timeouts ("Unable to Connect to Stop Forum Spam Database" error) you can adjust the API URL in login.tpl to use:
Code
	$xml_string = @file_get_contents("http://api.stopforumspam.org/api?ip=". $_SERVER["REMOTE_ADDR"]);

Versus the default:
Code
	$xml_string = @file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["REMOTE_ADDR"]);



In languages/english/stop_forum_spam.php:
Find:
Code
$ubbt_lang['SFS_DETECTED_INFO_1'] = "At this time your registration can not be continued.  Your IP address has been flagged as that of a known spammer/spambot via the ";

Add Above::
Code
$ubbt_lang['SFS_DETECTEDLOGIN_INFO_1'] = "At this time your login can not be continued.  Your IP address has been flagged as that of a known spammer/spambot via the ";

In scripts/login.inc.php:
Find:
Code
"wordlets" => array("login"),

Replace With:
Code
"wordlets" => array("login","stop_forum_spam"),

In templates/default/login.tpl:
Find:
Code
{* Script Version 7.5.8 *}

Add Below:
Code
{php}
$xml_string = @file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["REMOTE_ADDR"]);
if($xml_string != false) {
$xml = new SimpleXMLElement($xml_string);

if ($xml->appears == 'yes') {
{/php}
{$tbopen}
<tr>
<td class="tdheader" colspan="2">
{$lang.SFS_DETECTED}
</td>
</tr>
<tr>
<td colspan="2" class="alt-2">
{$lang.SFS_DETECTEDLOGIN_INFO_1}
<a href="http://stopforumspam.com/ipcheck/{$smarty.server.REMOTE_ADDR}" target="_blank">Stop Forum Spam</a>
{$lang.SFS_DETECTED_INFO_2}

<br /><br />
Powered by the <a href="http://www.virtualnightclub.net/" target="_blank">VNC Web Services</a> <a href="http://www.stopforumspam.com/" target="_blank">Stop Forum Spam</a> addon for <a href="http://www.ubbcentral.com/" target="_blank">UBB.threads</a>.
</td>
</tr>
{$tbclose}

{php}
} else {
{/php}

Find:
Code
</form>

Add Below:
Code
{php} } } else { {/php}
{$tbopen}
<tr>
<td class="tdheader" colspan="2">
{$lang.SFS_ERROR_TITLE}
</td>
</tr>
<tr>
<td colspan="2" class="alt-2">
{$lang.SFS_ERROR_CONNECTION}

<br /><br />
Powered by the <a href="http://www.virtualnightclub.net/" target="_blank">VNC Web Services</a> <a href="http://www.stopforumspam.com/" target="_blank">Stop Forum Spam</a> addon for <a href="http://www.ubbcentral.com/" target="_blank">UBB.threads</a>.
</td>
</tr>
{$tbclose}
{php} } {/php}

Please leave your thanks below so we can know that we've helped you!
Posted By: Bill B Re: [7.5.7+] Stop Forum Spam - Login Detection - 12/02/2013 11:57 AM
I think that this is a great addition. I'm a little slow to pull-the-trigger however as I think my way through this.

Example: I get a note from a user that they can't log in. (and I DO receive 3 or 4 of these a week.) They've been a user for umpteen years. My normal routine is to change their password and send them their Login Name to see if they're using the right one.

Now, with this UPGRADE in place, there is a chance that a LEGIT user could accidentally be included in the NO SPAM list. And now, I'm chasing my tail trying to figure out WHY this legit user can't log in.

Soooooo... what might be a good way for ADMIN to know WHY a person is being denied a login due to this new feature?
Posted By: Gizmo Re: [7.5.7+] Stop Forum Spam - Login Detection - 12/02/2013 12:02 PM
Well, they'll only be "locked out" if they show in the Stop Forum Spam database; and to be IN that database, they'd have to be reported as a spammer by several sites...

And IF they're banned BECAUSE they're in the DB, there is an obvious message posted to the screen as well as instructions on how to get themselves delisted...
Posted By: Bill B Re: [7.5.7+] Stop Forum Spam - Login Detection - 12/02/2013 12:30 PM
Thanks... I vaguely remember that they saw a screen but I didn't know how to confirm that. And of course, I've never seen one.

Now... all I need is to hope that they TELL me about the screen message which banned them. Ha.
Couple things as I am trying to add the mod:

Looks like the coding for "In languages/english/stop_forum_spam.php:" you have a missing "[" just before /code causing issue for us to read properly.

What file do we need to find '{* Script Version 7.5.8 *}' as I found 131 occurrence and not readily apparent to me?
Posted By: Gizmo Re: [7.5.7+] Stop Forum Spam - Login Detection - 03/28/2014 3:51 AM
It's been updated; the local copy had it in, not sure why the posted didn't lol.
thanks
Posted By: Reboot Re: [7.5.7+] Stop Forum Spam - Login Detection - 05/02/2014 5:26 AM
Has this been incorporated into 7.5.8?

Thx
Posted By: Gizmo Re: [7.5.7+] Stop Forum Spam - Login Detection - 05/02/2014 12:26 PM
No, this is separate from what's included in 7.5.8
Will it work in 7.5.8 ?
Posted By: Gizmo Re: [7.5.7+] Stop Forum Spam - Login Detection - 07/05/2014 3:23 AM
Yes, works with 7.5.7 and onward.
Thanks G

smile
Maybe I missed something, but is there anyway to validate what registrations or login/posts have been Blocked by SFS?

Even without that option it is still a great feature.
Posted By: Gizmo Re: [7.5.7+] Stop Forum Spam - Login Detection - 08/01/2015 12:01 PM
While logged in at Stop Forum Spam you can go to the My Spammers page to get a log of what usernames where utilized and when you submitted them back to the database. There are also submission graphs on the User Stats page.
© UBB.Developers