r39269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39268‎ | r39269 | r39270 >
Date:02:37, 13 August 2008
Author:krimpet
Status:old
Tags:
Comment:
Per bug 15146, allow additional syntax for Special:Listusers URLs.

- Special:ListUsers/GROUP - if GROUP is a valid group name; the old syntax
- Special:ListUsers/USER
- Special:ListUsers/GROUP/USER

'*' and 'user' can be used as a GROUP for all users.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -35,10 +35,24 @@
3636 */
3737 class UsersPager extends AlphabeticPager {
3838
39 - function __construct($group=null) {
 39+ function __construct( $par=null ) {
4040 global $wgRequest;
41 - $this->requestedGroup = $group != "" ? $group : $wgRequest->getVal( 'group' );
42 - $un = $wgRequest->getText( 'username' );
 41+ $parms = explode( '/', ($par = ( $par !== null ) ? $par : '' ) );
 42+ $symsForAll = array( '*', 'user' );
 43+ if ( $parms[0] != '' && ( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) ) ) {
 44+ $this->requestedGroup = $par;
 45+ $un = $wgRequest->getText( 'username' );
 46+ } else if ( count( $parms ) == 2 ) {
 47+ $this->requestedGroup = $parms[0];
 48+ $un = $parms[1];
 49+ } else {
 50+ $this->requestedGroup = $wgRequest->getVal( 'group' );
 51+ $un = ( $par != '' ) ? $par : $wgRequest->getText( 'username' );
 52+ }
 53+ if ( in_array( $this->requestedGroup, $symsForAll ) ) {
 54+ $this->requestedGroup = '';
 55+ }
 56+
4357 $this->requestedUser = '';
4458 if ( $un != '' ) {
4559 $username = Title::makeTitleSafe( NS_USER, $un );

Follow-up revisions

RevisionCommit summaryAuthorDate
r39270Updated release notes to reflect features added in r39269 and r39121krimpet02:56, 13 August 2008
r39518Per request in bug 15194, add more syntax for Special:Log, similar to Special...krimpet05:06, 17 August 2008

Status & tagging log