MediaWiki
REL1_34
PasswordDomainAuthenticationRequest.php
Go to the documentation of this file.
1
<?php
22
namespace
MediaWiki\Auth
;
23
29
class
PasswordDomainAuthenticationRequest
extends
PasswordAuthenticationRequest
{
31
private
$domainList
;
32
34
public
$domain
=
null
;
35
39
public
function
__construct
( array
$domainList
) {
40
$this->domainList =
$domainList
;
41
}
42
43
public
function
getFieldInfo
() {
44
$ret = parent::getFieldInfo();
45
46
// Only add a domain field if we have the username field included
47
if
( isset( $ret[
'username'
] ) ) {
48
$ret[
'domain'
] = [
49
'type'
=>
'select'
,
50
'options'
=> [],
51
'label'
=>
wfMessage
(
'yourdomainname'
),
52
'help'
=>
wfMessage
(
'authmanager-domain-help'
),
53
];
54
foreach
( $this->domainList as
$domain
) {
55
$ret[
'domain'
][
'options'
][
$domain
] = new \RawMessage(
'$1'
, [
$domain
] );
56
}
57
}
58
59
return
$ret;
60
}
61
62
public
function
describeCredentials
() {
63
return
[
64
'provider'
=>
wfMessage
(
'authmanager-provider-password-domain'
),
65
'account'
=>
wfMessage
(
66
'authmanager-account-password-domain'
, [ $this->username, $this->domain ]
67
),
68
];
69
}
70
76
public
static
function
__set_state
( $data ) {
77
$ret =
new
static
( $data[
'domainList'
] );
78
foreach
( $data as $k => $v ) {
79
if
( $k !==
'domainList'
) {
80
$ret->$k = $v;
81
}
82
}
83
return
$ret;
84
}
85
}
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition
GlobalFunctions.php:1263
MediaWiki\Auth\PasswordAuthenticationRequest
This is a value object for authentication requests with a username and password.
Definition
PasswordAuthenticationRequest.php:29
MediaWiki\Auth\PasswordDomainAuthenticationRequest
This is a value object for authentication requests with a username, password, and domain.
Definition
PasswordDomainAuthenticationRequest.php:29
MediaWiki\Auth\PasswordDomainAuthenticationRequest\__construct
__construct(array $domainList)
Definition
PasswordDomainAuthenticationRequest.php:39
MediaWiki\Auth\PasswordDomainAuthenticationRequest\getFieldInfo
getFieldInfo()
Fetch input field info.
Definition
PasswordDomainAuthenticationRequest.php:43
MediaWiki\Auth\PasswordDomainAuthenticationRequest\__set_state
static __set_state( $data)
Definition
PasswordDomainAuthenticationRequest.php:76
MediaWiki\Auth\PasswordDomainAuthenticationRequest\describeCredentials
describeCredentials()
Describe the credentials represented by this request.
Definition
PasswordDomainAuthenticationRequest.php:62
MediaWiki\Auth\PasswordDomainAuthenticationRequest\$domain
string $domain
Domain.
Definition
PasswordDomainAuthenticationRequest.php:34
MediaWiki\Auth\PasswordDomainAuthenticationRequest\$domainList
string[] $domainList
Domains available.
Definition
PasswordDomainAuthenticationRequest.php:31
MediaWiki\Auth
Definition
AbstractAuthenticationProvider.php:22
includes
auth
PasswordDomainAuthenticationRequest.php
Generated on Fri Apr 5 2024 23:09:41 for MediaWiki by
1.9.8