Geeklog CAPTCHA Plugin Installation and Usage

# Geeklog CAPTCHA plugin - version 3.0.0

### Author: Mark R. Evans <mark@gllabs.org>

### Date: June 22, 2007

CAPTCHA v3.0 requires Geeklog v1.4.1 or higher.
With Geeklog v1.4.1, there is full support built into Geeklog to support the CAPTCHA plugin with the following Geeklog features:

- New User Registration
- Comments
- Email User
- Email Story
- Story submission
- Ability to force CAPTCHA for all remote users

Beginning with Forum v2.6, there is full support built into the Forum plugin to support the CAPTCHA plugin with forum posts.
Beginning with Media Gallery v1.5.0, there is full support build into Media Gallery to support the CAPTCHA plugin when sending electronic Postcards.

# Overview

CAPTCHA is a native Geeklog plugin that provides an additional layer of security for spambots.
A CAPTCHA (an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart", trademarked by Carnegie Mellon University) is a type of challenge-response test used in computing to determine whether or not the user is human. By presenting a difficult to read graphic of letters and numbers, it is assumed that only a human could read and enter the characters properly. By implementing the CAPTCHA test, it should help reduce the number of Spambot entries on your site.
CAPTCHA implementations are not full-proof, there are many methods to bypass them. Although I have not seen any successful attempts to bypass this implementation, it should only be used to provide another layer of protection to your site. With a layered approach using the Bad Behavior Plugin, SpamX Plugin, SLV Enhancement and the CAPTCHA plugin, together these can provide a very secure Geeklog implementation.
Beginning with Geeklog v1.4.1 there is support built into Geeklog to natively provide a CAPTCHA block for new user registrations, comment submissions, email user, email story and story submissions.

# Geeklog CAPTCHA Plugin Installation

The CAPTCHA Plugin follows the standard Geeklog plugins procedure, which has not been well documented. Below we will document two methods to install the Media Gallery files, via FTP and via standard shell access to the server.

### FTP Installation

If you do not have shell access to your server and can only use an FTP client to access your server, follow these instructions. If you have shell access to your server, you may want to jump down to the Shell Access Installation instructions below.

To install CAPTCHA, or any Geeklog plugin, you will need to un-archive the plugin on your local computer. The CAPTCHA distribution will automatically create all the proper directories when it is un-archived.

To un-archive a .gz file, you can use later copies of WinZIP or WinRAR.

1. Create a temporary directory on your local hard drive to hold the Media Gallery files (let's use C:\tmp for our example).
2. Open the captcha-3.0.0-1.4.1.tar.gz file with WinRAR.
3. Select Extract All Files and point to the C:\tmp directory as the destination.

Now we should have a local copy of the CAPTCHA Plugin in C:\tmp

The directory should look like this:

    +tmp\
     + admin\
     + docs\
     + language\
     + public_html\
     + templates\
     + functions.inc

Now that you have a copy on your local hard drive, it is time to FTP up to your server.

Start your FTP program, I recommend FileZilla if you do not have a program you use already. FileZilla is free and supports many different operating systems (Windows, Linux, etc.).

Connect to your web server with your FTP program.

Our first FTP will be the entire CAPTCHA distribution to your server. You will want to use the diagrams below to find the proper directory on your server and move the entire c:\tmp\captcha\ directory to the path-to-geeklog/plugins/ directory.

To find the path-to-geeklog you can look in your Geeklog config.php file and see what directory is defined in the $_CONF[‘path’] line.

SPECIAL NOTE: For the initial FTP of the CAPTCHA distribution, you will want to actually drag the captcha folder from your local computer to the plugins directory on your server. The remaining FTP’s below you will actually drag the files, not the parent directory.

    tmp\                path-to-geeklog/
       |                               |
       + captcha\--+              + backups/
                   |              + data/
                   |              + include/
                   |              + language/
                   |              + logs/
                   |              + pdfs/
                   +------------->+ plugins/
                                  + public_html/
                                  + sql/
                                  + system/
                                  + config.php

Next, you will need to make a sub-directory under the public_html directory on your server called captcha. For most FTP programs you can create directories by highlighting the parent directory, public_html in this case, then right click the mouse, select New Folder and name it captcha. This procedure may be a little different depending on which FTP program you are using, check their documentation.

      path-to-geeklog/
                     |
                     + backups/
                     + data/
                     + include/
                     + language/
                     + logs/
                     + pdfs/
                     + plugins/
                     + public_html/
                                  |
                                  + captcha <--- Make this subdirectory
                     + sql/
                     + system/
                     + config.php

Next you will need to FTP all the files from the c:\tmp\captcha\public_html\* directory to your server. Here you will want to select all the files and sub-directories in the public_html\ directory, not just the public_html\ folder. Follow the diagram below:

    tmp\                 path-to-geeklog/
       |                                |
       + captcha\                  + backups/
                |                  + data/
                + public_html/*-+  + include/
                                |  + language/
                                |  + logs/
                                |  + pdfs/
                                |  + plugins/
                                |  + public_html/
                                |               |
                                +-------------->+ captcha/
                                   + sql/
                                   + system/
                                   + config.php

Next, you will need to make a sub-directory under the admin/plugins/ directory on your server called captcha.

    path-to-geeklog/
                   |
                   + backups/
                   + data/
                   + include/
                   + language/
                   + logs/
                   + pdfs/
                   + plugins/
                   + public_html/
                   |       |
                   |       + admin\
                   |           |
                   |           + plugins\
                   |                  + captcha <--- Make this subdirectory
                   + sql/
                   + system/
                   + config.php

Next you will need to FTP all the files from the c:\tmp\captcha\admin\* directory to your server. Here you will want to select all the files and sub-directories in the admin\ directory, not just the public_html\ folder. Follow the map below:

    tmp\            path-to-geeklog/
       |                           |
       + captcha\             + backups/
                |             + data/
                + admin/---+  + include/
                           |  + language/
                           |  + logs/
                           |  + pdfs/
                           |  + plugins/
                           |  + public_html/
                           |            + admin/
                           |                 + plugins/
                           +-----------------------> + captcha/
                              + sql/
                              + system/
                              + config.php

Congratulations! You should now have all the files uploaded to your server and you are ready to skin to the Online Installation step below.

### Standard Shell Access Installation

1. It is always a good ideas to perform a site backup. The CAPTCHA plugin does not create any database tables, but you should always make a backup prior to installing a plugin.
2. Uncompress the CAPTCHA plugin archive while in the path-to-geeklog/plugins directory. The archive will create a directory called captcha.
3. In your public_html directory, create a directory called captcha.
4. Under public_html/admin/plugins/ directory, create a directory called captcha.
5. Change to your path-to-geeklog/plugins/captcha directory.
6. Copy the files in the admin directory to the admin/plugins/captcha directory you created in step 4.
7. Copy the files in the public_html directory to the public_html/captcha directory you created in step 3.

### Online Installation

Now that you have the files loaded on your server, it is time to actually perform the CAPTCHA installation into Geeklog.

1. Go to the plugin administration page. The CAPTCHA plugin should show up with a link to install it. Click this link. The install page will tell you if it was successful or not. If not, examine the Geeklog error.log in path-to-geeklog/logs/ to see what the problem was. Fix the problem and re-install.
2. Be sure and modify the CAPTCHA config.php file to enable CAPTCHA support for the features you wish to use. By default, CAPTCHA is turned off for all items. See Configuration section below.

## Upgrade Process

Upgrading from v2.0 or later is very simple, just copy the new files over to your system per the directions above. Then enter Admins Only -> Plugins, select the CAPTCHA plugin, choose edit and upgrade.
After upgrading to v3.0.0, you will need to go into the online Administration Screens and update your CAPTCHA settings. Updates are no longer maintained in the config.php file.

### Upgrading from the original gl-cpatch custom registration

If you have the gl-captcha custom registration hack already installed, there is no need to upgrade to the CAPTCHA plugin unless you are running Geeklog v1.4.1+ or Forum 2.6+. The CAPTCHA plugin does not offer any new features unless you are running the latest Geeklog or Forum releases.
If you wish to upgrade, you will need to uninstall the existing gl-captcha hack before installing the plugin.
Follow these steps:

1. Disable Geeklog's custom registration (change $_CONF['custom_registration'] to equal false in Geeklog's config.php file.
2. Remove the public_html/captcha/ files and directory.
3. Remove the /captcha-images/ files and directory.
4. Remove the edits to lib-custom.php and memberdetail.thtml that you made to install the gl-captcha hack.

Keep in mind, you do not have to use Geeklog's custom registration to enable CAPTCHA if you are running Geeklog v1.4.1 or greater.