MediaWiki REL1_34
TOTPExtendTokenField.php
Go to the documentation of this file.
1<?php
2
4
6
11 protected $requests;
12
16 protected $fieldInfo;
17
21 protected $formDescriptor;
22
26 protected $action;
27
35 public static function callback( $requests, $fieldInfo, &$formDescriptor, $action ) {
36 $handler = new static(
41 );
42
43 return $handler->execute();
44 }
45
53 $this->requests = $requests;
54 $this->fieldInfo = $fieldInfo;
55 $this->formDescriptor = &$formDescriptor;
56 $this->action = $action;
57 }
58
59 protected function execute() {
60 if ( $this->shouldSkip() ) {
61 return true;
62 }
63
64 $this->formDescriptor['OATHToken'] += [
65 'cssClass' => 'loginText',
66 'id' => 'wpOATHToken',
67 'size' => 20,
68 'dir' => 'ltr',
69 'autofocus' => true,
70 'persistent' => false,
71 'autocomplete' => false,
72 'spellcheck' => false,
73 ];
74 return true;
75 }
76
77 protected function shouldSkip() {
78 return !isset( $this->fieldInfo['OATHToken'] );
79 }
80}
This is a value object for authentication requests.
static callback( $requests, $fieldInfo, &$formDescriptor, $action)