MediaWiki
REL1_34
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1
<?php
22
namespace
MediaWiki\Auth
;
23
34
class
CreateFromLoginAuthenticationRequest
extends
AuthenticationRequest
{
35
public
$required
=
self::OPTIONAL
;
36
38
public
$createRequest
;
39
41
public
$maybeLink
= [];
42
49
public
function
__construct
(
50
AuthenticationRequest
$createRequest
=
null
, array
$maybeLink
= []
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
) {
73
case
AuthManager::ACTION_LOGIN
:
74
return
(
bool
)
$this->maybeLink
;
75
case
AuthManager::ACTION_CREATE
:
76
return
$this->maybeLink ||
$this->createRequest
;
77
default
:
78
return
false
;
79
}
80
}
81
88
public
function
hasPrimaryStateForAction
(
$action
) {
89
switch
(
$action
) {
90
case
AuthManager::ACTION_CREATE
:
91
return
(
bool
)
$this->createRequest
;
92
default
:
93
return
false
;
94
}
95
}
96
}
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition
AuthManager.php:87
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition
AuthManager.php:93
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition
AuthenticationRequest.php:37
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition
AuthenticationRequest.php:40
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition
AuthenticationRequest.php:58
MediaWiki\Auth\CreateFromLoginAuthenticationRequest
This transfers state between the login and account creation flows.
Definition
CreateFromLoginAuthenticationRequest.php:34
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$required
$required
Definition
CreateFromLoginAuthenticationRequest.php:35
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\getFieldInfo
getFieldInfo()
Fetch input field info.
Definition
CreateFromLoginAuthenticationRequest.php:57
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasStateForAction
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
Definition
CreateFromLoginAuthenticationRequest.php:71
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\loadFromSubmission
loadFromSubmission(array $data)
Initialize form submitted form data.
Definition
CreateFromLoginAuthenticationRequest.php:61
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Definition
CreateFromLoginAuthenticationRequest.php:49
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$maybeLink
AuthenticationRequest[] $maybeLink
Definition
CreateFromLoginAuthenticationRequest.php:41
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasPrimaryStateForAction
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...
Definition
CreateFromLoginAuthenticationRequest.php:88
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition
CreateFromLoginAuthenticationRequest.php:38
MediaWiki\Auth
Definition
AbstractAuthenticationProvider.php:22
includes
auth
CreateFromLoginAuthenticationRequest.php
Generated on Mon Nov 25 2024 16:04:55 for MediaWiki by
1.10.0