Go to the documentation of this file.
35 parent::__construct(
'PasswordPolicies' );
47 $out->addModuleStyles(
'mediawiki.special' );
53 Xml::openElement(
'table', [
'class' =>
'wikitable mw-passwordpolicies-table' ] ) .
55 Xml::element(
'th',
null, $this->
msg(
'passwordpolicies-group' )->text() ) .
56 Xml::element(
'th',
null, $this->
msg(
'passwordpolicies-policies' )->text() ) .
61 $policies = $config->get(
'PasswordPolicy' );
63 $groupPermissions = $config->get(
'GroupPermissions' );
64 $revokePermissions = $config->get(
'RevokePermissions' );
65 $addGroups = $config->get(
'AddGroups' );
66 $removeGroups = $config->get(
'RemoveGroups' );
67 $groupsAddToSelf = $config->get(
'GroupsAddToSelf' );
68 $groupsRemoveFromSelf = $config->get(
'GroupsRemoveFromSelf' );
69 $allGroups = array_unique( array_merge(
70 array_keys( $groupPermissions ),
71 array_keys( $revokePermissions ),
72 array_keys( $addGroups ),
73 array_keys( $removeGroups ),
74 array_keys( $groupsAddToSelf ),
75 array_keys( $groupsRemoveFromSelf )
81 foreach ( $allGroups as $group ) {
82 if ( $group ==
'*' ) {
90 getCanonicalName(
NS_PROJECT ) .
':' . $group );
93 $grouppageLocalizedTitle,
97 if ( $group ===
'user' ) {
101 $this->
msg(
'listgrouprights-members' )->text()
103 } elseif ( !in_array( $group, $config->get(
'ImplicitGroups' ) ) ) {
106 $this->
msg(
'listgrouprights-members' )->text(),
108 [
'group' => $group ]
115 $out->addHTML( Html::rawElement(
'tr', [
'id' => Sanitizer::escapeIdForAttribute( $group ) ],
"
116 <td>$grouppage$grouplink</td>
136 $policies[
'policies'],
138 $policies[
'policies'][
'default']
142 foreach ( $groupPolicies as $gp => $settings ) {
143 if ( !is_array( $settings ) ) {
144 $settings = [
'value' => $settings ];
146 $val = $settings[
'value'];
147 $flags = array_diff_key( $settings, [
'value' =>
true ] );
152 $msg = $this->
msg(
'passwordpolicies-policy-' . strtolower( $gp ) )->numParams( $val );
154 foreach ( array_filter( $flags ) as $flag => $value ) {
155 $flagMsg = $this->
msg(
'passwordpolicies-policyflag-' . strtolower( $flag ) );
156 $flagMsg->params( $value );
157 $flagMsgs[] = $flagMsg;
161 'passwordpolicies-policy-displaywithflags',
163 '<span class="mw-passwordpolicies-policy-name">' . $gp .
'</span>',
168 'passwordpolicies-policy-display',
170 '<span class="mw-passwordpolicies-policy-name">' . $gp .
'</span>'
177 return '<ul><li>' . implode(
"</li>\n<li>", $ret ) .
'</li></ul>';
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
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...
getLanguage()
Shortcut to get user's language.
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.
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.
static closeElement( $element)
Shortcut to close an XML element.
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...