/**
* @param $context IContextSource
* @param $group null Unused
- * @param $par string Parameter passed to the page
+ * @param string $par Parameter passed to the page
*/
function __construct( IContextSource $context = null, $group = null, $par = null ) {
global $wgActiveUserDays;
function getQueryInfo() {
$dbr = wfGetDB( DB_SLAVE );
$conds = array( 'rc_user > 0' ); // Users - no anons
- $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names
- $conds[] = "rc_log_type IS NULL OR rc_log_type != 'newusers'";
- $conds[] = "rc_timestamp >= '{$dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 )}'";
+ if( !$this->getUser()->isAllowed( 'hideuser' ) ) {
+ $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0'; // don't show hidden names
+ }
+ $conds[] = 'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' );
+ $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 ) );
if( $this->requestedUser != '' ) {
$conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser );
'rc_user_text', // for Pager
'user_id',
'recentedits' => 'COUNT(*)',
- 'blocked' => 'MAX(ipb_user)'
+ 'ipb_deleted' => 'MAX(ipb_deleted)'
),
'options' => array(
'GROUP BY' => array( 'rc_user_text', 'user_id' ),
),
'join_conds' => array(
'user' => array( 'INNER JOIN', 'rc_user_text=user_name' ),
- 'ipblocks' => array( 'LEFT JOIN', 'user_id=ipb_user AND ipb_auto=0 AND ipb_deleted=1' ),
+ 'ipblocks' => array( 'LEFT JOIN', array(
+ 'user_id=ipb_user',
+ 'ipb_auto' => 0
+ )),
),
'conds' => $conds
);
$groups = $lang->commaList( $list );
$item = $lang->specialList( $ulinks, $groups );
+ if( $row->ipb_deleted ) {
+ $item = "<span class=\"deleted\">$item</span>";
+ }
$count = $this->msg( 'activeusers-count' )->numParams( $row->recentedits )
->params( $userName )->numParams( $this->RCMaxAge )->escaped();
- $blocked = $row->blocked ? ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() : '';
+ $blocked = !is_null( $row->ipb_deleted ) ? ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() : '';
return Html::rawElement( 'li', array(), "{$item} [{$count}]{$blocked}" );
}
}
}
+ protected function getGroupName() {
+ return 'users';
+ }
}