Bug 32666 - Special:ActiveUsers should use given subpage as username and prefill...
authorJohn Du Hart <johnduhart@users.mediawiki.org>
Sat, 26 Nov 2011 20:58:15 +0000 (20:58 +0000)
committerJohn Du Hart <johnduhart@users.mediawiki.org>
Sat, 26 Nov 2011 20:58:15 +0000 (20:58 +0000)
RELEASE-NOTES-1.19
includes/specials/SpecialActiveusers.php

index 84da0da..3926365 100644 (file)
@@ -95,6 +95,8 @@ production.
   containing HTML or JS. DISABLING THESE CHECKS IS VERY DANGEROUS.
 * New path mappings can be added using the WebRequestPathInfoRouter hook
   and adding paths to the PathRouter.
+* (bug 32666) Special:ActiveUsers now allows a subpage to be used as the
+  username (eg. Special:ActiveUsers/Username)
 
 === Bug fixes in 1.19 ===
 * $wgUploadNavigationUrl should be used for file redlinks if.
index 7b65903..617a802 100644 (file)
@@ -42,13 +42,18 @@ class ActiveUsersPager extends UsersPager {
         */
        protected $groups;
 
-       function __construct( IContextSource $context = null, $group = null ) {
+       /**
+        * @param $context IContextSource
+        * @param $group null Unused
+        * @param $par string Parameter passed to the page
+        */
+       function __construct( IContextSource $context = null, $group = null, $par = null ) {
                global $wgActiveUserDays;
 
                parent::__construct( $context );
 
                $this->RCMaxAge = $wgActiveUserDays;
-               $un = $this->getRequest()->getText( 'username' );
+               $un = $this->getRequest()->getText( 'username', $par );
                $this->requestedUser = '';
                if ( $un != '' ) {
                        $username = Title::makeTitleSafe( NS_USER, $un );
@@ -192,7 +197,7 @@ class SpecialActiveUsers extends SpecialPage {
                $out->wrapWikiMsg( "<div class='mw-activeusers-intro'>\n$1\n</div>",
                        array( 'activeusers-intro', $this->getLanguage()->formatNum( $wgActiveUserDays ) ) );
 
-               $up = new ActiveUsersPager( $this->getContext() );
+               $up = new ActiveUsersPager( $this->getContext(), null, $par );
 
                # getBody() first to check, if empty
                $usersbody = $up->getBody();