From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/specials/SpecialListusers.php | 44 ++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'includes/specials/SpecialListusers.php') diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 1089fbbe..d253a4d3 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -36,7 +36,9 @@ class UsersPager extends AlphabeticPager { /** * @param $context IContextSource - * @param $par null|array + * @param array $par (Default null) + * @param $including boolean Whether this page is being transcluded in + * another page */ function __construct( IContextSource $context = null, $par = null, $including = null ) { if ( $context ) { @@ -89,7 +91,7 @@ class UsersPager extends AlphabeticPager { $conds = array(); // Don't show hidden names if( !$this->getUser()->isAllowed( 'hideuser' ) ) { - $conds[] = 'ipb_deleted IS NULL'; + $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0'; } $options = array(); @@ -114,7 +116,7 @@ class UsersPager extends AlphabeticPager { $options['GROUP BY'] = $this->creationSort ? 'user_id' : 'user_name'; $query = array( - 'tables' => array( 'user', 'user_groups', 'ipblocks'), + 'tables' => array( 'user', 'user_groups', 'ipblocks' ), 'fields' => array( 'user_name' => $this->creationSort ? 'MAX(user_name)' : 'user_name', 'user_id' => $this->creationSort ? 'user_id' : 'MAX(user_id)', @@ -129,7 +131,6 @@ class UsersPager extends AlphabeticPager { 'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ), 'ipblocks' => array( 'LEFT JOIN', array( 'user_id=ipb_user', - 'ipb_deleted' => 1, 'ipb_auto' => 0 )), ), @@ -152,7 +153,7 @@ class UsersPager extends AlphabeticPager { $userName = $row->user_name; $ulinks = Linker::userLink( $row->user_id, $userName ); - $ulinks .= Linker::userToolLinks( $row->user_id, $userName ); + $ulinks .= Linker::userToolLinksRedContribs( $row->user_id, $userName, intval( $row->edits ) ); $lang = $this->getLanguage(); @@ -185,9 +186,10 @@ class UsersPager extends AlphabeticPager { $created = $this->msg( 'usercreated', $d, $t, $row->user_name )->escaped(); $created = ' ' . $this->msg( 'parentheses' )->rawParams( $created )->escaped(); } + $blocked = !is_null( $row->ipb_deleted ) ? ' ' . $this->msg( 'listusers-blocked', $userName )->escaped() : ''; wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) ); - return Html::rawElement( 'li', array(), "{$item}{$edits}{$created}" ); + return Html::rawElement( 'li', array(), "{$item}{$edits}{$created}{$blocked}" ); } function doBatchLookups() { @@ -204,23 +206,32 @@ class UsersPager extends AlphabeticPager { /** * @return string */ - function getPageHeader( ) { + function getPageHeader() { global $wgScript; list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() ); # Form tag - $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) . + $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) . Xml::fieldset( $this->msg( 'listusers' )->text() ) . Html::hidden( 'title', $self ); # Username field $out .= Xml::label( $this->msg( 'listusersfrom' )->text(), 'offset' ) . ' ' . - Xml::input( 'username', 20, $this->requestedUser, array( 'id' => 'offset' ) ) . ' '; + Html::input( + 'username', + $this->requestedUser, + 'text', + array( + 'id' => 'offset', + 'size' => 20, + 'autofocus' => $this->requestedUser === '' + ) + ) . ' '; # Group drop-down list $out .= Xml::label( $this->msg( 'group' )->text(), 'group' ) . ' ' . - Xml::openElement('select', array( 'name' => 'group', 'id' => 'group' ) ) . + Xml::openElement( 'select', array( 'name' => 'group', 'id' => 'group' ) ) . Xml::option( $this->msg( 'group-all' )->text(), '' ); foreach( $this->getAllGroups() as $group => $groupText ) $out .= Xml::option( $groupText, $group, $group == $this->requestedGroup ); @@ -286,8 +297,8 @@ class UsersPager extends AlphabeticPager { /** * Format a link to a group description page * - * @param $group String: group name - * @param $username String Username + * @param string $group group name + * @param string $username Username * @return string */ protected static function buildGroupLink( $group, $username ) { @@ -298,20 +309,19 @@ class UsersPager extends AlphabeticPager { /** * @ingroup SpecialPage */ -class SpecialListUsers extends SpecialPage { +class SpecialListUsers extends IncludableSpecialPage { /** * Constructor */ public function __construct() { parent::__construct( 'Listusers' ); - $this->mIncludable = true; } /** * Show the special page * - * @param $par string (optional) A group to list users from + * @param string $par (optional) A group to list users from */ public function execute( $par ) { $this->setHeaders(); @@ -337,4 +347,8 @@ class SpecialListUsers extends SpecialPage { $this->getOutput()->addHTML( $s ); } + + protected function getGroupName() { + return 'users'; + } } -- cgit v1.2.2