MediaWiki
REL1_39
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1
<?php
22
namespace
MediaWiki\Auth
;
23
35
class
CreateFromLoginAuthenticationRequest
extends
AuthenticationRequest
{
36
public
$required
=
self::OPTIONAL
;
37
39
public
$createRequest
;
40
42
public
$maybeLink
= [];
43
51
public
function
__construct
(
52
AuthenticationRequest
$createRequest
=
null
, array
$maybeLink
= []
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
) {
84
case
AuthManager::ACTION_LOGIN
:
85
return
(
bool
)
$this->maybeLink
;
86
case
AuthManager::ACTION_CREATE
:
87
return
$this->maybeLink ||
$this->createRequest
;
88
default
:
89
return
false
;
90
}
91
}
92
100
public
function
hasPrimaryStateForAction
(
$action
) {
101
switch
(
$action
) {
102
case
AuthManager::ACTION_CREATE
:
103
return
(
bool
)
$this->createRequest
;
104
default
:
105
return
false
;
106
}
107
}
108
}
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition
AuthManager.php:108
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition
AuthManager.php:114
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition
AuthenticationRequest.php:42
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition
AuthenticationRequest.php:45
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition
AuthenticationRequest.php:63
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:36
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:63
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasStateForAction
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
Definition
CreateFromLoginAuthenticationRequest.php:82
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:71
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Definition
CreateFromLoginAuthenticationRequest.php:51
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$maybeLink
AuthenticationRequest[] $maybeLink
Definition
CreateFromLoginAuthenticationRequest.php:42
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasPrimaryStateForAction
hasPrimaryStateForAction( $action)
Indicate whether this request contains state for the specified action sufficient to replace other pri...
Definition
CreateFromLoginAuthenticationRequest.php:100
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition
CreateFromLoginAuthenticationRequest.php:39
MediaWiki\Auth
Definition
AbstractAuthenticationProvider.php:22
includes
auth
CreateFromLoginAuthenticationRequest.php
Generated on Tue Oct 8 2024 07:22:24 for MediaWiki by
1.10.0