PHP Class RecaptchaPlugin, vanilla

Inheritance: extends Plugin
ファイルを表示 Open project: vanilla/vanilla

Protected Properties

Property Type Description
$privateKey string reCAPTCHA private key
$publicKey string reCAPTCHA public key

Public Methods

Method Description
__construct ( ) Plugin initialization.
captcha_get_handler ( Gdn_PluginManager $sender ) Hook to return captcha submission data.
captcha_isEnabled_handler ( Gdn_PluginManager $sender, array $args ) Hook to indicate a captcha service is available.
captcha_render_handler ( Gdn_Controller $sender ) Hook (view) to render a captcha.
captcha_settings_handler ( SettingsController $sender ) Hook (view) to manage captcha config.
captcha_validate_handler ( Gdn_PluginManager $sender ) : boolean Hook to validate captchas.
gdn_form_captcha_handler ( Gdn_Form $sender ) : string Display reCAPTCHA entry field.
getPrivateKey ( ) : string Get private key from memory.
getPublicKey ( ) : string Get public key from memory.
setPrivateKey ( string $key ) Override private key in memory.
setPublicKey ( string $key ) Override public key in memory.
settingsController_registration_handler ( SettingsController $sender ) Hook (controller) to manage captcha config.
setup ( ) On plugin enable.
validateCaptcha ( string $captchaText ) : boolean Validate a reCAPTCHA submission.

Method Details

__construct() public method

Plugin initialization.
public __construct ( )

captcha_get_handler() public method

Hook to return captcha submission data.
public captcha_get_handler ( Gdn_PluginManager $sender )
$sender Gdn_PluginManager

captcha_isEnabled_handler() public method

Hook to indicate a captcha service is available.
public captcha_isEnabled_handler ( Gdn_PluginManager $sender, array $args )
$sender Gdn_PluginManager
$args array

captcha_render_handler() public method

THIS METHOD ECHOS DATA
public captcha_render_handler ( Gdn_Controller $sender )
$sender Gdn_Controller

captcha_settings_handler() public method

THIS METHOD ECHOS DATA
public captcha_settings_handler ( SettingsController $sender )
$sender SettingsController

captcha_validate_handler() public method

Hook to validate captchas.
public captcha_validate_handler ( Gdn_PluginManager $sender ) : boolean
$sender Gdn_PluginManager
return boolean

gdn_form_captcha_handler() public method

THIS METHOD ECHOS DATA
public gdn_form_captcha_handler ( Gdn_Form $sender ) : string
$sender Gdn_Form
return string

getPrivateKey() public method

Get private key from memory.
public getPrivateKey ( ) : string
return string

getPublicKey() public method

Get public key from memory.
public getPublicKey ( ) : string
return string

setPrivateKey() public method

Override private key in memory.
public setPrivateKey ( string $key )
$key string

setPublicKey() public method

Override public key in memory.
public setPublicKey ( string $key )
$key string

settingsController_registration_handler() public method

Hook (controller) to manage captcha config.
public settingsController_registration_handler ( SettingsController $sender )
$sender SettingsController

setup() public method

On plugin enable.
public setup ( )

validateCaptcha() public method

Validate a reCAPTCHA submission.
public validateCaptcha ( string $captchaText ) : boolean
$captchaText string
return boolean

Property Details

$privateKey protected_oe property

reCAPTCHA private key
protected string $privateKey
return string

$publicKey protected_oe property

reCAPTCHA public key
protected string $publicKey
return string