Merge "Do not show create account link for private wikis."
This commit is contained in:
commit
30cdc5894e
|
@ -263,8 +263,17 @@ class SkinVector extends SkinMustache {
|
||||||
], false );
|
], false );
|
||||||
|
|
||||||
$templateParser = $this->getTemplateParser();
|
$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', [
|
$userMoreHtmlItems = $templateParser->processTemplate( 'UserLinks__more', [
|
||||||
'is-anon' => $isAnon,
|
'is-anon' => $isAnon,
|
||||||
|
'is-create-account-allowed' => $isCreateAccountAllowed,
|
||||||
'html-create-account' => $htmlCreateAccount,
|
'html-create-account' => $htmlCreateAccount,
|
||||||
'data-user-interface-preferences' => $menuData[ 'data-user-interface-preferences' ],
|
'data-user-interface-preferences' => $menuData[ 'data-user-interface-preferences' ],
|
||||||
'data-notifications' => $menuData[ 'data-notifications' ],
|
'data-notifications' => $menuData[ 'data-notifications' ],
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{{#data-user-interface-preferences}}{{{html-items}}}{{/data-user-interface-preferences}}
|
{{#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">
|
<li id="p-createaccount" class="user-links-collapsible-item">
|
||||||
{{{html-create-account}}}
|
{{{html-create-account}}}
|
||||||
</li>
|
</li>
|
||||||
{{/is-anon}}
|
{{/is-create-account-allowed}}
|
||||||
{{^is-anon}}
|
{{^is-anon}}
|
||||||
{{#data-user-page}}{{{html-items}}}{{/data-user-page}}
|
{{#data-user-page}}{{{html-items}}}{{/data-user-page}}
|
||||||
{{#data-notifications}}{{{html-items}}}{{/data-notifications}}
|
{{#data-notifications}}{{{html-items}}}{{/data-notifications}}
|
||||||
|
|
Loading…
Reference in New Issue