Go to the documentation of this file.
22 parent::__construct(
$name,
'editmyprivateinfo' );
39 return AuthManager::ACTION_CHANGE;
44 $params = parent::getPreservedParams( $withToken );
46 'returnto' =>
$request->getVal(
'returnto' ),
47 'returntoquery' =>
$request->getVal(
'returntoquery' ),
58 Hooks::run(
'ChangePasswordForm', [ &$extraFields ],
'1.27' );
59 foreach ( $extraFields
as $extra ) {
61 $formDescriptor[
$name] = [
64 'label-message' => $label,
65 'default' => $default,
70 return parent::onAuthChangeFormFields(
$requests, $fieldInfo, $formDescriptor, $action );
84 if ( !$this->authRequests ) {
102 case AuthenticationResponse::PASS:
105 case AuthenticationResponse::FAIL:
109 throw new LogicException(
'invalid AuthenticationResponse' );
116 $this->authRequests = array_filter( $this->authRequests,
function (
$req )
use (
$subPage ) {
119 if (
count( $this->authRequests ) > 1 ) {
120 throw new LogicException(
'Multiple AuthenticationRequest objects with same ID!' );
126 if ( !static::$loadUserData ) {
129 $descriptor = parent::getAuthFormDescriptor(
$requests, $action );
132 foreach ( $descriptor
as &$field ) {
133 if ( $field[
'type'] ===
'password' && $field[
'name'] !==
'retype' ) {
135 if ( isset( $field[
'cssclass'] ) ) {
136 $field[
'cssclass'] .=
' mw-changecredentials-validate-password';
138 $field[
'cssclass'] =
'mw-changecredentials-validate-password';
145 'mediawiki.special.changecredentials.js'
154 $form = parent::getAuthForm(
$requests, $action );
156 $info =
$req->describeCredentials();
168 $form->setSubmitTextMsg( static::$messagePrefix .
'-submit' );
183 if ( static::$loadUserData ) {
184 $requests = AuthenticationRequest::loadRequestsFromSubmission( $this->authRequests, $data );
200 $out->addHTML( $error->parse() );
203 $groupedRequests = [];
204 foreach ( $this->authRequests
as $req ) {
205 $info =
$req->describeCredentials();
206 $groupedRequests[(
string)$info[
'provider']][] =
$req;
211 foreach ( $groupedRequests
as $group => $members ) {
213 foreach ( $members
as $req ) {
215 $info =
$req->describeCredentials();
218 $this->getPageTitle(
$req->getUniqueId() ),
234 SessionManager::singleton()->invalidateSessionsForUser(
$user );
235 $session->setUser(
$user );
239 $out->redirect( $returnUrl );
242 $out->wrapWikiMsg(
"<div class=\"successbox\">\n$1\n</div>", static::$messagePrefix
244 $out->returnToMain();
265 return $this->
getConfig()->get(
'ChangeCredentialsBlacklist' );
getAuthFormDescriptor( $requests, $action)
Generates a HTMLForm descriptor array from a set of authentication requests.
getPageTitle( $subpage=false)
Get a self-referential title object.
displayForm( $status)
Display the form.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
error also a ContextSource you ll probably need to make sure the header is varied on $request
getOutput()
Get the OutputPage being used for this instance.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string & $returnToQuery
getAuthForm(array $requests, $action)
static newMainPage()
Create a new Title for the Main Page.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
this hook is for auditing only $req
static newFatal( $message)
Factory function for fatal errors.
getRequestBlacklist()
Allows blacklisting certain request types.
Allows to change the fields on the form that will be generated $name
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
isListed()
Whether this special page is listed in Special:SpecialPages.
onAuthChangeFormFields(array $requests, array $fieldInfo, array &$formDescriptor, $action)
Change the form descriptor that determines how a field will look in the authentication form.
A special page subclass for authentication-related special pages.
__construct( $name='ChangeCredentials')
AuthenticationRequest[] $authRequests
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
handleFormSubmit( $data)
Submit handler callback for HTMLForm.
trySubmit()
Attempts to do an authentication step with the submitted data.
static closeElement( $element)
Returns "</$element>".
string $subPage
Subpage of the special page.
performAuthenticationStep( $action, array $requests)
getDefaultAction( $subPage)
Get the default action for this special page, if none is given via URL/POST data.
getConfig()
Shortcut to get main config object.
namespace and then decline to actually register it file or subcat img or subcat $title
string $authAction
one of the AuthManager::ACTION_* constants.
getPreservedParams( $withToken=false)
Returns URL query parameters which can be used to reload the page (or leave and return) while preserv...
doesWrites()
Indicates whether this special page may perform database writes.
needsSubmitButton(array $requests)
Returns true if the form built from the given AuthenticationRequests needs a submit button.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
static $loadUserData
Change action needs user data; remove action does not.
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
loadAuth( $subPage, $authAction=null, $reset=false)
Load or initialize $authAction, $authRequests and $subPage.
msg()
Wrapper around wfMessage that sets the current context.
static newGood( $value=null)
Factory function for good results.
Special change to change credentials (such as the password).
this hook is for auditing only $response
execute( $subPage)
Default execute method Checks user permissions.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead. & $feedLinks hooks can tweak the array to change how login etc forms should look $requests
getRequest()
Get the WebRequest being used for this instance.
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 "<
showSubpageList( $error=null)
MediaWiki Linker LinkRenderer null $linkRenderer
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
the array() calling protocol came about after MediaWiki 1.4rc1.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect & $returnTo
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out