Go to the documentation of this file.
33 parent::__construct(
'PasswordPolicies' );
45 $out->addModuleStyles(
'mediawiki.special' );
51 Xml::openElement(
'table', [
'class' =>
'wikitable mw-passwordpolicies-table' ] ) .
59 $policies = $config->get(
'PasswordPolicy' );
61 $groupPermissions = $config->get(
'GroupPermissions' );
62 $revokePermissions = $config->get(
'RevokePermissions' );
63 $addGroups = $config->get(
'AddGroups' );
64 $removeGroups = $config->get(
'RemoveGroups' );
65 $groupsAddToSelf = $config->get(
'GroupsAddToSelf' );
66 $groupsRemoveFromSelf = $config->get(
'GroupsRemoveFromSelf' );
67 $allGroups = array_unique( array_merge(
68 array_keys( $groupPermissions ),
69 array_keys( $revokePermissions ),
70 array_keys( $addGroups ),
71 array_keys( $removeGroups ),
72 array_keys( $groupsAddToSelf ),
73 array_keys( $groupsRemoveFromSelf )
79 foreach ( $allGroups
as $group ) {
80 if ( $group ==
'*' ) {
90 $grouppageLocalizedTitle,
94 if ( $group ===
'user' ) {
98 $this->
msg(
'listgrouprights-members' )->
text()
100 } elseif ( !in_array( $group, $config->get(
'ImplicitGroups' ) ) ) {
103 $this->
msg(
'listgrouprights-members' )->
text(),
105 [
'group' => $group ]
113 <td>$grouppage$grouplink</td>
133 $policies[
'policies'],
135 $policies[
'policies'][
'default']
139 foreach ( $groupPolicies
as $gp => $val ) {
140 if ( $val ===
false ) {
143 } elseif ( $val ===
true ) {
144 $msg = $this->
msg(
'passwordpolicies-policy-' . strtolower( $gp ) );
146 $msg = $this->
msg(
'passwordpolicies-policy-' . strtolower( $gp ) )->numParams( $val );
149 'passwordpolicies-policy-display',
151 '<span class="mw-passwordpolicies-policy-name">' . $gp .
'</span>'
157 return '<ul><li>' . implode(
"</li>\n<li>",
$ret ) .
'</li></ul>';
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
msg( $key)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
formatPolicies( $policies, $group)
Create a HTML list of password policies for $group.
static getGroupName( $group)
Gets the localized friendly name for a group, if it exists.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
static getGroupPage( $group)
Gets the title of a page describing a particular user group.
static getPoliciesForGroups(array $policies, array $userGroups, array $defaultPolicy)
Utility function to get the effective policy from a list of policies, based on a list of groups.
static openElement( $element, $attribs=null)
This opens an XML element.
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
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
getConfig()
Shortcut to get main config object.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
This special page lists the defined password policies for user groups.
Parent class for all special pages.
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
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
static closeElement( $element)
Shortcut to close an XML element.
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 rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
execute( $par)
Show the special page.
MediaWiki Linker LinkRenderer null $linkRenderer
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
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