PHP 클래스 Prado\Web\UI\WebControls\TCaptchaValidator

Notice: while this class is easy to use and implement, it does not provide full security. In fact, it's easy to bypass the checks reusing old, already-validated tokens (reply attack). A better alternative is provided by {@link TReCaptchaValidator}. TCaptchaValidator validates user input against a CAPTCHA represented by a {@link TCaptcha} control. The input control fails validation if its value is not the same as the token displayed in CAPTCHA. Note, if the user does not enter any thing, it is still considered as failing the validation. To use TCaptchaValidator, specify the {@link setControlToValidate ControlToValidate} to be the ID path of the input control (usually a {@link TTextBox} control}. Also specify the {@link setCaptchaControl CaptchaControl} to be the ID path of the CAPTCHA control that the user input should be compared with.
부터: 3.1.1
저자: Qiang Xue ([email protected])
상속: extends TBaseValidator
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
getCaptchaControl ( ) : string
setCaptchaControl ( $value ) Sets the ID path of the CAPTCHA control to validate.

보호된 메소드들

메소드 설명
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
findCaptchaControl ( ) : TCaptchaControl
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing validation for this control.
getClientScriptOptions ( ) : array Returns an array of javascript validator options.

비공개 메소드들

메소드 설명
generateTokenHash ( $token )

메소드 상세

evaluateIsValid() 보호된 메소드

The validation succeeds if the input control has the same value as the one displayed in the corresponding CAPTCHA control.
protected evaluateIsValid ( ) : boolean
리턴 boolean whether the validation succeeds

findCaptchaControl() 보호된 메소드

protected findCaptchaControl ( ) : TCaptchaControl
리턴 TCaptchaControl the CAPTCHA control to be validated against

getCaptchaControl() 공개 메소드

public getCaptchaControl ( ) : string
리턴 string the ID path of the CAPTCHA control to validate

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getClientScriptOptions() 보호된 메소드

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
리턴 array javascript validator options.

setCaptchaControl() 공개 메소드

The ID path is the dot-connected IDs of the controls reaching from the validator's naming container to the target control.
public setCaptchaControl ( $value )