18 global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
21 $useHttps = ( isset( $_SERVER[
'HTTPS'] ) && $_SERVER[
'HTTPS'] ==
'on' );
22 $js =
'var RecaptchaOptions = ' . Xml::encodeJsVar(
23 [
'theme' => $wgReCaptchaTheme,
'tabindex' => $tabIndex ]
27 'html' => Html::inlineScript( $js ) .
39 $challenge =
$request->getVal(
'recaptcha_challenge_field',
$request->getVal(
'captchaId' ) );
64 if ( !$recaptcha_response->is_valid ) {
65 $this->recaptcha_error = $recaptcha_response->error;
86 global $wgReCaptchaPublicKey;
88 'type' =>
'recaptcha',
89 'mime' =>
'image/png',
90 'key' => $wgReCaptchaPublicKey,
102 $params[
'recaptcha_challenge_field'] = [
105 $params[
'recaptcha_response_field'] = [
118 if ( in_array( $this->recaptcha_error, [
119 'invalid-request-cookie',
'incorrect-captcha-sol',
135 return [
'index' => $index ];
168 global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
171 CaptchaAuthenticationRequest::class,
true );
179 $formDescriptor[
'captchaInfo'] = [
180 'class' => HTMLReCaptchaField::class,
181 'key' => $wgReCaptchaPublicKey,
182 'theme' => $wgReCaptchaTheme,
183 'secure' => isset( $_SERVER[
'HTTPS'] ) && $_SERVER[
'HTTPS'] ===
'on',
184 'error' => $captcha->getError(),
185 ] + $formDescriptor[
'captchaInfo'];
189 $formDescriptor[
'captchaId'] = [
190 'class' => HTMLSubmittedValueField::class,
191 'name' =>
'recaptcha_challenge_field',
193 $formDescriptor[
'captchaWord'] = [
194 'class' => HTMLSubmittedValueField::class,
195 'name' =>
'recaptcha_response_field',
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
if(! $wgDBerrorLogTZ) $wgRequest
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
static getInstance()
Get the global Captcha instance.
Authentication request for ReCaptcha v1.
storeCaptcha( $info)
Generate a captcha session ID and save the info in PHP's session storage.
getFormInformation( $tabIndex=1)
Displays the reCAPTCHA widget.
onAuthChangeFormFields(array $requests, array $fieldInfo, array &$formDescriptor, $action)
passCaptcha( $challenge, $response)
Calls the library function recaptcha_check_answer to verify the users input.
createAuthenticationRequest()
retrieveCaptcha( $index)
Fetch this session's captcha info.
addCaptchaAPI(&$resultArr)
getCaptchaParamsFromRequest(WebRequest $request)
getCaptcha()
Returns an array with 'question' and 'answer' keys.
APIGetAllowedParams(&$module, &$params, $flags)
getCaptchaInfo( $captchaData, $id)
Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs.
isAPICaptchaModule( $module)
string $action
Used to select the right message.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
this hook is for auditing only $req
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead. & $feedLinks hooks can tweak the array to change how login etc forms should look $requests
this hook is for auditing only $response
recaptcha_get_html( $pubkey, $error=null, $use_ssl=false)
Gets the challenge HTML (javascript and non-javascript version).
recaptcha_check_answer( $privkey, $remoteip, $challenge, $response, $extra_params=array())
Calls an HTTP POST function to verify if the user's guess was correct.