[BETA] Anti-spam bots registration

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

I started working on the ACP Version(I will update you guys later on once I get further). :mrgreen:

I made a few changes to the current version...this is what I would have it as if this was mine...

Code: Select all

##############################################################
## MOD Title: Anti-spam bots registration
## MOD Author: niekas, artesea, cyberCrank, Lord Raiden, RevJim, DJ Andre, Ramon Fincken
##
## MOD Description: prevents spam bots registering on your forum by
##       removing website and signature fields in registration and profile form
##       until users reached certain amount of posts and sends an email notification
##       to learn IP address and more
## MOD Version: 0.0.1 (BETA)
##
## Installation Level: (Easy)
## Installation Time: ~2 minutes
## Files To Edit:
##               includes/usercp_register.php
##               templates/subSilver/profile_add_body.tpl
## Included Files: (n/a)
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/phpBB/viewtopic.php?p=2166870 for the
## latest version of this MOD BETA. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
##
## Author Notes:
##     + installable with EasyMOD
##      + Edit the e-mail address variable if you want to receive notification for spam bot registration attempts.
##
##############################################################
##
## MOD History:
##    2006-06-05 - Version 0.0.1
##   + Misc. code cleanup to make implementation easier.
##   + Version numbering changed in accordance with forum rules. For version numbering information, see: http://www.phpbb.com/phpBB/viewtopic.php?t=266307
##    2006-05-20 - Version 0.0.0
##   + For all previous revisions, see http://www.phpbb.com/phpBB/viewtopic.php?t=186683
##         This MOD started with a different design and has been modified to meet current phpBB MOD guidelines and EasyMOD templating.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$error = FALSE;

#
#-----[ AFTER, ADD ]------------------------------------------
#
#   NOTE - be sure to add your email address in this area (below):
#
#    $myEmailAddress = "YOUR-EMAIL@YOUR-DOMAIN";
#

// Start Anti-Spam Lite MOD
$cut_off=10; //how many posts should user have before form fields are activated

// ---------------------------------------
if ( ($mode == 'register') || ( ($userdata['user_posts'] < $cut_off) && ($mode=='editprofile') ) )
{
	if ( ($HTTP_POST_VARS['website'] != '') || ($HTTP_POST_VARS['signature'] != '') )
	{
		$myEmailAddress = "YOUR-EMAIL@YOUR-DOMAIN"; // Edit this with your proper e-mail address.
		//**********
		// If you DO NOT wish to receive e-mail notifications of spam bot registration attempts, delete all of the code between the lines of asterisks.

		$spammerIPAddress = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
		$spammerUsername     = $HTTP_POST_VARS['username'];
		$spammerEmailAddress = $HTTP_POST_VARS['email'];
		$spammerWebsite      = $HTTP_POST_VARS['website'];
		$spammerSignature    = $HTTP_POST_VARS['signature'];
		$spammerPassword     = $HTTP_POST_VARS['new_password'];
		$emailSubject   = "Notification of Spam Bot Attempt";
		$emailHeader    = "From: Spam-Bot-Mod";
		$emailMessage   = "Spam Bot Registration Attempted.\n\n";
		$emailMessage  .= "Spammer's IP Address = "     . $spammerIPAddress    . "\n";
		$emailMessage  .= "IP Lookup = http://www.nwtools.com/default.asp?prog=express&host=" . $spammerIPAddress . "\n";
		$emailMessage  .= "Spammer's Username = "       . $spammerUsername     . "\n";
		$emailMessage  .= "Spammer's Password = "       . $spammerPassword     . "\n";
		$emailMessage  .= "Spammer's email address = "  . $spammerEmailAddress . "\n";
		$emailMessage  .= "Spammer's Webpage URL = "    . $spammerWebsite      . "\n";
		$emailMessage  .= "Spammer's Signature Line = " . $spammerSignature    . "\n";
		mail($myEmailAddress, $emailSubject, $emailMessage, $emailHeader);

		//**********
		
		message_die(GENERAL_MESSAGE, "You are not authorized to use this feature. Please send e-mail to " . $myEmailAddress . " for more information.", '', __LINE__, __FILE__);
	}
}
// End Anti-Spam Lite MOD

#
#-----[ FIND ]------------------------------------------
#

if ( $mode == 'editprofile' )
   {
      $template->assign_block_vars('switch_edit_profile', array());
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#

// Start Anti-Spam Lite MOD
if ( $mode == 'editprofile' )
{
	$template->assign_block_vars('switch_edit_profile', array());
	if ($userdata['user_posts'] >= $cut_off)
	{
		$template->assign_block_vars('switch_edit_website', array());
		$template->assign_block_vars('switch_edit_signature', array());
	}
}
// End Anti-Spam Lite MOD

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#

   <tr>
     <td class="row1"><span class="gen">{L_WEBSITE}:</span></td>
     <td class="row2">
      <input type="text" class="post" style="width: 200px"  name="website" size="25" maxlength="255" value="{WEBSITE}" />

     </td>
   </tr>

#
#-----[ REPLACE WITH ]------------------------------------------
#

<!-- BEGIN switch_edit_website -->
   <tr>
     <td class="row1"><span class="gen">{L_WEBSITE}:</span></td>
     <td class="row2">
      <input type="text" class="post" style="width: 200px"  name="website" size="25" maxlength="255" value="{WEBSITE}" />

     </td>
   </tr>
<!-- END switch_edit_website -->

#
#-----[ FIND ]------------------------------------------
#

   <tr>
     <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2">
      <textarea name="signature" style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>

     </td>
   </tr>

#
#-----[ REPLACE WITH ]------------------------------------------
#

<!-- BEGIN switch_edit_signature -->
   <tr>
     <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2">
      <textarea name="signature" style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>

     </td>
   </tr>
<!-- END switch_edit_signature -->

#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------------
#
# EoM
What do you think of that for the 'Lite' version? :D

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

Ok, I have been working on the ACP version...and I could use a bit of help. I don't have a mail server installed so I can't send out emails with php. And I don't know if I messed anything up while I was changing it...

Could one of you guys with a mail server installed try it out for me(not on a live board)?

I started the DEV thread here if you are interested:
http://www.phpbb.com/phpBB/viewtopic.php?p=2180424

gtkuntz
Registered User
Posts: 21
Joined: Thu Mar 09, 2006 2:58 pm

Post by gtkuntz »

All I can say about this mod is :

Thank You
Thank You
Thank You


A VERY easy change.

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

Update you guys on the ACP Version. Its now in Beta stages, and I am getting close to submitting it. If you have any extra ideas or want to see how it is coming, there is a thread here:
http://www.phpbb.com/phpBB/viewtopic.php?p=2180424

8)

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Post by computersOC »

Hello, can you make it compatible with this mod:
Signatures control 1.2.4
http://www.golfexpert.net/phpbb/mods/si ... .2.4em.zip

The problem is in profile_add_body.tpl

Thanks!
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

spufus
Registered User
Posts: 5
Joined: Mon Mar 20, 2006 8:02 pm

Post by spufus »

Hi folks,

A bit of a poor question I'm afraid.

I cannot find this text

if ( $mode == 'editprofile' )
{
$template->assign_block_vars('switch_edit_profile', array());
}

in the /includes/usercp_confirm.php file

Everything else is fine.

Any ideas?

Thanks

callumw
Registered User
Posts: 22
Joined: Sat Dec 06, 2003 5:27 pm
Location: Somewhere in the ether ...
Contact:

Post by callumw »

It's in the usercp_register.php file

Line 965 to be exact

spufus
Registered User
Posts: 5
Joined: Mon Mar 20, 2006 8:02 pm

Post by spufus »

callumw wrote: It's in the usercp_register.php file

Line 965 to be exact


Oops - sorry!

An error on my part.

It's not in the usercp_register.php either?

Thanks

callumw
Registered User
Posts: 22
Joined: Sat Dec 06, 2003 5:27 pm
Location: Somewhere in the ether ...
Contact:

Post by callumw »

yes it is

search for
template->assign_block_vars('switch_edit_profile', array())

and make sure you have no extra spaces or it won't find it

spufus
Registered User
Posts: 5
Joined: Mon Mar 20, 2006 8:02 pm

Post by spufus »

callumw wrote: yes it is

search for
template->assign_block_vars('switch_edit_profile', array())

and make sure you have no extra spaces or it won't find it


That didn't work either!

I have it now, thanks to your help.

The HTML is inset, which seems to mess up the find function in Cute.

I removed the tabs and all was sweet!!

Thanks for the help matey!

callumw
Registered User
Posts: 22
Joined: Sat Dec 06, 2003 5:27 pm
Location: Somewhere in the ether ...
Contact:

Post by callumw »

8)

anniemacbee
Registered User
Posts: 3
Joined: Mon Jun 19, 2006 6:52 am

More thanks

Post by anniemacbee »

I just want to add my vote of thanks to those who worked on getting this mod working to perfection!! Thank you, thank you!!!

eggmceye
Registered User
Posts: 4
Joined: Mon Jun 19, 2006 10:15 am
Contact:

Post by eggmceye »

EXreaction wrote: What do you think of that for the 'Lite' version? :D


I registered just to say thanks for this - I deleted 400 spam bot accounts today and this mod is just what my forum needs.

Yospeck
Registered User
Posts: 7
Joined: Mon Jun 19, 2006 11:47 am

Post by Yospeck »

This is exactly the kind of thing I need, spent today looking through the forums trying to get my head around this all.......... still working on it :) I'm the forum admin of two independant forums, and both have recently started getting targetted by spamBOTs, and I figure this is the kind of MOD I need.

One problem.


I don't actually know how to install MODs. I've looked through a number of the guides here and I'm no less in the dark. I've managed to install Easymod and have no problems uploading files through my FTP, so I figure I'm halfway there.

The

Code: Select all

 listed, I have no idea where I put that. Read that I need to edit the /includes/usercp_register.php from the other original MOD link. Does this mean I edit the .php file (Dreamweaver?) and copy/paste all of whats in the [code].

Yes I'm n00b :D But if its explained I should have no problems.

Thank ye kindly.

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

Yospeck wrote: I don't actually know how to install MODs. I've looked through a number of the guides here and I'm no less in the dark. I've managed to install Easymod and have no problems uploading files through my FTP, so I figure I'm halfway there.

The

Code: Select all

 listed, I have no idea where I put that. Read that I need to edit the /includes/usercp_register.php from the other original MOD link. Does this mean I edit the .php file (Dreamweaver?) and copy/paste all of whats in the [code].

Yes I'm n00b :D But if its explained I should have no problems.

Thank ye kindly.
[/quote] 

If you use easymod you shouldn't have to manually modify anything. ;)

You do whaterver it tells you...Open the file, find what it tells you to, and than do whatever it tells you(like after add, etc).

If you don't understand, read this.
http://www.phpbb.com/kb/article.php?article_id=150

Post Reply

Return to “[2.0.x] MODs in Development”