X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fuser%2FLocalIdLookup.php;h=4c9099e8b6fdca06c3015826a37c82e260f77d1e;hb=3bf40e4021fbe1087ab275767d5cf367b4a32f02;hp=0a345540ffc3445931424894334579e94c9b70fa;hpb=84851a43f3ea8ea146c4d82c55fd01b9fa302347;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/LocalIdLookup.php b/includes/user/LocalIdLookup.php index 0a345540ff..4c9099e8b6 100644 --- a/includes/user/LocalIdLookup.php +++ b/includes/user/LocalIdLookup.php @@ -20,6 +20,8 @@ * @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. @@ -41,7 +43,7 @@ class LocalIdLookup extends CentralIdLookup { } // Easy case, we're checking locally - if ( $wikiId === null || $wikiId === wfWikiID() ) { + if ( $wikiId === null || WikiMap::isCurrentWikiId( $wikiId ) ) { return true; } @@ -69,7 +71,10 @@ class LocalIdLookup extends CentralIdLookup { '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'; @@ -100,7 +105,10 @@ class LocalIdLookup extends CentralIdLookup { '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';