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

TReCaptcha2 displays a reCAPTCHA (a token displayed as an image) that can be used to determine if the input is entered by a real user instead of some program. It can also prevent multiple submits of the same form either by accident, or on purpose (ie. spamming). The reCAPTCHA to solve (a string consisting of two separate words) displayed is automatically generated by the reCAPTCHA system at recaptcha.net. However, in order to use the services of the site you will need to register and get a public and a private API key pair, and supply those to the reCAPTCHA control through setting the {@link setSecretKey SecretKey} and {@link setSiteKey SiteKey} properties. Currently the reCAPTCHA API supports only one reCAPTCHA field per page, so you MUST make sure that all your input is protected and validated by a single reCAPTCHA control. Placing more than one reCAPTCHA control on the page will lead to unpredictable results, and the user will most likely unable to solve any of them successfully. Upon postback, user input can be validated by calling {@link validate()}. The {@link TReCaptcha2Validator} control can also be used to do validation, which provides server-side validation. Calling (@link validate()) will invalidate the token supplied, so all consecutive calls to the method - without solving a new captcha - will return false. Therefore if implementing a multi-stage input process, you must make sure that you call validate() only once, either at the end of the input process, or you store the result till the end of the processing. The following template shows a typical use of TReCaptcha control:
부터: 3.3.1
저자: Cristian Camilo Naranjo Valencia
상속: extends Prado\Web\UI\ActiveControls\TActivePanel, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\IValidatable
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__construct ( )
getActiveControl ( )
getClientClassName ( )
getClientSide ( )
getIsValid ( ) : boolean Returns true if this control validated successfully.
getLanguage ( ) : string. Returns your language.
getResponse ( ) Gets the response for the reCAPTCHA widget.
getResponseFieldName ( )
getSecretKey ( ) : string. Returns your secret key.
getSiteKey ( ) : string. Returns your site key.
getSize ( ) : string. Returns the size of the widget.
getTabIndex ( ) : string. Returns the tabindex of the widget and challenge.
getTagName ( )
getTheme ( ) : string. Returns the color theme of the widget.
getType ( ) : string. Returns the type of CAPTCHA to serve.
getValidationPropertyValue ( )
getWidgetId ( )
onCallback ( $param )
onCallbackExpired ( $param )
onPreRender ( $param ) Checks for API keys
raiseCallbackEvent ( $param )
render ( $writer )
reset ( ) Resets the reCAPTCHA widget.
setIsValid ( $value )
setLanguage ( $value )
setResponse ( $value )
setSecretKey ( $value )
setSiteKey ( $value )
setSize ( $value ) The size of the widget.
setTabIndex ( $value ) The tabindex of the widget and challenge.
setTheme ( $value ) The color theme of the widget.
setType ( $value ) The type of CAPTCHA to serve.
setWidgetId ( $value )
validate ( )

보호된 메소드들

메소드 설명
addAttributesToRender ( $writer )
getClientOptions ( )
registerClientScript ( )

메소드 상세

__construct() 공개 메소드

public __construct ( )

addAttributesToRender() 보호된 메소드

protected addAttributesToRender ( $writer )

getActiveControl() 공개 메소드

public getActiveControl ( )

getClientClassName() 공개 메소드

public getClientClassName ( )

getClientOptions() 보호된 메소드

protected getClientOptions ( )

getClientSide() 공개 메소드

public getClientSide ( )

getIsValid() 공개 메소드

Defaults to true.
public getIsValid ( ) : boolean
리턴 boolean wether this control validated successfully.

getLanguage() 공개 메소드

Returns your language.
public getLanguage ( ) : string.
리턴 string.

getResponse() 공개 메소드

Gets the response for the reCAPTCHA widget.
public getResponse ( )

getResponseFieldName() 공개 메소드

getSecretKey() 공개 메소드

Returns your secret key.
public getSecretKey ( ) : string.
리턴 string.

getSiteKey() 공개 메소드

Returns your site key.
public getSiteKey ( ) : string.
리턴 string.

getSize() 공개 메소드

Returns the size of the widget.
public getSize ( ) : string.
리턴 string.

getTabIndex() 공개 메소드

If other elements in your page use tabindex, it should be set to make user navigation easier.
public getTabIndex ( ) : string.
리턴 string.

getTagName() 공개 메소드

public getTagName ( )

getTheme() 공개 메소드

Returns the color theme of the widget.
public getTheme ( ) : string.
리턴 string.

getType() 공개 메소드

Returns the type of CAPTCHA to serve.
public getType ( ) : string.
리턴 string.

getValidationPropertyValue() 공개 메소드

getWidgetId() 공개 메소드

public getWidgetId ( )

onCallback() 공개 메소드

public onCallback ( $param )

onCallbackExpired() 공개 메소드

public onCallbackExpired ( $param )

onPreRender() 공개 메소드

Checks for API keys
public onPreRender ( $param )

raiseCallbackEvent() 공개 메소드

public raiseCallbackEvent ( $param )

registerClientScript() 보호된 메소드

protected registerClientScript ( )

render() 공개 메소드

public render ( $writer )

reset() 공개 메소드

Optional widget ID, defaults to the first widget created if unspecified.
public reset ( )

setIsValid() 공개 메소드

public setIsValid ( $value )

setLanguage() 공개 메소드

public setLanguage ( $value )

setResponse() 공개 메소드

public setResponse ( $value )

setSecretKey() 공개 메소드

public setSecretKey ( $value )

setSiteKey() 공개 메소드

public setSiteKey ( $value )

setSize() 공개 메소드

Default: normal
public setSize ( $value )

setTabIndex() 공개 메소드

If other elements in your page use tabindex, it should be set to make user navigation easier. Default: 0
public setTabIndex ( $value )

setTheme() 공개 메소드

Default: light
public setTheme ( $value )

setType() 공개 메소드

Default: image
public setType ( $value )

setWidgetId() 공개 메소드

public setWidgetId ( $value )

validate() 공개 메소드

public validate ( )