mediawiki-skins-Vector/includes/CentralAuthHooks.php
Bartosz Dziewoński 0bb02c9c57 Only show notification after CentralAuth autologin on Vector 2022
This brings in CentralAuth for phan analysis, using config patch
8063720d68ee1d2db2c37c1ad55da3fbef688bce in CI.

Bug: T345112
Change-Id: Iddd94b38f04a34dc18df8978c2bf45e8e204a85c
2023-08-30 08:53:53 -04:00

32 lines
797 B
PHP

<?php
namespace MediaWiki\Skins\Vector;
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
use MediaWiki\User\UserOptionsLookup;
use User;
/**
* @package Vector
* @internal
*/
class CentralAuthHooks implements CentralAuthIsUIReloadRecommendedHook {
private UserOptionsLookup $userOptionsLookup;
public function __construct( UserOptionsLookup $userOptionsLookup ) {
$this->userOptionsLookup = $userOptionsLookup;
}
/**
* @inheritDoc
*/
public function onCentralAuthIsUIReloadRecommended( User $user, bool &$recommendReload ) {
if ( $this->userOptionsLookup->getDefaultOption( 'skin' ) === Constants::SKIN_NAME_MODERN ) {
// Vector 2022 does not support updating the UI without reloading the page (T345112)
$recommendReload = true;
}
}
}