$this->requestedGroup = '';
}
$this->editsOnly = $wgRequest->getBool( 'editsOnly' );
+ $this->creationSort = $wgRequest->getBool( 'creationSort' );
$this->requestedUser = '';
if ( $un != '' ) {
function getIndexField() {
- return 'user_name';
+ return $this->creationSort ? 'user_id' : 'user_name';
}
function getQueryInfo() {
$conds = array();
// Don't show hidden names
$conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
- if ($this->requestedGroup != "") {
+ if( $this->requestedGroup != '' ) {
$conds['ug_group'] = $this->requestedGroup;
$useIndex = '';
} else {
- $useIndex = $dbr->useIndexClause('user_name');
+ $useIndex = $dbr->useIndexClause( $this->creationSort ? 'PRIMARY' : 'user_name');
}
- if ($this->requestedUser != "") {
- $conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
+ if( $this->requestedUser != '' ) {
+ # Sorted either by account creation or name
+ if( $this->creationSort ) {
+ $conds[] = 'user_id >= ' . User::idFromName( $this->requestedUser );
+ } else {
+ $conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
+ }
}
if( $this->editsOnly ) {
$conds[] = 'user_editcount > 0';
'MAX(user_id) AS user_id',
'MAX(user_editcount) AS edits',
'COUNT(ug_group) AS numgroups',
- 'MAX(ug_group) AS singlegroup'),
+ 'MAX(ug_group) AS singlegroup',
+ 'MIN(user_registration) AS creation'),
'options' => array('GROUP BY' => 'user_name'),
'conds' => $conds
);
} else {
$edits = '';
}
+
+ $created = '';
+ # Some rows may be NULL
+ if( $row->creation ) {
+ $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->creation ), true );
+ $created = ' (' . wfMsgHtml( 'usercreated', $d ) . ')';
+ }
+
wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );
- return "<li>{$item}{$edits}</li>";
+ return "<li>{$item}{$edits}{$created}</li>";
}
function getBody() {
$out .= Xml::closeElement( 'select' ) . '<br/>';
$out .= Xml::checkLabel( wfMsg('listusers-editsonly'), 'editsOnly', 'editsOnly', $this->editsOnly );
$out .= ' ';
+ $out .= Xml::checkLabel( wfMsg('listusers-creationsort'), 'creationSort', 'creationSort', $this->creationSort );
+ $out .= '<br/>';
wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) );
# Submit button and form bottom
- if( $this->mLimit )
- $out .= Xml::hidden( 'limit', $this->mLimit );
+ $out .= Xml::hidden( 'limit', $this->mLimit );
$out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) );
wfRunHooks( 'SpecialListusersHeader', array( $this, &$out ) );
$out .= '</fieldset>' .
'protectedtitlesempty' => 'No titles are currently protected with these parameters.',
'listusers' => 'User list',
'listusers-summary' => '', # do not translate or duplicate this message to other languages
-'listusers-editsonly' => 'Show users with edits only',
+'listusers-editsonly' => 'Show only users with edits',
+'listusers-creationsort' => 'Sort by creation date',
+'usercreated' => 'Created on $1',
'usereditcount' => '$1 {{PLURAL:$1|edit|edits}}',
'newpages' => 'New pages',
'newpages-summary' => '', # do not translate or duplicate this message to other languages