mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 01:20:07 +00:00
Merge "Use User->isRegistered(), not deprecated isLoggedIn()"
This commit is contained in:
commit
c07310165a
|
@ -301,7 +301,7 @@ class Hooks {
|
|||
|
||||
$user = $out->getUser();
|
||||
|
||||
if ( $user->isLoggedIn() && self::isSkinVersionLegacy() ) {
|
||||
if ( $user->isRegistered() && self::isSkinVersionLegacy() ) {
|
||||
$vars[ 'wgVectorDisableSidebarPersistence' ] =
|
||||
self::getConfig(
|
||||
Constants::CONFIG_KEY_DISABLE_SIDEBAR_PERSISTENCE
|
||||
|
|
|
@ -134,7 +134,7 @@ class SkinVector extends SkinMustache {
|
|||
'sidebar-visible' => $this->isSidebarVisible(),
|
||||
], $this->getMenuProps() );
|
||||
|
||||
if ( $skin->getUser()->isLoggedIn() ) {
|
||||
if ( $skin->getUser()->isRegistered() ) {
|
||||
// Note: This data is also passed to legacy template where it is unused.
|
||||
$commonSkinData['data-emphasized-sidebar-action'] = [
|
||||
'href' => SpecialPage::getTitleFor(
|
||||
|
@ -169,7 +169,7 @@ class SkinVector extends SkinMustache {
|
|||
*/
|
||||
private function isSidebarVisible() {
|
||||
$skin = $this->getSkin();
|
||||
if ( $skin->getUser()->isLoggedIn() ) {
|
||||
if ( $skin->getUser()->isRegistered() ) {
|
||||
$userPrefSidebarState = $skin->getUser()->getOption(
|
||||
Constants::PREF_KEY_SIDEBAR_VISIBLE
|
||||
);
|
||||
|
|
|
@ -109,7 +109,7 @@ final class SkinVersionLookup {
|
|||
$this->user->getOption(
|
||||
Constants::PREF_KEY_SKIN_VERSION,
|
||||
$this->config->get(
|
||||
$this->user->isLoggedIn()
|
||||
$this->user->isRegistered()
|
||||
? Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_EXISTING_ACCOUNTS
|
||||
: Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION
|
||||
)
|
||||
|
|
|
@ -39,7 +39,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
|
|||
|
||||
$user = $this->createMock( \User::class );
|
||||
$user
|
||||
->method( 'isLoggedIn' )
|
||||
->method( 'isRegistered' )
|
||||
->willReturn( false );
|
||||
$user
|
||||
->method( 'getOption' )
|
||||
|
@ -78,7 +78,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
|
|||
|
||||
$user = $this->createMock( \User::class );
|
||||
$user
|
||||
->method( 'isLoggedIn' )
|
||||
->method( 'isRegistered' )
|
||||
->willReturn( false );
|
||||
$user
|
||||
->method( 'getOption' )
|
||||
|
@ -108,7 +108,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
|
|||
* @covers ::getVersion
|
||||
* @covers ::isLegacy
|
||||
*/
|
||||
public function testConfigLoggedIn() {
|
||||
public function testConfigRegistered() {
|
||||
$request = $this->getMockBuilder( \WebRequest::class )->getMock();
|
||||
$request
|
||||
->method( 'getVal' )
|
||||
|
@ -117,7 +117,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
|
|||
|
||||
$user = $this->createMock( \User::class );
|
||||
$user
|
||||
->method( 'isLoggedIn' )
|
||||
->method( 'isRegistered' )
|
||||
->willReturn( true );
|
||||
$user
|
||||
->method( 'getOption' )
|
||||
|
@ -156,7 +156,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
|
|||
|
||||
$user = $this->createMock( \User::class );
|
||||
$user
|
||||
->method( 'isLoggedIn' )
|
||||
->method( 'isRegistered' )
|
||||
->willReturn( false );
|
||||
$user
|
||||
->method( 'getOption' )
|
||||
|
|
Loading…
Reference in a new issue