MediaWiki  1.29.2
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1 <?php
22 namespace 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 }
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition: AuthenticationRequest.php:40
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Definition: CreateFromLoginAuthenticationRequest.php:49
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\getFieldInfo
getFieldInfo()
Fetch input field info.
Definition: CreateFromLoginAuthenticationRequest.php:57
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\$maybeLink
AuthenticationRequest[] $maybeLink
Definition: CreateFromLoginAuthenticationRequest.php:41
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition: AuthenticationRequest.php:57
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\loadFromSubmission
loadFromSubmission(array $data)
Initialize form submitted form data.
Definition: CreateFromLoginAuthenticationRequest.php:61
MediaWiki\Auth\CreateFromLoginAuthenticationRequest
This transfers state between the login and account creation flows.
Definition: CreateFromLoginAuthenticationRequest.php:34
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition: AuthManager.php:89
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$required
$required
Definition: CreateFromLoginAuthenticationRequest.php:35
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition: CreateFromLoginAuthenticationRequest.php:38
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition: AuthManager.php:84
MediaWiki\Auth
Definition: AbstractAuthenticationProvider.php:22
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\hasStateForAction
hasStateForAction( $action)
Indicate whether this request contains any state for the specified action.
Definition: CreateFromLoginAuthenticationRequest.php:71
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition: AuthenticationRequest.php:37
array
the array() calling protocol came about after MediaWiki 1.4rc1.