diff --git a/includes/Menu/Main/DefaultMainMenuBuilder.php b/includes/Menu/Main/DefaultMainMenuBuilder.php index 00831d05f..62c7e709c 100644 --- a/includes/Menu/Main/DefaultMainMenuBuilder.php +++ b/includes/Menu/Main/DefaultMainMenuBuilder.php @@ -20,6 +20,7 @@ namespace MediaWiki\Minerva\Menu\Main; +use MediaWiki\MediaWikiServices; use MediaWiki\Minerva\Menu\Definitions; use MediaWiki\Minerva\Menu\Entries\SingleMenuEntry; use MediaWiki\Minerva\Menu\Group; @@ -101,7 +102,10 @@ final class DefaultMainMenuBuilder implements IMainMenuBuilder { */ public function getSettingsGroup(): Group { $group = new Group( 'pt-preferences' ); - if ( $this->showMobileOptions && !$this->user->isRegistered() ) { + // Show settings group for anon and temp users + $userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); + $isTemp = $userNameUtils->isTemp( $this->user->getName() ); + if ( $this->showMobileOptions && ( !$this->user->isRegistered() || $isTemp ) ) { $this->definitions->insertMobileOptionsItem( $group ); } return $group; @@ -125,6 +129,11 @@ final class DefaultMainMenuBuilder implements IMainMenuBuilder { [ 'login' ] ); } + $userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); + $isTemp = $userNameUtils->isTemp( $this->user->getName() ); + if ( $isTemp ) { + $excludeKeyList[] = 'mycontris'; + } foreach ( $personalTools as $key => $item ) { $href = $item['href'] ?? null; if ( $href && !in_array( $key, $excludeKeyList ) ) { diff --git a/skin.json b/skin.json index 35846d796..152c61358 100644 --- a/skin.json +++ b/skin.json @@ -366,6 +366,7 @@ "menu", "search", "userAvatar", + "userAnonymous", "userTalk", "star", "halfStar",