MediaWiki master
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Auth;
8
23
26
28 public $maybeLink = [];
29
37 public function __construct(
39 ) {
40 $this->createRequest = $createRequest;
41 $this->maybeLink = $maybeLink;
42 $this->username = $createRequest ? $createRequest->username : null;
43 }
44
49 public function getFieldInfo() {
50 return [];
51 }
52
57 public function loadFromSubmission( array $data ) {
58 return true;
59 }
60
68 public function hasStateForAction( $action ) {
69 switch ( $action ) {
71 return (bool)$this->maybeLink;
73 return $this->maybeLink || $this->createRequest;
74 default:
75 return false;
76 }
77 }
78
86 public function hasPrimaryStateForAction( $action ) {
87 switch ( $action ) {
89 return (bool)$this->createRequest;
90 default:
91 return false;
92 }
93 }
94}
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
const ACTION_CREATE
Create a new user.
This is a value object for authentication requests.
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
This transfers state between the login and account creation flows.
__construct(?AuthenticationRequest $createRequest=null, array $maybeLink=[])
getFieldInfo()
Fetch input field info.This will be used in the AuthManager APIs and web UIs to define API input para...
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
loadFromSubmission(array $data)
Initialize form submitted form data.The default behavior is to check for each key of self::getFieldIn...
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...