* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* A CentralIdLookup provider that just uses local IDs. Useful if the wiki
* isn't part of a cluster or you're using shared user tables.
}
// Easy case, we're checking locally
- if ( $wikiId === null || $wikiId === wfWikiID() ) {
+ if ( $wikiId === null || WikiMap::isCurrentWikiId( $wikiId ) ) {
return true;
}
'user_id' => array_map( 'intval', array_keys( $idToName ) ),
];
$join = [];
- if ( $audience && !$audience->isAllowed( 'hideuser' ) ) {
+ if ( $audience && !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $audience, 'hideuser' )
+ ) {
$tables[] = 'ipblocks';
$join['ipblocks'] = [ 'LEFT JOIN', 'ipb_user=user_id' ];
$fields[] = 'ipb_deleted';
'user_name' => array_map( 'strval', array_keys( $nameToId ) ),
];
$join = [];
- if ( $audience && !$audience->isAllowed( 'hideuser' ) ) {
+ if ( $audience && !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $audience, 'hideuser' )
+ ) {
$tables[] = 'ipblocks';
$join['ipblocks'] = [ 'LEFT JOIN', 'ipb_user=user_id' ];
$where[] = 'ipb_deleted = 0 OR ipb_deleted IS NULL';