Component (captchaService) captchaService
Only the functions and data members that are accessible from your location are displayed
HintPerforms captcha functionality.
public
CREATEHASHREFERENCE
createHashReference
Creates a hash reference in the service and returns the results.
Public Function createHashReference
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
textfalsestringnullText to create Captcha with. Defaults random string as defined in config file.
return typestruct
GETHASHREFERENCECACHETIMESTAMP
Public Function getHashReferenceCacheTimestamp
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typenumeric
GETHASHREFERENCECACHE
Public Function getHashReferenceCache
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typearray
VALIDATECAPTCHA
validateCaptcha
Validates a captcha by hash and user response text.
Public Function validateCaptcha
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
hashtruestringnull
texttruestringnull
return typeboolean
GETCONFIGBEAN
Public Function getConfigBean
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typecaptchaServiceConfigBean
GETMEMENTO
Public Function getMemento
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestruct
SETUP
setup
Setups the service after dependencies have been injected.
Public Function setup
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typevoid
GETCONFIGFILE
Public Function getConfigFile
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestring
GETVERSION
getVersion
Gets the current version of LylaCAPTCHA.
Public Function getVersion
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestring
INIT
init
Initializes the service.
Public Function init
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
configBeanfalsecaptchaServiceConfigBean
configFilefalsestring
return typecaptchaService
CREATECAPTCHAFROMHASHREFERENCE
createCaptchaFromHashReference
Creates a captcha to the desired from a hash reference.
Public Function createCaptchaFromHashReference
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
typetruestringnullCaptcah output type. Accepts file or stream.
hashtruestringnullHash reference to retrieve from cache.
return typestruct
GETAVAILABLEFONTNAMES
getAvailableFontNames
Returns an array of all available system fonts. This is useful when deciding on fonts to use for captcha configuration.
Public Function getAvailableFontNames
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typearray
private
GETCOLORBYTYPE
getColorByType
Get a color by type name.
Private Function getColorByType
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
colorTypetruestringnull
useTransparencyfalsebooleanfalse
return typeany
CREATECAPTCHA
createCaptcha
Creates a captcha to the desired stream.
Private Function createCaptcha
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
typetruestringnullCaptcah output type. Accepts file or stream.
texttruestringnull
hashtruestringnull
return typestruct
ARRAYFIND
arrayFind
Like listFind(), except with an array.
Private Function arrayFind
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
searchArraytruearraynull
valuetruestringnull
return typenumeric
CREATEHASH
createHash
Creates a hash.
Private Function createHash
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestring
DRAWBACKGROUND
drawBackground
Draws a background.
Private Function drawBackground
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
graphicstrueanynullThe graphics.
dimensiontrueanynullThe dimension object.
return typevoid
CLEANUPHASHREFERENCECACHE
cleanupHashReferenceCache
Cleans up expired elements in the hash reference LRU cache.
Private Function cleanupHashReferenceCache
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typevoid
DRAWRANDOMOVAL
drawRandomOval
Draws a random oval.
Private Function drawRandomOval
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
graphicstrueanynullThe graphics.
dimensiontrueanynullThe dimension object.
ovalColorTypetrueanynullThe dimension object.
return typevoid
LOADXML
loadXML
Loads the config file.<br/> Throws: captchaService.cannotFindConfigFile if provider cannot find the config file.<br/> captchaService.notXML if the config file is not an XML file.
Private Function loadXML
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typevoid
SETCONFIGBEAN
Private Function setConfigBean
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
configBeantruecaptchaServiceConfigBeannull
return typevoid
GETRANDOMTRANSFORMATION
getRandomTransformation
Gets a random transformation.
Private Function getRandomTransformation
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
shearXRangetruenumericnullThe shear x range.
shearYRangetruenumericnullThe shear y range.
return typeany
SETHASHREFERENCECACHE
Private Function setHashReferenceCache
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
hashReferenceCachetruearraynull
return typevoid
ENCODEIMAGE
encodeImage
Encodes a buffered image to the desired output stream.
Private Function encodeImage
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
outputStreamtrueanynullThe output stream.
bufferedImagetrueanynullThe buffered image.
return typevoid
RANDSTRING
randString
Returns a random string according to the type.
Private Function randString
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
typetruestringnull
counttruenumericnull
return typestring
GETRANDOMPOINTONBORDER
getRandomPointOnBorder
Gets a random java.awt.Point on the border.
Private Function getRandomPointOnBorder
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
dimensiontrueanynullThe dimension object.
return typeany
SETUPHASHREFERENCECACHE
setupHashReferenceCache
Setups the hash reference cache.
Private Function setupHashReferenceCache
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typevoid
SETCONFIGFILE
Private Function setConfigFile
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
configFiletruestringnull
return typevoid
SETHASHREFERENCE
setHashReference
Sets captcha text by hash reference.
Private Function setHashReference
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
hashtruestringnull
texttruestringnull
return typevoid
GETHASHREFERENCE
getHashReference
Gets captcha text by hash reference.
Private Function getHashReference
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
hashtruestringnull
deleteFromCachefalsebooleanfalse
return typestring
DRAWRANDOMLINE
drawRandomLine
Draws a random line.
Private Function drawRandomLine
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
graphicstrueanynullThe graphics.
dimensiontrueanynullThe dimension object.
lineColorTypetrueanynullThe dimension object.
return typevoid
SETFONT
setFont
Sets a new font in the graphics lib.
Private Function setFont
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
graphicstrueanynullThe graphics.
fontCollectiontrueanynullThe current font collection.
return typevoid
GETFILELOCATION
getFileLocation
Gets a file location.
Private Function getFileLocation
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestring
GETRANDSTRING
getRandString
Gets a random string based on the configuration.
Private Function getRandString
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typestring
GETRANDOMSTROKE
getRandomStroke
Gets a random stroke.
Private Function getRandomStroke
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
return typeany
GETRANDOMPOINT
getRandomPoint
Gets a random java.awt.Point in within the dimensions.
Private Function getRandomPoint
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
dimensiontrueanynullThe dimension object.
return typeany
SETHASHREFERENCECACHETIMESTAMP
Private Function setHashReferenceCacheTimestamp
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
hashReferenceCacheTimestamptruenumericnull
return typevoid
WRITETOSTREAM
writeToStream
Writes a captcha to an outputStream.
Private Function writeToStream
source:/home/alisonme/public_html/captchaService.cfc
arguments
labelnamerequiredtypedefaulthint
outputStreamtrueanynull
texttruestringnull
return typevoid