From: umherirrender Date: Mon, 29 Dec 2014 21:44:56 +0000 (+0100) Subject: Add batch lookup for user groups and titles on Special:ActiveUsers X-Git-Tag: 1.31.0-rc.0~12795^2 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=c4030ede03e69ed7431bd21d138249057e74be36;p=lhc%2Fweb%2Fwiklou.git Add batch lookup for user groups and titles on Special:ActiveUsers Call parent of doBatchLookups to get the LinkBatch for the userpages. Use than the populated user group cache to get the groups from to display them. Follow-Up: I4a945f83ad28edf5cc040139943cf743cb3d133c Change-Id: Ibbabf40d60dd9f8e3667cf17455e7582b4ee472a --- diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index fe06375822..ff632439b7 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -124,6 +124,8 @@ class ActiveUsersPager extends UsersPager { } function doBatchLookups() { + parent::doBatchLookups(); + $uids = array(); foreach ( $this->mResult as $row ) { $uids[] = $row->user_id; @@ -172,7 +174,8 @@ class ActiveUsersPager extends UsersPager { // Note: This is a different loop than for user rights, // because we're reusing it to build the group links // at the same time - foreach ( $user->getGroups() as $group ) { + $groups_list = self::getGroups( intval( $row->user_id ), $this->userGroupCache ); + foreach ( $groups_list as $group ) { if ( in_array( $group, $this->hideGroups ) ) { return ''; } diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 0b40d2f1e7..28e980c9a2 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -37,7 +37,7 @@ class UsersPager extends AlphabeticPager { /** * @var array A array with user ids as key and a array of groups as value */ - private $userGroupCache; + protected $userGroupCache; /** * @param IContextSource $context