MediaWiki
master
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1
<?php
22
namespace
MediaWiki\Auth
;
23
35
class
CreateFromLoginAuthenticationRequest
extends
AuthenticationRequest
{
37
public
$required
=
self::OPTIONAL
;
38
40
public
$createRequest
;
41
43
public
$maybeLink
= [];
44
52
public
function
__construct
(
53
AuthenticationRequest
$createRequest
=
null
, array
$maybeLink
= []
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
) {
85
case
AuthManager::ACTION_LOGIN
:
86
return
(
bool
)
$this->maybeLink
;
87
case
AuthManager::ACTION_CREATE
:
88
return
$this->maybeLink ||
$this->createRequest
;
89
default
:
90
return
false
;
91
}
92
}
93
101
public
function
hasPrimaryStateForAction
(
$action
) {
102
switch
(
$action
) {
103
case
AuthManager::ACTION_CREATE
:
104
return
(
bool
)
$this->createRequest
;
105
default
:
106
return
false
;
107
}
108
}
109
}
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition
AuthManager.php:144
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition
AuthManager.php:150
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition
AuthenticationRequest.php:44
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition
AuthenticationRequest.php:47
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition
AuthenticationRequest.php:65
MediaWiki\Auth\CreateFromLoginAuthenticationRequest
This transfers state between the login and account creation flows.
Definition
CreateFromLoginAuthenticationRequest.php:35
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$required
$required
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:64
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasStateForAction
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
Definition
CreateFromLoginAuthenticationRequest.php:83
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:72
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Definition
CreateFromLoginAuthenticationRequest.php:52
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$maybeLink
AuthenticationRequest[] $maybeLink
Definition
CreateFromLoginAuthenticationRequest.php:43
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasPrimaryStateForAction
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...
Definition
CreateFromLoginAuthenticationRequest.php:101
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition
CreateFromLoginAuthenticationRequest.php:40
MediaWiki\Auth
Definition
AbstractAuthenticationProvider.php:22
includes
auth
CreateFromLoginAuthenticationRequest.php
Generated on Thu Oct 10 2024 15:23:45 for MediaWiki by
1.10.0