Difference between revisions of "TNG captcha"

From Genwiki

Jump to: navigation, search
(I'm still getting registration spam!)
Line 92: Line 92:
  
 
If you have successfully installed the captcha on the registration form, but are still receiving registration spam, read on.  Your site may have been discovered by a spambot that already understands how our TNG sites operate, or one that is continuing to target your site because it has already learned how to spam your site before you installed your captcha.  The following simple steps will defeat this learned spambot behaviour.
 
If you have successfully installed the captcha on the registration form, but are still receiving registration spam, read on.  Your site may have been discovered by a spambot that already understands how our TNG sites operate, or one that is continuing to target your site because it has already learned how to spam your site before you installed your captcha.  The following simple steps will defeat this learned spambot behaviour.
* rename the addnewacct.php script in your TNG base directory to another name
+
* rename the addnewacct.php file to something else (such as nospamnewacct.php)
** do NOT leave a copy with the original name in the directory
+
** find your local copy of the "addnewacct.php" file
* edit the newacctform.php script and edit the line
+
** copy it to the new name such as "nospamnewacct.php"
** $formstr = getFORM( "addnewacct", "post", "form1", "" );
+
** place the "nospamnewacct.php" file into your TNG main folder  (probably using your ftp program)
** and change the "addnewacct" to the new name you chose for the file (leave the .php off in this line)
+
** do NOT leave a copy of "addnewacct.php" in your TNG folder  (remove the file using your ftp program)
* ensure the editted version of newacctform.php is in your base TNG folder
+
* open your local copy of "newacctform.php" with your favourite editor (example: wordpad)
 
+
** find the line "$formstr = getFORM( "addnewacct", "post", "form1", "" );"
 
+
** change the "addnewacct" to the new name you chose for the file   ("nospamnewacct", leave the .php off in this line)
 +
** save the changes
 +
* place the modified "newacctform.php" in your TNG main folder   (probably using your ftp program)
  
 
=='''In the event of a problem with your TNG site'''==
 
=='''In the event of a problem with your TNG site'''==

Revision as of 08:13, 30 July 2006

If you are not comfortable with html and php editing, this page may not be for you


Overview

This TNG modification provides a CAPTCHA for the TNG "New User Registration" form and/or the TNG "Suggest" form. It will provide a user challenge screen before the form will be made available.

This implementation is based upon PureMango's code version 1.41. Check the link for a demo of how it works. The original package from PureMango contains an additional php wrapper file that provides the demo example.

A TNG example of this implementation may be tested here - demo


Rev 3 Jul 26, 2006 - Rewritten as a single line modification of the TNG files. Multi-language support including: English, French, Spanish, and Dutch. This version requires only a single line change to the original TNG files allowing for easy migration to the next TNG version.
Rev 3.1 Jul 27, 2006 - Updates to the Dutch language file. (I used an on-line translation service for 2 phrases, thanks to Martien for quickly correcting my errors.) (If you've already installed version 3, you may retrieve the single translation file update here.)
Rev 3.3 Jul 28, 2006 - Updates to the French and Spanish language file. (I used an on-line translation service for 2 phrases, thanks to Francis for providing proper correcting my errors.) (If you've already installed version 3, you may retrieve the single translation file update here.)


Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG files
    • newacctform.php
    • suggest.php
    • the text.php file for each of your supported languages (found in the language folders such as ./English or ./French)


Side Effects

  1. As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod. However, it is only a single line addition to each of the files.
    • Darrin's TNG version 6.0 will include a "hook" for this captcha, so the upgrade changes may be very minimal if any.
  2. The captcha graphics can be difficult to read for the visually impaired. Although a reload button has been included to allow users to request alternate graphics, they may not be able to gain access to your captcha protected forms.


TNG Modifications

The following zip file contains the necessary files to allow the addition of this feature.

  • The zip file TNG_captcha_Rev_3.2.zip contains:
    • the "freecap" fonts, backgrounds, dictionary, and freecap.php file
    • newacctform.php - a modified TNG 5.1.4 file
    • suggest.php - a modified TNG 5.1.4 file
    • TNG_captcha.php - the TNG captcha wrapper
    • captcha_text_english.php - alternate language version
    • captcha_text_french.php - alternate language version
    • captcha_text_spanish.php - alternate language version
    • captcha_text_dutch.php - alternate language version


  • IF you are running v 5.1.4 then

If you have previously modified your TNG newacctform.php or suggest.php file, do not continue. You WILL lose any changes to that file you have previously made.

  1. backup your existing TNG v5.1.4 newacctform.php and suggest.php file
  2. download this zip (TNG_captcha_Rev_3.2.zip)
  3. unzip it, examine the contents
  4. create a "freecap" folder in the main TNG folder
    • make sure it is readable and executable by all
  5. copy all the ".ht****" files and the freecap.php file to the new "freecap" folder
    • ensure they are all readable
    • MAC users - please note that the .ht*** files are reported to be hidden files and may not be visible. The program "Transfer" has been recommended to assist with this.
  6. copy your desired language files to your language folders.
    • for example, copy the captch_text_english.php to the ./English folder
  7. for each supported language, edit the text.php file in the language folder and add an include line at the second to last line, just before the "?>"
    • add the line @include("captcha_text_english.php");
    • or if adding it in the french language folder @include("captcha_text_french.php");
  8. copy the TNG_captcha.php file to the base TNG folder
  9. copy the newacctform.php and/or the suggest.php file to your base TNG folder. This should replace an existing TNG file of the same name
  10. check it out


  • IF you are NOT running v5.1.4 or you HAVE made changes to either of the above files then, you must add the single include line to the newacctform.php or suggest.php file on your own. Follow the instructions above, except edit the newacctform.php and/or the suggest.php files, do not copy them.
  • use the sample newacctform.php and suggest.php files as examples.
    • in newacctform.php, examine the "include" at line 44
    • in suggest.php, examine the "include" at line 111
  • edit your version of each of these files to add the include at the appropriate line


Customizations

The captcha provided in the original puremango package has been included as is. If you wish to experiment with some of the options, please review the freecap.php script in the freecap folder. It includes a description of the code, the possible options, and locations to find alternate fonts and suggestions on background image creation.


I'm still getting registration spam!

If you have successfully installed the captcha on the registration form, but are still receiving registration spam, read on. Your site may have been discovered by a spambot that already understands how our TNG sites operate, or one that is continuing to target your site because it has already learned how to spam your site before you installed your captcha. The following simple steps will defeat this learned spambot behaviour.

  • rename the addnewacct.php file to something else (such as nospamnewacct.php)
    • find your local copy of the "addnewacct.php" file
    • copy it to the new name such as "nospamnewacct.php"
    • place the "nospamnewacct.php" file into your TNG main folder (probably using your ftp program)
    • do NOT leave a copy of "addnewacct.php" in your TNG folder (remove the file using your ftp program)
  • open your local copy of "newacctform.php" with your favourite editor (example: wordpad)
    • find the line "$formstr = getFORM( "addnewacct", "post", "form1", "" );"
    • change the "addnewacct" to the new name you chose for the file ("nospamnewacct", leave the .php off in this line)
    • save the changes
  • place the modified "newacctform.php" in your TNG main folder (probably using your ftp program)

In the event of a problem with your TNG site

  1. copy your backup newacctform.php and/or suggest.php to your base TNG folder
  2. copy your language text.php files back to their language folders
    • all should be well now
  3. you may also delete the "freecap" folder and files, TNG_captcha.php, and the captcha language support files


Support

  1. You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
    • Please post suggestions, or your own flavour of this mod to the forum or list


Acknowledgments

A big thanks goes out to all those TNG users in the TNGuser list that contributed to the discussion regarding the use of a Captcha in TNG

  • A special thanks goes out to Francis Amar who provided the French and Spanish translations.
  • A special thanks goes out to Martien van Balgooi who provided the Dutch translations.
  • Thanks to Darrin for suggesting to create a single line include version in preparation for TNG v6.
Personal tools