MediaWiki REL1_35
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1<?php
22namespace MediaWiki\Auth;
23
37
40
42 public $maybeLink = [];
43
51 public function __construct(
53 ) {
54 $this->createRequest = $createRequest;
55 $this->maybeLink = $maybeLink;
56 $this->username = $createRequest ? $createRequest->username : null;
57 }
58
63 public function getFieldInfo() {
64 return [];
65 }
66
71 public function loadFromSubmission( array $data ) {
72 return true;
73 }
74
82 public function hasStateForAction( $action ) {
83 switch ( $action ) {
85 return (bool)$this->maybeLink;
87 return $this->maybeLink || $this->createRequest;
88 default:
89 return false;
90 }
91 }
92
101 switch ( $action ) {
103 return (bool)$this->createRequest;
104 default:
105 return false;
106 }
107 }
108}
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.
getFieldInfo()
Fetch input field info.The field info is an associative array mapping field names to info arrays....
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 to check for each key of self::getFiel...
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Stable to call.
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...