Debian Codegraph @

extensions/ConfirmEdit/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha;
4
5 use MediaWiki\Auth\AuthenticationRequest;
6 use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
7
8 /**
9 * Authentication request for ReCaptcha v2. Unlike the parent class, no session storage is used
10 * and there is no ID; Google provides a single proof string after successfully solving a captcha.
11 */
12 class ReCaptchaNoCaptchaAuthenticationRequest extends CaptchaAuthenticationRequest {
13 public function __construct() {
14 parent::__construct( '', [] );
15 }
16
17 /**
18 * @inheritDoc
19 */
20 public function loadFromSubmission( array $data ) {
21 // unhack the hack in parent
22 return AuthenticationRequest::loadFromSubmission( $data );
23 }
24
25 /**
26 * @inheritDoc
27 */
28 public function getFieldInfo() {
29 $fieldInfo = parent::getFieldInfo();
30
31 return [
32 'captchaWord' => [
33 'type' => 'string',
34 'label' => $fieldInfo['captchaInfo']['label'],
35 'help' => wfMessage( 'renocaptcha-help' ),
36 ],
37 ];
38 }
39 }