MediaWiki REL1_31
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1<?php
22namespace MediaWiki\Auth;
23
36
39
41 public $maybeLink = [];
42
49 public function __construct(
51 ) {
52 $this->createRequest = $createRequest;
53 $this->maybeLink = $maybeLink;
54 $this->username = $createRequest ? $createRequest->username : null;
55 }
56
57 public function getFieldInfo() {
58 return [];
59 }
60
61 public function loadFromSubmission( array $data ) {
62 return true;
63 }
64
71 public function hasStateForAction( $action ) {
72 switch ( $action ) {
74 return (bool)$this->maybeLink;
76 return $this->maybeLink || $this->createRequest;
77 default:
78 return false;
79 }
80 }
81
88 public function hasPrimaryStateForAction( $action ) {
89 switch ( $action ) {
91 return (bool)$this->createRequest;
92 default:
93 return false;
94 }
95 }
96}
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.
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
loadFromSubmission(array $data)
Initialize form submitted form data.
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...