Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

modcaptcha plugin

Excerpt

modCaptcha is a FarCry plugin that adds a formtool field using the LylaCaptcha

ColdFusion

component for captcha validation. The formtool is attached to a boolean property in your content type.

Thanks to Peter J. Farrell et al for the captcha code.

Tip

modCaptacha was written by Geoff Bowers, Daemon for personal use. The code is released under Apache License 2.0. modCaptcha requires a minimum of FarCry Core 4.04

Note

Raise issues and the like at the modCaptcha Project Home

Download

You may check out a read-only working copy anonymously over HTTP:
svn checkout http://modcaptcha.googlecode.com/svn/trunk/ modcaptcha

Installation

Copy all the modCaptcha plugin files to the plugin directory:

Code Block
./farcry/plugins/modcaptha/*

Add modCaptcha to your plugin list in the farcryinit tag of your project's Application.cfm:

Code Block
title./www/Application.cfm

<farcry:farcryInit 
  name="daemon" 
  dbType="mssql" 
  plugins="farcrycms,modCaptcha,googleMaps" />

You will also need to add a web virtual pointing to the plugin webroot called /modcaptcha:

Code Block
./plugins/modcaptcha/www --> /modcaptcha

(Alternatively you can copy the files in ./plugins/modcaptcha/www to a subdirectory called ./modcaptcha within the webroot of your project.)

Then simply reinitialise your application to make the formtool available.

How do I implement the captcha?

The formtool is used just the same as any of the formtools you may be familiar with in v4.0 – just create a boolean property and set the fttype="lylacaptcha". The captcha should be automatically created and managed.

Review the following sample code from the Daemonite blog

Code Block
title./packages/types/farBlogComment

<cfcomponent extends="farcry.core.packages.types.types" name="blogcomment" displayname="Blog Comment" hint="blog comment">

<cfproperty name="subject" type="string" hint="Subject of comment." required="no" default="" blabel="true" ftlabel="Subject" ftvalidation="required" />
<cfproperty name="description" type="longchar" hint="Comment description." required="no" default="" ftlabel="Description" />
<cfproperty name="commenthandle" type="string" hint="Name or handle of poster." required="no" default="" ftlabel="Name" />
<cfproperty name="email" type="string" hint="Email address of poster." required="no" default="" ftlabel="Email" ftvalidation="validate-email" />
<cfproperty name="website" type="string" hint="Website address of poster." required="no" default="" fttype="url" ftlabel="Website" />
<cfproperty name="parentid" type="uuid" hint="Parent content object reference." required="no" ftjoin="farblogpost" ftlabel="Parent Blog Post" />

<!--- implement modCaptcha --->
<cfproperty name="bCaptcha" type="boolean" hint="Flag for lylacaptcha." default="0" required="no" fttype="lylacaptcha" ftlabel="Captcha" />

</cfcomponent>