MediaWiki
master
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1
<?php
7
namespace
MediaWiki\Auth
;
8
20
class
CreateFromLoginAuthenticationRequest
extends
AuthenticationRequest
{
22
public
$required
=
self::OPTIONAL
;
23
25
public
$createRequest
;
26
28
public
$maybeLink
= [];
29
37
public
function
__construct
(
38
?
AuthenticationRequest
$createRequest
=
null
, array
$maybeLink
= []
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
) {
70
case
AuthManager::ACTION_LOGIN
:
71
return
(
bool
)
$this->maybeLink
;
72
case
AuthManager::ACTION_CREATE
:
73
return
$this->maybeLink ||
$this->createRequest
;
74
default
:
75
return
false
;
76
}
77
}
78
86
public
function
hasPrimaryStateForAction
(
$action
) {
87
switch
(
$action
) {
88
case
AuthManager::ACTION_CREATE
:
89
return
(
bool
)
$this->createRequest
;
90
default
:
91
return
false
;
92
}
93
}
94
}
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition
AuthManager.php:136
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition
AuthManager.php:142
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition
AuthenticationRequest.php:28
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition
AuthenticationRequest.php:31
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition
AuthenticationRequest.php:54
MediaWiki\Auth\CreateFromLoginAuthenticationRequest
This transfers state between the login and account creation flows.
Definition
CreateFromLoginAuthenticationRequest.php:20
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$required
$required
Definition
CreateFromLoginAuthenticationRequest.php:22
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(?AuthenticationRequest $createRequest=null, array $maybeLink=[])
Definition
CreateFromLoginAuthenticationRequest.php:37
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\getFieldInfo
getFieldInfo()
Fetch input field info.This will be used in the AuthManager APIs and web UIs to define API input para...
Definition
CreateFromLoginAuthenticationRequest.php:49
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasStateForAction
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
Definition
CreateFromLoginAuthenticationRequest.php:68
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\loadFromSubmission
loadFromSubmission(array $data)
Initialize form submitted form data.The default behavior is to check for each key of self::getFieldIn...
Definition
CreateFromLoginAuthenticationRequest.php:57
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$maybeLink
AuthenticationRequest[] $maybeLink
Definition
CreateFromLoginAuthenticationRequest.php:28
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasPrimaryStateForAction
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...
Definition
CreateFromLoginAuthenticationRequest.php:86
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition
CreateFromLoginAuthenticationRequest.php:25
MediaWiki\Auth
Definition
AbstractAuthenticationProvider.php:7
includes
Auth
CreateFromLoginAuthenticationRequest.php
Generated on Sat Jan 17 2026 22:48:07 for MediaWiki by
1.10.0