MediaWiki  master
CreateFromLoginAuthenticationRequest.php
Go to the documentation of this file.
1 <?php
22 namespace MediaWiki\Auth;
23 
37 
40 
42  public $maybeLink = [];
43 
51  public function __construct(
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 ) {
85  return (bool)$this->maybeLink;
87  return $this->maybeLink || $this->createRequest;
88  default:
89  return false;
90  }
91  }
92 
100  public function hasPrimaryStateForAction( $action ) {
101  switch ( $action ) {
103  return (bool)$this->createRequest;
104  default:
105  return false;
106  }
107  }
108 }
MediaWiki\Auth\AuthenticationRequest\OPTIONAL
const OPTIONAL
Indicates that the request is not required for authentication to proceed.
Definition: AuthenticationRequest.php:41
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\__construct
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
Stable to call.
Definition: CreateFromLoginAuthenticationRequest.php:51
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\getFieldInfo
getFieldInfo()
Fetch input field info.The field info is an associative array mapping field names to info arrays....
Definition: CreateFromLoginAuthenticationRequest.php:63
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\$maybeLink
AuthenticationRequest[] $maybeLink
Definition: CreateFromLoginAuthenticationRequest.php:42
MediaWiki\Auth\AuthenticationRequest\$action
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
Definition: AuthenticationRequest.php:59
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\loadFromSubmission
loadFromSubmission(array $data)
Initialize form submitted form data.The default behavior is to to check for each key of self::getFiel...
Definition: CreateFromLoginAuthenticationRequest.php:71
MediaWiki\Auth\CreateFromLoginAuthenticationRequest
This transfers state between the login and account creation flows.
Definition: CreateFromLoginAuthenticationRequest.php:35
MediaWiki\Auth\AuthManager\ACTION_CREATE
const ACTION_CREATE
Create a new user.
Definition: AuthManager.php:96
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$required
$required
Definition: CreateFromLoginAuthenticationRequest.php:36
MediaWiki\Auth\CreateFromLoginAuthenticationRequest\$createRequest
AuthenticationRequest null $createRequest
Definition: CreateFromLoginAuthenticationRequest.php:39
MediaWiki\Auth\AuthManager\ACTION_LOGIN
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
Definition: AuthManager.php:90
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:82
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition: AuthenticationRequest.php:38