MediaWiki master
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1<?php
22namespace MediaWiki\Auth;
23
38
41
43 public $maybeLink = [];
44
52 public function __construct(
54 ) {
55 $this->createRequest = $createRequest;
56 $this->maybeLink = $maybeLink;
57 $this->username = $createRequest ? $createRequest->username : null;
58 }
59
64 public function getFieldInfo() {
65 return [];
66 }
67
72 public function loadFromSubmission( array $data ) {
73 return true;
74 }
75
83 public function hasStateForAction( $action ) {
84 switch ( $action ) {
86 return (bool)$this->maybeLink;
88 return $this->maybeLink || $this->createRequest;
89 default:
90 return false;
91 }
92 }
93
102 switch ( $action ) {
104 return (bool)$this->createRequest;
105 default:
106 return false;
107 }
108 }
109}
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...