TNG captcha

From Genwiki

Revision as of 20:13, 26 July 2006 by Admin (Talk | contribs)

Jump to: navigation, search

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.


Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG newacctform.php and suggest.php file, and the text.php file for each of your supported languages


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.
    • A French and Spanish translation has been provided courtesy of Francis Amar. (Francis may be contacted via the TNG user list).
    • A Dutch translation has been provided courtesy of Martien van Balgooi. (Martien may be contacted via the TNG user list).


TNG Modifications

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

  • The zip file TNG_captcha_Rev_3.zip contains:
    • the "freecap" fonts, backgrounds, dictionary, and freecap.php file
    • newacctform_captcha.php - a modified TNG 5.1.4 file
    • suggest_captcha.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.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


  • In the event of a problem with your TNG site
  1. copy your backup newacctform.php and/or suggest.php to your base TNG directory
    • all should be well now
  2. you may also delete the "freecap" folder and 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


Acknowledgements

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 translation.
  • Thanks to Darrin for suggesting to create a single line include version in preparation for TNG v6.