Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe ReCaptcha

Fonctions membres publiques

 __construct ($secret, RequestMethod $requestMethod=null)
 
 verify ($response, $remoteIp=null)
 
 setExpectedHostname ($hostname)
 
 setExpectedApkPackageName ($apkPackageName)
 
 setExpectedAction ($action)
 
 setScoreThreshold ($threshold)
 
 setChallengeTimeout ($timeoutSeconds)
 

Champs de données

const VERSION = 'php_1.2.4'
 
const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'
 
const E_INVALID_JSON = 'invalid-json'
 
const E_CONNECTION_FAILED = 'connection-failed'
 
const E_BAD_RESPONSE = 'bad-response'
 
const E_UNKNOWN_ERROR = 'unknown-error'
 
const E_MISSING_INPUT_RESPONSE = 'missing-input-response'
 
const E_HOSTNAME_MISMATCH = 'hostname-mismatch'
 
const E_APK_PACKAGE_NAME_MISMATCH = 'apk_package_name-mismatch'
 
const E_ACTION_MISMATCH = 'action-mismatch'
 
const E_SCORE_THRESHOLD_NOT_MET = 'score-threshold-not-met'
 
const E_CHALLENGE_TIMEOUT = 'challenge-timeout'
 

Attributs privés

 $secret
 
 $requestMethod
 

Description détaillée

reCAPTCHA client.

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $secret,
RequestMethod  $requestMethod = null 
)

Create a configured instance to use the reCAPTCHA service.

Paramètres
string$secretThe shared key between your site and reCAPTCHA.
RequestMethod$requestMethodmethod used to send the request. Defaults to POST.
Exceptions

Documentation des fonctions membres

◆ setChallengeTimeout()

setChallengeTimeout (   $timeoutSeconds)

Provide a timeout in seconds to test against the challenge timestamp in verify()

Paramètres
int$timeoutSecondsExpected hostname
Renvoie
ReCaptcha Current instance for fluent interface

Références $this.

◆ setExpectedAction()

setExpectedAction (   $action)

Provide an action to match against in verify() This should be set per page.

Paramètres
string$actionExpected action
Renvoie
ReCaptcha Current instance for fluent interface

Références $this.

◆ setExpectedApkPackageName()

setExpectedApkPackageName (   $apkPackageName)

Provide an APK package name to match against in verify()

Paramètres
string$apkPackageNameExpected APK package name
Renvoie
ReCaptcha Current instance for fluent interface

Références $this.

◆ setExpectedHostname()

setExpectedHostname (   $hostname)

Provide a hostname to match against in verify() This should be without a protocol or trailing slash, e.g. www.google.com

Paramètres
string$hostnameExpected hostname
Renvoie
ReCaptcha Current instance for fluent interface

Références $this.

◆ setScoreThreshold()

setScoreThreshold (   $threshold)

Provide a threshold to meet or exceed in verify() Threshold should be a float between 0 and 1 which will be tested as response >= threshold.

Paramètres
float$thresholdExpected threshold
Renvoie
ReCaptcha Current instance for fluent interface

Références $this.

◆ verify()

verify (   $response,
  $remoteIp = null 
)

Calls the reCAPTCHA siteverify API to verify whether the user passes CAPTCHA test and additionally runs any specified additional checks

Paramètres
string$responseThe user response token provided by reCAPTCHA, verifying the user on your site.
string$remoteIpThe end user's IP address.
Renvoie
Response Response from the service.

Références $params, et Response\fromJson().

Documentation des champs

◆ $requestMethod

$requestMethod
private

◆ $secret

$secret
private

◆ E_ACTION_MISMATCH

const E_ACTION_MISMATCH = 'action-mismatch'

Expected action did not match string

◆ E_APK_PACKAGE_NAME_MISMATCH

const E_APK_PACKAGE_NAME_MISMATCH = 'apk_package_name-mismatch'

Expected APK package name did not match string

◆ E_BAD_RESPONSE

const E_BAD_RESPONSE = 'bad-response'

Did not receive a 200 from the service string

◆ E_CHALLENGE_TIMEOUT

const E_CHALLENGE_TIMEOUT = 'challenge-timeout'

Challenge timeout string

◆ E_CONNECTION_FAILED

const E_CONNECTION_FAILED = 'connection-failed'

Could not connect to service string

◆ E_HOSTNAME_MISMATCH

const E_HOSTNAME_MISMATCH = 'hostname-mismatch'

Expected hostname did not match string

◆ E_INVALID_JSON

const E_INVALID_JSON = 'invalid-json'

Invalid JSON received string

◆ E_MISSING_INPUT_RESPONSE

const E_MISSING_INPUT_RESPONSE = 'missing-input-response'

ReCAPTCHA response not provided string

◆ E_SCORE_THRESHOLD_NOT_MET

const E_SCORE_THRESHOLD_NOT_MET = 'score-threshold-not-met'

Score threshold not met string

◆ E_UNKNOWN_ERROR

const E_UNKNOWN_ERROR = 'unknown-error'

Not a success, but no error codes received! string

◆ SITE_VERIFY_URL

const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'

URL for reCAPTCHA siteverify API string

Référencé par Post\__construct(), SocketPost\__construct(), et CurlPost\__construct().

◆ VERSION

const VERSION = 'php_1.2.4'

Version of this client library. string


La documentation de cette classe a été générée à partir du fichier suivant :