Service/ReCaptcha/MailHide.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
ReCaptcha  

\Zend_Service_ReCaptcha_MailHide

Package: Zend\Service\ReCaptcha
Zend_Service_ReCaptcha_MailHide
Parent(s)
\Zend_Service_ReCaptcha < \Zend_Service_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: MailHide.php 24593 2012-01-05 20:35:02Z matthew $  

Constants

>VConstant  ENCRYPTION_MODE = MCRYPT_MODE_CBC
>VConstant  ENCRYPTION_CIPHER = MCRYPT_RIJNDAEL_128
>VConstant  ENCRYPTION_BLOCK_SIZE = 16
>VConstant  ENCRYPTION_IV = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
>VConstantstring  MAILHIDE_SERVER = 'http://mailhide.recaptcha.net/d'
Url to the mailhide server
string

>VConstantstring  API_SERVER = 'http://www.google.com/recaptcha/api'
inherited
URI to the regular API
Inherited from: \Zend_Service_ReCaptcha::API_SERVER
Inherited_from
\Zend_Service_ReCaptcha::API_SERVER  
string

>VConstantstring  API_SECURE_SERVER = 'https://www.google.com/recaptcha/api'
inherited
URI to the secure API
Inherited from: \Zend_Service_ReCaptcha::API_SECURE_SERVER
>VConstantstring  VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify'
inherited
URI to the verify server
Inherited from: \Zend_Service_ReCaptcha::VERIFY_SERVER

Properties

>VPropertyprotectedstring $_email = null
The email address to protect
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_emailDomainPart = null
The domain part of the email
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_emailLocalPart = null
The local part of the email
Default valuenullDetails
Type
string
>VPropertyprotected\Zend_Validate_Interface $_emailValidator
>VPropertyprotected\Zend_Http_Client $_httpClient = null
staticinherited
HTTP Client used to query all web services
Inherited from: \Zend_Service_Abstract::$$_httpClient\Zend_Service_ReCaptcha::$$_httpClient
Default valuenullDetails
Type
\Zend_Http_Client
Inherited_from
\Zend_Service_Abstract::$$_httpClient  
Inherited_from
\Zend_Service_ReCaptcha::$$_httpClient  
>VPropertyprotectedstring $_ip = null
inherited
Ip address used when verifying user input
Inherited from: \Zend_Service_ReCaptcha::$$_ip
Default valuenullDetails
Type
string
Inherited_from
\Zend_Service_ReCaptcha::$$_ip  
>VPropertyprotectedarray $_options = array('theme' => 'red', 'lang' => 'en')
inherited
Options for tailoring reCaptcha
Inherited from: \Zend_Service_ReCaptcha::$$_options

See the different options on http://recaptcha.net/apidocs/captcha/client.html

Default valuearray('theme' => 'red', 'lang' => 'en')Details
Type
array
Inherited_from
\Zend_Service_ReCaptcha::$$_options  
>VPropertyprotectedarray $_params = array('ssl' => false, 'error' => null, 'xhtml' => false)
inherited
Parameters for the object
Inherited from: \Zend_Service_ReCaptcha::$$_params
Default valuearray('ssl' => false, 'error' => null, 'xhtml' => false)Details
Type
array
Inherited_from
\Zend_Service_ReCaptcha::$$_params  
>VPropertyprotectedstring $_privateKey = null
inherited
Private key used when verifying user input
Inherited from: \Zend_Service_ReCaptcha::$$_privateKey
Default valuenullDetails
Type
string
Inherited_from
\Zend_Service_ReCaptcha::$$_privateKey  
>VPropertyprotectedstring $_privateKeyPacked = null
Binary representation of the private key
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_publicKey = null
inherited
Public key used when displaying the captcha
Inherited from: \Zend_Service_ReCaptcha::$$_publicKey
Default valuenullDetails
Type
string
Inherited_from
\Zend_Service_ReCaptcha::$$_publicKey  
>VPropertyprotected\Zend_Service_ReCaptcha_Response $_response = null
inherited
Response from the verify server
Inherited from: \Zend_Service_ReCaptcha::$$_response
Default valuenullDetails
Type
\Zend_Service_ReCaptcha_Response
Inherited_from
\Zend_Service_ReCaptcha::$$_response  

Methods

methodpublic__construct(string $publicKey = null, string $privateKey = null, string $email = null, array | \Zend_Config $options = null) : void

Local constructor

Parameters
NameTypeDescription
$publicKeystring
$privateKeystring
$emailstring
$optionsarray | \Zend_Config
methodpublic__toString() : string

Serialize as string

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

Returns
TypeDescription
string
methodprotected_getUrl() : string

Get the url used on the "hidden" part of the email address

Returns
TypeDescription
string
methodprotected_post(string $challengeField, string $responseField) : \Zend_Http_Response
inherited

Post a solution to the verify server

Inherited from: \Zend_Service_ReCaptcha::_post()
Parameters
NameTypeDescription
$challengeFieldstring
$responseFieldstring
Returns
TypeDescription
\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Service_ReCaptcha_Exception
methodprotected_requireMcrypt() : void

See if the mcrypt extension is available

methodpublicgetDefaultOptions() : array

Get the default set of parameters

Returns
TypeDescription
array
methodpublicgetEmail() : string

Get the email property

Returns
TypeDescription
string
methodpublicgetEmailDomainPart() : string

Get the domain part of the email address

Returns
TypeDescription
string
methodpublicgetEmailLocalPart() : string

Get the local part of the email address

Returns
TypeDescription
string
methodpublicgetEmailValidator() : \Zend_Validate_Interface

Get emailValidator

Returns
TypeDescription
\Zend_Validate_Interface
methodpublicgetHtml(string $email = null) : string

Get the HTML code needed for the mail hide

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

Parameters
NameTypeDescription
$emailstring
Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Service_ReCaptcha_MailHide_Exception
methodpublicgetHttpClient() : \Zend_Http_Client
staticfinalinherited

Gets the HTTP client object.

Inherited from: \Zend_Service_Abstract::getHttpClient()\Zend_Service_ReCaptcha::getHttpClient()
Returns
TypeDescription
\Zend_Http_Client
methodpublicgetIp() : string
inherited

Get the ip property

Inherited from: \Zend_Service_ReCaptcha::getIp()
Returns
TypeDescription
string
methodpublicgetOption(string $key) : mixed
inherited

Get a single option

Inherited from: \Zend_Service_ReCaptcha::getOption()
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublicgetOptions() : array
inherited

Get the options array

Inherited from: \Zend_Service_ReCaptcha::getOptions()
Returns
TypeDescription
array
methodpublicgetParam(string $key) : mixed
inherited

Get a single parameter

Inherited from: \Zend_Service_ReCaptcha::getParam()
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublicgetParams() : array
inherited

Get the parameter array

Inherited from: \Zend_Service_ReCaptcha::getParams()
Returns
TypeDescription
array
methodpublicgetPrivateKey() : string
inherited

Get the private key

Inherited from: \Zend_Service_ReCaptcha::getPrivateKey()
Returns
TypeDescription
string
methodpublicgetPublicKey() : string
inherited

Get the public key

Inherited from: \Zend_Service_ReCaptcha::getPublicKey()
Returns
TypeDescription
string
methodpublicsetEmail(string $email) : \Zend_Service_ReCaptcha_MailHide

Set the email property

This method will set the email property along with the local and domain parts

Parameters
NameTypeDescription
$emailstring
Returns
TypeDescription
\Zend_Service_ReCaptcha_MailHide
methodpublicsetEmailValidator(\Zend_Validate_Interface $validator) : \Zend_Service_ReCaptcha_MailHide

Set email validator

Parameters
NameTypeDescription
$validator\Zend_Validate_Interface
Returns
TypeDescription
\Zend_Service_ReCaptcha_MailHide
methodpublicsetHttpClient(\Zend_Http_Client $httpClient) : void
staticfinalinherited

Sets the HTTP client object to use for retrieving the feeds.

Inherited from: \Zend_Service_Abstract::setHttpClient()\Zend_Service_ReCaptcha::setHttpClient()

If none is set, the default Zend_Http_Client will be used.

Parameters
NameTypeDescription
$httpClient\Zend_Http_Client
methodpublicsetIp(string $ip) : \Zend_Service_ReCaptcha
inherited

Set the ip property

Inherited from: \Zend_Service_ReCaptcha::setIp()
Parameters
NameTypeDescription
$ipstring
Returns
TypeDescription
\Zend_Service_ReCaptcha
methodpublicsetOption(string $key, string $value) : \Zend_Service_ReCaptcha
inherited

Set a single option

Inherited from: \Zend_Service_ReCaptcha::setOption()
Parameters
NameTypeDescription
$keystring
$valuestring
Returns
TypeDescription
\Zend_Service_ReCaptcha
methodpublicsetOptions(array | \Zend_Config $options) : \Zend_Service_ReCaptcha
inherited

Set options

Inherited from: \Zend_Service_ReCaptcha::setOptions()
Parameters
NameTypeDescription
$optionsarray | \Zend_Config
Returns
TypeDescription
\Zend_Service_ReCaptcha
Throws
ExceptionDescription
\Zend_Service_ReCaptcha_Exception
methodpublicsetParam(string $key, string $value) : \Zend_Service_ReCaptcha
inherited

Set a single parameter

Inherited from: \Zend_Service_ReCaptcha::setParam()
Parameters
NameTypeDescription
$keystring
$valuestring
Returns
TypeDescription
\Zend_Service_ReCaptcha
methodpublicsetParams(array | \Zend_Config $params) : \Zend_Service_ReCaptcha
inherited

Set parameters

Inherited from: \Zend_Service_ReCaptcha::setParams()
Parameters
NameTypeDescription
$paramsarray | \Zend_Config
Returns
TypeDescription
\Zend_Service_ReCaptcha
Throws
ExceptionDescription
\Zend_Service_ReCaptcha_Exception
methodpublicsetPrivateKey(string $privateKey) : \Zend_Service_ReCaptcha_MailHide

Override the setPrivateKey method

Override the parent method to store a binary representation of the private key as well.

Parameters
NameTypeDescription
$privateKeystring
Returns
TypeDescription
\Zend_Service_ReCaptcha_MailHide
methodpublicsetPublicKey(string $publicKey) : \Zend_Service_ReCaptcha
inherited

Set the public key

Inherited from: \Zend_Service_ReCaptcha::setPublicKey()
Parameters
NameTypeDescription
$publicKeystring
Returns
TypeDescription
\Zend_Service_ReCaptcha
methodpublicverify(string $challengeField, string $responseField) : \Zend_Service_ReCaptcha_Response
inherited

Verify the user input

Inherited from: \Zend_Service_ReCaptcha::verify()

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

Parameters
NameTypeDescription
$challengeFieldstring
$responseFieldstring
Returns
TypeDescription
\Zend_Service_ReCaptcha_Response
Documentation was generated by phpDocumentor 2.0.0a12.