mediawiki-skins-Vector/includes/CentralAuthHooks.php
Umherirrender f8ffcd20d2 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: I9b8f447ea4d715bc815cc782184bca288ee001a0
2024-01-02 20:54:08 +01:00

32 lines
820 B
PHP

<?php
namespace MediaWiki\Skins\Vector;
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
use MediaWiki\User\Options\UserOptionsLookup;
use MediaWiki\User\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;
}
}
}