]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - extensions/ConfirmEdit/ReCaptchaNoCaptcha/ReCaptchaNoCaptchaAuthenticationRequest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / extensions / ConfirmEdit / ReCaptchaNoCaptcha / ReCaptchaNoCaptchaAuthenticationRequest.php
1 <?php
2
3 use MediaWiki\Auth\AuthenticationRequest;
4
5 /**
6  * Authentication request for ReCaptcha v2. Unlike the parent class, no session storage is used
7  * and there is no ID; Google provides a single proof string after successfully solving a captcha.
8  */
9 class ReCaptchaNoCaptchaAuthenticationRequest extends CaptchaAuthenticationRequest {
10         public function __construct() {
11                 parent::__construct( null, null );
12         }
13
14         public function loadFromSubmission( array $data ) {
15                 // unhack the hack in parent
16                 return AuthenticationRequest::loadFromSubmission( $data );
17         }
18
19         public function getFieldInfo() {
20                 $fieldInfo = parent::getFieldInfo();
21
22                 return [
23                         'captchaWord' => [
24                                 'type' => 'string',
25                                 'label' => $fieldInfo['captchaInfo']['label'],
26                                 'help' => wfMessage( 'renocaptcha-help' ),
27                         ],
28                 ];
29         }
30 }