Merge "Do not show create account link for private wikis."

This commit is contained in:
jenkins-bot 2021-08-25 21:40:46 +00:00 committed by Gerrit Code Review
commit 30cdc5894e
2 changed files with 11 additions and 2 deletions

View File

@ -263,8 +263,17 @@ class SkinVector extends SkinMustache {
], false );
$templateParser = $this->getTemplateParser();
// See T288428#7303233. The following conditional checks whether config is disabling account creation for
// anonymous users in modern Vector. This check excludes the use case of extensions using core and legacy hooks
// to remove the "Create account" link from the personal toolbar. Ideally this should be managed with a new hook
// that tracks account creation ability.
// Supporting removing items via hook involves unnecessary additional complexity we'd rather avoid at this time.
// (see https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/713505/3)
// Account creation can be disabled by setting `$wgGroupPermissions['*']['createaccount'] = false;`
$isCreateAccountAllowed = $isAnon && $this->getAuthority()->isAllowed( 'createaccount' );
$userMoreHtmlItems = $templateParser->processTemplate( 'UserLinks__more', [
'is-anon' => $isAnon,
'is-create-account-allowed' => $isCreateAccountAllowed,
'html-create-account' => $htmlCreateAccount,
'data-user-interface-preferences' => $menuData[ 'data-user-interface-preferences' ],
'data-notifications' => $menuData[ 'data-notifications' ],

View File

@ -1,9 +1,9 @@
{{#data-user-interface-preferences}}{{{html-items}}}{{/data-user-interface-preferences}}
{{#is-anon}}
{{#is-create-account-allowed}}
<li id="p-createaccount" class="user-links-collapsible-item">
{{{html-create-account}}}
</li>
{{/is-anon}}
{{/is-create-account-allowed}}
{{^is-anon}}
{{#data-user-page}}{{{html-items}}}{{/data-user-page}}
{{#data-notifications}}{{{html-items}}}{{/data-notifications}}