MediaWiki REL1_31
PasswordDomainAuthenticationRequest.php
Go to the documentation of this file.
1<?php
22namespace MediaWiki\Auth;
23
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}
This is a value object for authentication requests with a username and password.
This is a value object for authentication requests with a username, password, and domain.
describeCredentials()
Describe the credentials represented by this request.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition hooks.txt:2005