r20428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20427‎ | r20428 | r20429 >
Date:01:45, 14 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Fix initialization regressions in r20382. Also, join on block table to hide hidden names
Modified paths:
  • /trunk/phase3/includes/SpecialListusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialListusers.php
@@ -40,6 +40,7 @@
4141 global $wgRequest;
4242 $this->requestedGroup = $group != "" ? $group : $wgRequest->getVal( 'group' );
4343 $un = $wgRequest->getText( 'username' );
 44+ $this->requestedUser = '';
4445 if ( $un != '' ) {
4546 $username = Title::makeTitleSafe( NS_USER, $un );
4647 $this->requestedUser = $username->getText();
@@ -54,6 +55,8 @@
5556
5657 function getQueryInfo() {
5758 $conds=array();
 59+ // don't show hidden names
 60+ $conds[]='ipb_deleted IS NULL OR ipb_deleted = 0';
5861 if ($this->requestedGroup != "") {
5962 $conds['ug_group'] = $this->requestedGroup;
6063 }
@@ -61,17 +64,18 @@
6265 $conds[] = 'user_name >= ' . wfGetDB()->addQuotes( $this->requestedUser );
6366 }
6467
65 - list ($user,$user_groups) = wfGetDB()->tableNamesN('user','user_groups');
 68+ list ($user,$user_groups,$ipblocks) = wfGetDB()->tableNamesN('user','user_groups','ipblocks');
6669
6770 return array(
68 - 'tables' => " $user LEFT JOIN $user_groups ON user_id=ug_user ",
 71+ 'tables' => " $user LEFT JOIN $user_groups ON user_id=ug_user LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 ",
6972 'fields' => array('user_name',
7073 'MAX(user_id) AS user_id',
7174 'COUNT(ug_group) AS numgroups',
7275 'MAX(ug_group) AS singlegroup'),
7376 'options' => array('GROUP BY' => 'user_name'),
7477 'conds' => $conds
75 - );
 78+ );
 79+
7680 }
7781
7882 function formatRow($row) {
@@ -144,8 +148,7 @@
145149 $groups = User::getAllGroups();
146150 foreach( $groups as $group ) {
147151 $attribs = array( 'value' => $group );
148 - if( $group == $this->requestedGroup )
149 - $attribs['selected'] = 'selected';
 152+ $attribs['selected'] = ( $group == $this->requestedGroup ) ? 'selected' : '';
150153 $out .= Xml::option( User::getGroupName( $group ), $attribs['value'], $attribs['selected'] );
151154 }
152155 $out .= Xml::closeElement( 'select' ) . ' ';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r20382Make Special:Listusers caseinsensitive for first letter...raymond08:31, 13 March 2007