summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialListusers.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialListusers.php')
-rw-r--r--includes/specials/SpecialListusers.php34
1 files changed, 21 insertions, 13 deletions
diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php
index aa057801..bdb59980 100644
--- a/includes/specials/SpecialListusers.php
+++ b/includes/specials/SpecialListusers.php
@@ -71,10 +71,12 @@ class UsersPager extends AlphabeticPager {
}
function getQueryInfo() {
+ global $wgUser;
$dbr = wfGetDB( DB_SLAVE );
$conds = array();
// Don't show hidden names
- $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
+ if( !$wgUser->isAllowed('hideuser') )
+ $conds[] = 'ipb_deleted IS NULL';
if( $this->requestedGroup != '' ) {
$conds['ug_group'] = $this->requestedGroup;
$useIndex = '';
@@ -84,7 +86,7 @@ class UsersPager extends AlphabeticPager {
if( $this->requestedUser != '' ) {
# Sorted either by account creation or name
if( $this->creationSort ) {
- $conds[] = 'user_id >= ' . User::idFromName( $this->requestedUser );
+ $conds[] = 'user_id >= ' . intval( User::idFromName( $this->requestedUser ) );
} else {
$conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
}
@@ -97,14 +99,16 @@ class UsersPager extends AlphabeticPager {
$query = array(
'tables' => " $user $useIndex LEFT JOIN $user_groups ON user_id=ug_user
- LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 ",
+ LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0 ",
'fields' => array(
$this->creationSort ? 'MAX(user_name) AS user_name' : 'user_name',
$this->creationSort ? 'user_id' : 'MAX(user_id) AS user_id',
'MAX(user_editcount) AS edits',
'COUNT(ug_group) AS numgroups',
- 'MAX(ug_group) AS singlegroup',
- 'MIN(user_registration) AS creation'),
+ 'MAX(ug_group) AS singlegroup', // the usergroup if there is only one
+ 'MIN(user_registration) AS creation',
+ 'MAX(ipb_deleted) AS ipb_deleted' // block/hide status
+ ),
'options' => array('GROUP BY' => $this->creationSort ? 'user_id' : 'user_name'),
'conds' => $conds
);
@@ -117,7 +121,7 @@ class UsersPager extends AlphabeticPager {
global $wgLang;
$userPage = Title::makeTitle( NS_USER, $row->user_name );
- $name = $this->getSkin()->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
+ $name = $this->getSkin()->link( $userPage, htmlspecialchars( $userPage->getText() ) );
if( $row->numgroups > 1 || ( $this->requestedGroup && $row->numgroups == 1 ) ) {
$list = array();
@@ -131,11 +135,14 @@ class UsersPager extends AlphabeticPager {
}
$item = wfSpecialList( $name, $groups );
+ if( $row->ipb_deleted ) {
+ $item = "<span class=\"deleted\">$item</span>";
+ }
global $wgEdititis;
if ( $wgEdititis ) {
$editCount = $wgLang->formatNum( $row->edits );
- $edits = ' [' . wfMsgExt( 'usereditcount', 'parsemag', $editCount ) . ']';
+ $edits = ' [' . wfMsgExt( 'usereditcount', array( 'parsemag', 'escape' ), $editCount ) . ']';
} else {
$edits = '';
}
@@ -145,7 +152,8 @@ class UsersPager extends AlphabeticPager {
if( $row->creation ) {
$d = $wgLang->date( wfTimestamp( TS_MW, $row->creation ), true );
$t = $wgLang->time( wfTimestamp( TS_MW, $row->creation ), true );
- $created = ' (' . wfMsgHtml( 'usercreated', $d, $t ) . ')';
+ $created = ' (' . wfMsg( 'usercreated', $d, $t ) . ')';
+ $created = htmlspecialchars( $created );
}
wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );
@@ -185,11 +193,11 @@ class UsersPager extends AlphabeticPager {
Xml::option( wfMsg( 'group-all' ), '' );
foreach( $this->getAllGroups() as $group => $groupText )
$out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );
- $out .= Xml::closeElement( 'select' ) . '<br/>';
+ $out .= Xml::closeElement( 'select' ) . '<br />';
$out .= Xml::checkLabel( wfMsg('listusers-editsonly'), 'editsOnly', 'editsOnly', $this->editsOnly );
$out .= '&nbsp;';
$out .= Xml::checkLabel( wfMsg('listusers-creationsort'), 'creationSort', 'creationSort', $this->creationSort );
- $out .= '<br/>';
+ $out .= '<br />';
wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) );
@@ -233,7 +241,7 @@ class UsersPager extends AlphabeticPager {
/**
* Get a list of groups the specified user belongs to
*
- * @param int $uid
+ * @param $uid Integer: user id
* @return array
*/
protected static function getGroups( $uid ) {
@@ -245,13 +253,13 @@ class UsersPager extends AlphabeticPager {
/**
* Format a link to a group description page
*
- * @param string $group
+ * @param $group String: group name
* @return string
*/
protected static function buildGroupLink( $group ) {
static $cache = array();
if( !isset( $cache[$group] ) )
- $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
+ $cache[$group] = User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group ) ) );
return $cache[$group];
}
}