Debian Codegraph @

extensions/ConfirmEdit/Turnstile/includes/TurnstileAuthenticationRequest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\ConfirmEdit\Turnstile;
4
5 use MediaWiki\Auth\AuthenticationRequest;
6 use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
7
8 /**
9 * Authentication request for Turnstile. Functions almost identically to ReCaptchaNoCaptchaAuthenticationRequest.
10 */
11 class TurnstileAuthenticationRequest extends CaptchaAuthenticationRequest {
12 public function __construct() {
13 parent::__construct( '', [] );
14 }
15
16 /**
17 * @inheritDoc
18 */
19 public function loadFromSubmission( array $data ) {
20 // unhack the hack in parent
21 return AuthenticationRequest::loadFromSubmission( $data );
22 }
23
24 /**
25 * @inheritDoc
26 */
27 public function getFieldInfo() {
28 $fieldInfo = parent::getFieldInfo();
29
30 return [
31 'captchaWord' => [
32 'type' => 'string',
33 'label' => $fieldInfo['captchaInfo']['label'],
34 'help' => wfMessage( 'turnstile-help' ),
35 ],
36 ];
37 }
38 }