Use User->isRegistered(), not deprecated isLoggedIn()

Bug: T270450
Change-Id: I60f714f42848898cf27aa83da92ac1c691fe5ead
This commit is contained in:
James D. Forrester 2020-12-17 19:09:15 -08:00
parent 8e96c0320c
commit 592e1151b7
6 changed files with 9 additions and 9 deletions

View file

@ -40,7 +40,7 @@ final class AuthMenuEntry extends CompositeMenuEntry implements IProfileMenuEntr
User $user, MessageLocalizer $messageLocalizer, array $authLinksQuery User $user, MessageLocalizer $messageLocalizer, array $authLinksQuery
) { ) {
$this->profileMenuEntry = new ProfileMenuEntry( $user ); $this->profileMenuEntry = new ProfileMenuEntry( $user );
$entries = $user->isLoggedIn() $entries = $user->isRegistered()
? [ ? [
$this->profileMenuEntry, $this->profileMenuEntry,
new LogOutMenuEntry( new LogOutMenuEntry(

View file

@ -110,7 +110,7 @@ final class DefaultMainMenuBuilder implements IMainMenuBuilder {
$this->definitions->insertAuthMenuItem( $group ); $this->definitions->insertAuthMenuItem( $group );
if ( $this->user->isLoggedIn() ) { if ( $this->user->isRegistered() ) {
$this->definitions->insertWatchlistMenuItem( $group ); $this->definitions->insertWatchlistMenuItem( $group );
$this->definitions->insertContributionsMenuItem( $group ); $this->definitions->insertContributionsMenuItem( $group );
} }

View file

@ -236,7 +236,7 @@ class ToolbarBuilder {
* @throws MWException * @throws MWException
*/ */
protected function createWatchPageAction(): IMenuEntry { protected function createWatchPageAction(): IMenuEntry {
$isWatched = $this->user->isLoggedIn() && $this->user->isWatched( $this->title ); $isWatched = $this->user->isRegistered() && $this->user->isWatched( $this->title );
$isTempWatched = $this->watchlistExpiryEnabled && $isTempWatched = $this->watchlistExpiryEnabled &&
$isWatched && $isWatched &&
$this->user->isTempWatched( $this->title ); $this->user->isTempWatched( $this->title );

View file

@ -186,7 +186,7 @@ class MinervaHooks {
// if no warning message set. // if no warning message set.
if ( if (
!$request->getVal( 'warning' ) && !$request->getVal( 'warning' ) &&
!$special->getUser()->isLoggedIn() && !$special->getUser()->isRegistered() &&
!$request->wasPosted() !$request->wasPosted()
) { ) {
$request->setVal( 'warning', 'mobile-frontend-generic-login-new' ); $request->setVal( 'warning', 'mobile-frontend-generic-login-new' );

View file

@ -187,7 +187,7 @@ final class MinervaPagePermissions implements IMinervaPagePermissions {
return $this->isAllowed( self::TALK ) && return $this->isAllowed( self::TALK ) &&
( $this->title->isTalkPage() || $this->title->canHaveTalkPage() ) && ( $this->title->isTalkPage() || $this->title->canHaveTalkPage() ) &&
$this->user->isLoggedIn(); $this->user->isRegistered();
} }
/** /**

View file

@ -240,7 +240,7 @@ class SkinMinerva extends SkinMustache {
$className .= ' page-Main_Page '; $className .= ' page-Main_Page ';
} }
if ( $this->getUser()->isLoggedIn() ) { if ( $this->getUser()->isRegistered() ) {
$className .= ' is-authenticated'; $className .= ' is-authenticated';
} }
// The new treatment should only apply to the main namespace // The new treatment should only apply to the main namespace
@ -288,7 +288,7 @@ class SkinMinerva extends SkinMustache {
$notificationIconClass = MinervaUI::iconClass( 'bellOutline-base20', $notificationIconClass = MinervaUI::iconClass( 'bellOutline-base20',
'element', '', 'wikimedia' ); 'element', '', 'wikimedia' );
if ( $user->isLoggedIn() ) { if ( $user->isRegistered() ) {
$badge = Html::element( 'a', [ $badge = Html::element( 'a', [
'class' => $notificationIconClass, 'class' => $notificationIconClass,
'href' => SpecialPage::getTitleFor( 'Mytalk' )->getLocalURL( 'href' => SpecialPage::getTitleFor( 'Mytalk' )->getLocalURL(
@ -543,7 +543,7 @@ class SkinMinerva extends SkinMustache {
$pageTitle = ''; $pageTitle = '';
$msg = $this->msg( 'mobile-frontend-logged-in-homepage-notification', $user->getName() ); $msg = $this->msg( 'mobile-frontend-logged-in-homepage-notification', $user->getName() );
if ( $user->isLoggedIn() && !$msg->isDisabled() ) { if ( $user->isRegistered() && !$msg->isDisabled() ) {
$pageTitle = $msg->text(); $pageTitle = $msg->text();
} }
@ -822,7 +822,7 @@ class SkinMinerva extends SkinMustache {
$styles[] = 'skins.minerva.talk.styles'; $styles[] = 'skins.minerva.talk.styles';
} }
if ( $this->getUser()->isLoggedIn() ) { if ( $this->getUser()->isRegistered() ) {
$styles[] = 'skins.minerva.loggedin.styles'; $styles[] = 'skins.minerva.loggedin.styles';
$styles[] = 'skins.minerva.icons.loggedin'; $styles[] = 'skins.minerva.icons.loggedin';
} }