include/reCaptcha/recaptchalib.php

Show: inherited
Table of Contents

Constants

Constant  RECAPTCHA_API_SERVER = "http://api.recaptcha.net"

The reCAPTCHA server URL's

Constant  RECAPTCHA_API_SECURE_SERVER = "https://api-secure.recaptcha.net"
Constant  RECAPTCHA_VERIFY_SERVER = "api-verify.recaptcha.net"

Functions

function_recaptcha_aes_encrypt(  $val,  $ky ) : void

Parameters
Name Type Description
$val
$ky
function_recaptcha_aes_pad(  $val ) : void

Parameters
Name Type Description
$val
function_recaptcha_http_post( string $host, string $path, array $data, int $port = 80 ) : array

Submits an HTTP POST to a reCAPTCHA server

Parameters
Name Type Description
$host string
$path string
$data array
$port int

port

Returns
Type Description
array response
function_recaptcha_mailhide_email_parts(  $email ) : void

gets the parts of the email to expose to the user.

eg, given johndoe@example,com return ["john", "example.com"]. the email is then displayed as john...@example.com

Parameters
Name Type Description
$email
function_recaptcha_mailhide_urlbase64(  $x ) : void

Parameters
Name Type Description
$x
function_recaptcha_qsencode( \$data $data ) : string

Encodes the given data into a query string format

Parameters
Name Type Description
$data \$data
  • array of string elements to be encoded
Returns
Type Description
string - encoded request
functionrecaptcha_check_answer( string $privkey, string $remoteip, string $challenge, string $response, array $extra_params = array() ) : \ReCaptchaResponse

Calls an HTTP POST function to verify if the user's guess was correct

Parameters
Name Type Description
$privkey string
$remoteip string
$challenge string
$response string
$extra_params array

an array of extra variables to post to the server

Returns
Type Description
\ReCaptchaResponse
functionrecaptcha_get_html( string $pubkey, string $error = null, boolean $use_ssl = false ) : string

Gets the challenge HTML (javascript and non-javascript version).

This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from.

Parameters
Name Type Description
$pubkey string

A public key for reCAPTCHA

$error string

The error given by reCAPTCHA (optional, default is null)

$use_ssl boolean

Should the request be made over ssl? (optional, default is false)

Returns
Type Description
string - The HTML to be embedded in the user's form.
functionrecaptcha_get_signup_url( string $domain = null, string $appname = null ) : void

gets a URL where the user can sign up for reCAPTCHA. If your application has a configuration page where you enter a key, you should provide a link using this function.

Parameters
Name Type Description
$domain string

The domain where the page is hosted

$appname string

The name of your application

functionrecaptcha_mailhide_html(  $pubkey,  $privkey,  $email ) : void

Gets html to display an email address given a public an private key.

to get a key, go to:

http://mailhide.recaptcha.net/apikey

Parameters
Name Type Description
$pubkey
$privkey
$email
functionrecaptcha_mailhide_url(  $pubkey,  $privkey,  $email ) : void

Parameters
Name Type Description
$pubkey
$privkey
$email

\ReCaptchaResponse

Package: SugarCRM

A ReCaptchaResponse is returned from recaptcha_check_answer()

Properties

Propertypublic  $error= ''
Details
Type
n/a
Propertypublic  $is_valid= ''
Details
Type
n/a
Documentation was generated by DocBlox 0.18.1.