X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialActiveusers.php;h=994365edd3c879ec5bd1f2200869555d642f0f58;hb=bfa6a8a5b615ad30fd2ba2706d6394348920bd59;hp=156b5f2d5b5bb94b3b7eb01469333c10a676ca49;hpb=d87135d706004373b2cfdc4c588ce6d80358631f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 156b5f2d5b..994365edd3 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -93,9 +93,11 @@ class ActiveUsersPager extends UsersPager { 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 ); @@ -103,11 +105,11 @@ class ActiveUsersPager extends UsersPager { $query = array( 'tables' => array( 'recentchanges', 'user', 'ipblocks' ), - 'fields' => array( 'rc_user_text AS user_name', // inheritance + 'fields' => array( 'user_name' => 'rc_user_text', // inheritance 'rc_user_text', // for Pager 'user_id', - 'COUNT(*) AS recentedits', - 'MAX(ipb_user) AS blocked' + 'recentedits' => 'COUNT(*)', + 'ipb_deleted' => 'MAX(ipb_deleted)' ), 'options' => array( 'GROUP BY' => array( 'rc_user_text', 'user_id' ), @@ -115,7 +117,10 @@ class ActiveUsersPager extends UsersPager { ), '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 ); @@ -158,9 +163,12 @@ class ActiveUsersPager extends UsersPager { $groups = $lang->commaList( $list ); $item = $lang->specialList( $ulinks, $groups ); + if( $row->ipb_deleted ) { + $item = "$item"; + } $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}" ); }