41 if ( !$user->
getId() ) {
58 array $idToName, $audience = self::AUDIENCE_PUBLIC, $flags = self::READ_NORMAL
69 $fields = [
'user_id',
'user_name' ];
71 'user_id' => array_map(
'intval', array_keys( $idToName ) ),
74 if ( $audience && !MediaWikiServices::getInstance()
76 ->userHasRight( $audience,
'hideuser' )
78 $tables[] =
'ipblocks';
79 $join[
'ipblocks'] = [
'LEFT JOIN',
'ipb_user=user_id' ];
80 $fields[] =
'ipb_deleted';
83 $res = $db->select( $tables, $fields, $where, __METHOD__, $options, $join );
84 foreach (
$res as $row ) {
85 $idToName[$row->user_id] = empty( $row->ipb_deleted ) ? $row->user_name :
'';
92 array $nameToId, $audience = self::AUDIENCE_PUBLIC, $flags = self::READ_NORMAL
102 $tables = [
'user' ];
103 $fields = [
'user_id',
'user_name' ];
105 'user_name' => array_map(
'strval', array_keys( $nameToId ) ),
108 if ( $audience && !MediaWikiServices::getInstance()
110 ->userHasRight( $audience,
'hideuser' )
112 $tables[] =
'ipblocks';
113 $join[
'ipblocks'] = [
'LEFT JOIN',
'ipb_user=user_id' ];
114 $where[] =
'ipb_deleted = 0 OR ipb_deleted IS NULL';
117 $res = $db->select( $tables, $fields, $where, __METHOD__, $options, $join );
118 foreach (
$res as $row ) {
119 $nameToId[$row->user_name] = (int)$row->user_id;