Service/ReCaptcha/MailHide.php

Show: inherited
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 [email protected] 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

Constant  ENCRYPTION_MODE = MCRYPT_MODE_CBC
Constant  ENCRYPTION_CIPHER = MCRYPT_RIJNDAEL_128
Constant  ENCRYPTION_BLOCK_SIZE = 16
Constant  ENCRYPTION_IV = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
Constantstring  MAILHIDE_SERVER = 'http://mailhide.recaptcha.net/d'

Url to the mailhide server

string
Constantstring  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
Constantstring  API_SECURE_SERVER = 'https://www.google.com/recaptcha/api'
inherited

URI to the secure API

Inherited from: \Zend_Service_ReCaptcha::API_SECURE_SERVER
Constantstring  VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify'
inherited

URI to the verify server

Inherited from: \Zend_Service_ReCaptcha::VERIFY_SERVER
Inherited_from
\Zend_Service_ReCaptcha::VERIFY_SERVER  
string

Properties

Propertyprotectedstring $_email = null

The email address to protect

Default valuenullDetails
Type
string
Propertyprotectedstring $_emailDomainPart = null

The domain part of the email

Default valuenullDetails
Type
string
Propertyprotectedstring $_emailLocalPart = null

The local part of the email

Default valuenullDetails
Type
string
Propertyprotected\Zend_Validate_Interface $_emailValidator =

Propertyprotected\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  
Propertyprotectedstring $_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  
Propertyprotectedarray $_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  
Propertyprotectedarray $_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  
Propertyprotectedstring $_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  
Propertyprotectedstring $_privateKeyPacked = null

Binary representation of the private key

Default valuenullDetails
Type
string
Propertyprotectedstring $_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  
Propertyprotected\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
Name Type Description
$publicKey string
$privateKey string
$email string
$options array | \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
Type Description
string
methodprotected_getUrl() : string

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

Returns
Type Description
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
Name Type Description
$challengeField string
$responseField string
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Service_ReCaptcha_Exception
methodprotected_requireMcrypt() : void

See if the mcrypt extension is available

Throws
Exception Description
\Zend_Service_ReCaptcha_MailHide_Exception
methodpublicgetDefaultOptions() : array

Get the default set of parameters

Returns
Type Description
array
methodpublicgetEmail() : string

Get the email property

Returns
Type Description
string
methodpublicgetEmailDomainPart() : string

Get the domain part of the email address

Returns
Type Description
string
methodpublicgetEmailLocalPart() : string

Get the local part of the email address

Returns
Type Description
string
methodpublicgetEmailValidator() : \Zend_Validate_Interface

Get emailValidator

Returns
Type Description
\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
Name Type Description
$email string
Returns
Type Description
string
Throws
Exception Description
\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
Type Description
\Zend_Http_Client
methodpublicgetIp() : string
inherited

Get the ip property

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

Get a single option

Inherited from: \Zend_Service_ReCaptcha::getOption()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublicgetOptions() : array
inherited

Get the options array

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

Get a single parameter

Inherited from: \Zend_Service_ReCaptcha::getParam()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublicgetParams() : array
inherited

Get the parameter array

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

Get the private key

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

Get the public key

Inherited from: \Zend_Service_ReCaptcha::getPublicKey()
Returns
Type Description
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
Name Type Description
$email string
Returns
Type Description
\Zend_Service_ReCaptcha_MailHide
methodpublicsetEmailValidator(\Zend_Validate_Interface $validator) : \Zend_Service_ReCaptcha_MailHide

Set email validator

Parameters
Name Type Description
$validator \Zend_Validate_Interface
Returns
Type Description
\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
Name Type Description
$httpClient \Zend_Http_Client
methodpublicsetIp(string $ip) : \Zend_Service_ReCaptcha
inherited

Set the ip property

Inherited from: \Zend_Service_ReCaptcha::setIp()
Parameters
Name Type Description
$ip string
Returns
Type Description
\Zend_Service_ReCaptcha
methodpublicsetOption(string $key, string $value) : \Zend_Service_ReCaptcha
inherited

Set a single option

Inherited from: \Zend_Service_ReCaptcha::setOption()
Parameters
Name Type Description
$key string
$value string
Returns
Type Description
\Zend_Service_ReCaptcha
methodpublicsetOptions(array | \Zend_Config $options) : \Zend_Service_ReCaptcha
inherited

Set options

Inherited from: \Zend_Service_ReCaptcha::setOptions()
Parameters
Name Type Description
$options array | \Zend_Config
Returns
Type Description
\Zend_Service_ReCaptcha
Throws
Exception Description
\Zend_Service_ReCaptcha_Exception
methodpublicsetParam(string $key, string $value) : \Zend_Service_ReCaptcha
inherited

Set a single parameter

Inherited from: \Zend_Service_ReCaptcha::setParam()
Parameters
Name Type Description
$key string
$value string
Returns
Type Description
\Zend_Service_ReCaptcha
methodpublicsetParams(array | \Zend_Config $params) : \Zend_Service_ReCaptcha
inherited

Set parameters

Inherited from: \Zend_Service_ReCaptcha::setParams()
Parameters
Name Type Description
$params array | \Zend_Config
Returns
Type Description
\Zend_Service_ReCaptcha
Throws
Exception Description
\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
Name Type Description
$privateKey string
Returns
Type Description
\Zend_Service_ReCaptcha_MailHide
methodpublicsetPublicKey(string $publicKey) : \Zend_Service_ReCaptcha
inherited

Set the public key

Inherited from: \Zend_Service_ReCaptcha::setPublicKey()
Parameters
Name Type Description
$publicKey string
Returns
Type Description
\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
Name Type Description
$challengeField string
$responseField string
Returns
Type Description
\Zend_Service_ReCaptcha_Response
Documentation was generated by phpDocumentor 2.0.0a8.