(bug 10404) Show rights log fragment for the selected user in Special:Userrights
authorRob Church <robchurch@users.mediawiki.org>
Sat, 30 Jun 2007 04:21:09 +0000 (04:21 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 30 Jun 2007 04:21:09 +0000 (04:21 +0000)
RELEASE-NOTES
includes/SpecialUserrights.php

index bc0ab95..8657ddf 100644 (file)
@@ -113,6 +113,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 10387) Detect and handle '.php5' extension environments at install time
   Patch by Edward Z. Yang.
 * Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information
+* (bug 10404) Show rights log fragment for the selected user in Special:Userrights
 
 == Bugfixes since 1.10 ==
 
index f69a128..93c1f38 100644 (file)
@@ -154,6 +154,7 @@ class UserrightsForm extends HTMLForm {
                }
 
                $this->showEditUserGroupsForm( $username, $user->getGroups() );
+               $this->showLogFragment( $user, $wgOut );
        }
        
        /**
@@ -376,5 +377,26 @@ class UserrightsForm extends HTMLForm {
                }
                return $groups;
        }
-} // end class UserrightsForm
-
+       
+       /**
+        * Show a rights log fragment for the specified user
+        *
+        * @param User $user User to show log for
+        * @param OutputPage $output OutputPage to use
+        */
+       protected function showLogFragment( $user, $output ) {
+               $viewer = new LogViewer(
+                       new LogReader(
+                               new FauxRequest(
+                                       array(
+                                               'type' => 'rights',
+                                               'page' => $user->getUserPage()->getPrefixedUrl(),
+                                       )
+                               )
+                       )
+               );
+               $output->addHtml( "<h2>" . htmlspecialchars( LogPage::logName( 'rights' ) ) . "</h2>\n" );
+               $viewer->showList( $output );
+       }
+       
+}
\ No newline at end of file