2016-05-03 16:42:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MediaWiki\Auth\AuthenticationRequest;
|
2022-04-08 16:40:15 +00:00
|
|
|
use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
|
2016-05-03 16:42:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Authentication request for ReCaptcha v2. Unlike the parent class, no session storage is used
|
|
|
|
* and there is no ID; Google provides a single proof string after successfully solving a captcha.
|
|
|
|
*/
|
|
|
|
class ReCaptchaNoCaptchaAuthenticationRequest extends CaptchaAuthenticationRequest {
|
|
|
|
public function __construct() {
|
2019-12-03 17:08:13 +00:00
|
|
|
parent::__construct( '', [] );
|
2016-05-03 16:42:00 +00:00
|
|
|
}
|
|
|
|
|
2020-04-14 23:29:18 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
2016-05-03 16:42:00 +00:00
|
|
|
public function loadFromSubmission( array $data ) {
|
|
|
|
// unhack the hack in parent
|
|
|
|
return AuthenticationRequest::loadFromSubmission( $data );
|
|
|
|
}
|
|
|
|
|
2020-04-14 23:29:18 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
2016-05-03 16:42:00 +00:00
|
|
|
public function getFieldInfo() {
|
|
|
|
$fieldInfo = parent::getFieldInfo();
|
|
|
|
|
|
|
|
return [
|
|
|
|
'captchaWord' => [
|
|
|
|
'type' => 'string',
|
|
|
|
'label' => $fieldInfo['captchaInfo']['label'],
|
|
|
|
'help' => wfMessage( 'renocaptcha-help' ),
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|