Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_ReCaptcha Class Reference
Inheritance diagram for Zend_Service_ReCaptcha:
Collaboration diagram for Zend_Service_ReCaptcha:

Public Member Functions

 __construct ($publicKey=null, $privateKey=null, $params=null, $options=null, $ip=null)
 __toString ()
 setIp ($ip)
 getIp ()
 setParam ($key, $value)
 setParams ($params)
 getParams ()
 getParam ($key)
 setOption ($key, $value)
 setOptions ($options)
 getOptions ()
 getOption ($key)
 getPublicKey ()
 setPublicKey ($publicKey)
 getPrivateKey ()
 setPrivateKey ($privateKey)
 getHtml ()
 verify ($challengeField, $responseField)

Data Fields

const API_SERVER = 'http://api.recaptcha.net'
const API_SECURE_SERVER = 'https://api-secure.recaptcha.net'
const VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify'

Protected Member Functions

 _post ($challengeField, $responseField)

Protected Attributes

 $_publicKey = null
 $_privateKey = null
 $_ip = null
 $_params
 $_options
 $_response = null

Detailed Description

Definition at line 41 of file ReCaptcha.php.


Constructor & Destructor Documentation

__construct ( publicKey = null,
privateKey = null,
params = null,
options = null,
ip = null 
)

Class constructor

Parameters:
string$publicKey
string$privateKey
array$params
array$options
string$ip
array | Zend_Config$params

Definition at line 127 of file ReCaptcha.php.

Here is the call graph for this function:


Member Function Documentation

Serialize as string

When the instance is used as a string it will display the recaptcha. Since we can't throw exceptions within this method we will trigger a user warning instead.

Returns:
string

Reimplemented in Zend_Service_ReCaptcha_MailHide.

Definition at line 162 of file ReCaptcha.php.

Here is the call graph for this function:

_post ( challengeField,
responseField 
) [protected]

Post a solution to the verify server

Parameters:
string$challengeField
string$responseField
Returns:
Zend_Http_Response
Exceptions:
Zend_Service_ReCaptcha_Exception
See also:
Zend_Service_ReCaptcha_Exception
Zend_Service_ReCaptcha_Exception
Zend_Service_ReCaptcha_Exception
Zend_Service_ReCaptcha_Exception

Definition at line 447 of file ReCaptcha.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getHtml ( )

Get the HTML code for the captcha

This method uses the public key to fetch a recaptcha form.

Returns:
string
Exceptions:
Zend_Service_ReCaptcha_Exception
See also:
Zend_Service_ReCaptcha_Exception

Definition at line 379 of file ReCaptcha.php.

Here is the caller graph for this function:

getIp ( )

Get the ip property

Returns:
string

Definition at line 192 of file ReCaptcha.php.

getOption ( key)

Get a single option

Parameters:
string$key
Returns:
mixed

Definition at line 320 of file ReCaptcha.php.

Here is the caller graph for this function:

Get the options array

Returns:
array

Definition at line 309 of file ReCaptcha.php.

getParam ( key)

Get a single parameter

Parameters:
string$key
Returns:
mixed

Definition at line 256 of file ReCaptcha.php.

getParams ( )

Get the parameter array

Returns:
array

Definition at line 245 of file ReCaptcha.php.

Get the private key

Returns:
string

Definition at line 353 of file ReCaptcha.php.

Get the public key

Returns:
string

Definition at line 330 of file ReCaptcha.php.

setIp ( ip)

Set the ip property

Parameters:
string$ip
Returns:
Zend_Service_ReCaptcha

Definition at line 180 of file ReCaptcha.php.

Here is the caller graph for this function:

setOption ( key,
value 
)

Set a single option

Parameters:
string$key
string$value
Returns:
Zend_Service_ReCaptcha

Definition at line 268 of file ReCaptcha.php.

Here is the caller graph for this function:

setOptions ( options)

Set options

Parameters:
array | Zend_Config$options
Returns:
Zend_Service_ReCaptcha
Exceptions:
Zend_Service_ReCaptcha_Exception
See also:
Zend_Service_ReCaptcha_Exception

Definition at line 282 of file ReCaptcha.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setParam ( key,
value 
)

Set a single parameter

Parameters:
string$key
string$value
Returns:
Zend_Service_ReCaptcha

Definition at line 204 of file ReCaptcha.php.

Here is the caller graph for this function:

setParams ( params)

Set parameters

Parameters:
array | Zend_Config$params
Returns:
Zend_Service_ReCaptcha
Exceptions:
Zend_Service_ReCaptcha_Exception
See also:
Zend_Service_ReCaptcha_Exception

Definition at line 218 of file ReCaptcha.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setPrivateKey ( privateKey)

Set the private key

Parameters:
string$privateKey
Returns:
Zend_Service_ReCaptcha

Reimplemented in Zend_Service_ReCaptcha_MailHide.

Definition at line 364 of file ReCaptcha.php.

Here is the caller graph for this function:

setPublicKey ( publicKey)

Set the public key

Parameters:
string$publicKey
Returns:
Zend_Service_ReCaptcha

Definition at line 341 of file ReCaptcha.php.

Here is the caller graph for this function:

verify ( challengeField,
responseField 
)

Verify the user input

This method calls up the post method and returns a Zend_Service_ReCaptcha_Response object.

Parameters:
string$challengeField
string$responseField
Returns:
Zend_Service_ReCaptcha_Response

Definition at line 500 of file ReCaptcha.php.

Here is the call graph for this function:


Field Documentation

$_ip = null [protected]

Definition at line 83 of file ReCaptcha.php.

$_options [protected]
Initial value:
 array(
        'theme' => 'red',
        'lang' => 'en',
    )

Definition at line 105 of file ReCaptcha.php.

$_params [protected]
Initial value:
 array(
        'ssl' => false, 
        'error' => null, 
        'xhtml' => false 
    )

Definition at line 90 of file ReCaptcha.php.

$_privateKey = null [protected]

Definition at line 76 of file ReCaptcha.php.

$_publicKey = null [protected]

Definition at line 69 of file ReCaptcha.php.

$_response = null [protected]

Definition at line 115 of file ReCaptcha.php.

const API_SECURE_SERVER = 'https://api-secure.recaptcha.net'

Definition at line 55 of file ReCaptcha.php.

const API_SERVER = 'http://api.recaptcha.net'

Definition at line 48 of file ReCaptcha.php.

const VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify'

Definition at line 62 of file ReCaptcha.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations