classcaptcha302::CaptchaGenerator

sys::Obj
  captcha302::CaptchaGenerator

CaptchaGenerator Generate Capctha code/image to file or directly to the browser

make

new make(CaptchaWriter writer)

toBrowser

CaptchaCode toBrowser(WebReq req, WebRes res, ImageFormat format := BmpFormat.<ctor>(), Bool storeInSession := true)

Create a captcha image in memory and send it directly to the browser (commit the response) Returns the captcha code value If storeInSession is true the code will automatically be stored in session["_last_captcha302"]

toFile

CaptchaCode toFile(File imageFile, ImageFormat format := BmpFormat.<ctor>())

Create a captcha image and write it to a file Returns the captcha code value If storeInSession is true the code will automatically be stored in session["_last_captcha302"]

validate

Bool validate(WebReq req, Str code, Bool scrambledOk := false, Str sessionKey := "_last_captcha302")

Validate the code entered by the user against the(latest) one in the session If scrambledOk is true then the letters order does not have to match

writer

CaptchaWriter writer