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 ==
'*' ) {
86 $groupnameLocalized = UserGroupMembership::getGroupName( $group );
88 $grouppageLocalizedTitle = UserGroupMembership::getGroupPage( $group )
89 ?: Title::newFromText( MediaWikiServices::getInstance()->getNamespaceInfo()->
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>
123 $out->addHTML( Xml::closeElement(
'table' ) );
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>';