contentbox.models.ui

Class Captcha

lucee.Component
    extended by contentbox.models.ui.Captcha

Create captchas

Class Attributes:
  • singleton
  •  
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Constructor Summary
    init([any sessionStorage])
    Method Summary
    private void clearCaptcha()
    any display([numeric length='4'], [string text='[runtime expression]'], [string width='200'], [string height='50'], [string fonts='verdana,arial,times new roman,courier'], [string message='Please enter the correct code shown in the graphic.'])
         I display the captcha and an error message, if appropriate.
    string getCaptchaCode()
    private any getCaptchaStorage()
    private boolean isValidated()
    private string makeRandomString([numeric length='4'])
    void setCaptchaCode(string captchastring)
    private void setValidated(boolean validated)
    boolean validate(string code)
         I validate the passed in string against the captcha code.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any sessionStorage])

    Parameters:
    sessionStorage

    Method Detail

    clearCaptcha

    private void clearCaptcha()


    display

    public any display([numeric length='4'], [string text='[runtime expression]'], [string width='200'], [string height='50'], [string fonts='verdana,arial,times new roman,courier'], [string message='Please enter the correct code shown in the graphic.'])

    I display the captcha and an error message, if appropriate

    Parameters:
    length
    text
    width - width of captcha image in pixels
    height - height of captcha image in pixels
    fonts - fonts to use for characters in captcha image
    message - Message to display below captcha if validate method failed.

    getCaptchaCode

    public string getCaptchaCode()


    getCaptchaStorage

    private any getCaptchaStorage()


    isValidated

    private boolean isValidated()


    makeRandomString

    private string makeRandomString([numeric length='4'])

    Parameters:
    length

    setCaptchaCode

    public void setCaptchaCode(string captchastring)

    Parameters:
    captchastring

    setValidated

    private void setValidated(boolean validated)

    Parameters:
    validated

    validate

    public boolean validate(string code)

    I validate the passed in string against the captcha code

    Parameters:
    code