User:anonymousLog inRegister
Recents:
Captcha User Control

Download here

Control Description

The information about Captcha can be found here. Basically, it is a control used to determine whether the user is human. This implementation is based on the sample downloaded from the following link.

Image:CaptchaImage1

Using the control

The control basically has the following properties. One of them is a numeric property to set the validation result.

Captcha User Control Properties
ControlName <controlName>
Height <Height of the control, default 39 according to image size>
ValidationResult <numeric property used to set the validation result>
Width <Width, default 140 according to image size>

Methods

ReloadImage : Lets you reload the image displayed by the control without refreshing the page (eg: Captcha1.ReloadImage())

First of all, you need to drag the control from the toolbox where you have the controls and the user controls to a web panel. When you do that, the control will be displayed as follows:

Image:CaptchaDesign

Then, select the control to see its properties.

Image:CaptchaProperties

Note: &CaptchaValidation is a Numeric(4,0) variable that will be used by the control to set the validation result when the user types the word in the relevant edit box and press tab key to go to the next field.

Once you have assigned the relevant numeric variable to the ValidationResult property, the following code could be used in your event to know if the validation was successful or not.:

Event 'Register'
 If &ValidationResult = 1
// OK
Else
msg("Validation failed, retype the word as seen on the image")
Endif 
EndEvent

Control at runtime:

The control will be displayed as follow showing a random image. As you can see, an edit box is created by the control just below the image. There is where the use needs to type the image text and press tab in order to get the validation executed.

Image:CaptchaRuntime

NOTE: This first version of the control is for illustrative purposes. In further versions the security will be improved, the idea is to have the user control to return the image id and the encrypted text typed by the user so it can then be validated against the values stored in a database table; suggestions are welcomed.

To Install It

Please visit: Default Installation Instructions for User Controls.

Change Log

2008/04/26: Version 1.1 uploaded. VersionNumber and PathToImages properties added to the control.
2010/02/15: Version 1.3 uploaded. VersionNumber property removed, ReloadImage method added.
                 

Please send feedback to: acardoso@artech.com.uy


Created: 11/08/07 03:12 PM by armando Last update: 02/15/10 08:17 PM by armando
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)