Overview
Tip |
---|
modCaptacha was written by Geoff Bowers, Daemon for personal use. The code is released under Apache License 2.0. |
modCaptcha is a FarCry ? plugin that adds a formtool field using the LylaCaptcha 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.
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 | ||
---|---|---|
| ||
<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 | ||
---|---|---|
| ||
<cfcomponent extends="farcry.core.packages.types.types" name="blogcomment" displayname="Blog Comment" hint="blog comment"> <cfproperty ftseq="1" ftfieldset="Blog Comment" name="subject" type="string" hint="Subject of comment." required="no" default="" blabel="true" ftlabel="Subject" ftvalidation="required" /> <cfproperty ftseq="2" ftfieldset="Blog Comment" name="description" type="longchar" hint="Comment description." required="no" default="" ftlabel="Description" /> <cfproperty ftseq="3" ftfieldset="Blog Comment" name="commenthandle" type="string" hint="Name or handle of poster." required="no" default="" ftlabel="Name" /> <cfproperty ftseq="4" ftfieldset="Blog Comment" name="email" type="string" hint="Email address of poster." required="no" default="" ftlabel="Email" ftvalidation="validate-email" /> <cfproperty ftseq="5" ftfieldset="Blog Comment" name="website" type="string" hint="Website address of poster." required="no" default="" fttype="url" ftlabel="Website" /> <cfproperty ftseq="6" ftfieldset="Blog Comment" name="parentid" type="uuid" hint="Parent content object reference." required="no" ftjoin="farblogpost" ftlabel="Parent Blog Post" /> <cfproperty ftseq="7" ftfieldset="Blog Comment" name="bCaptcha" type="boolean" hint="Flag for lylacaptcha." default="0" required="no" fttype="lylacaptcha" ftlabel="Captcha" /> </cfcomponent> |