From ed973eef695944dca4c874fdbaec140a142109d9 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 30 Jun 2007 04:21:09 +0000 Subject: [PATCH] (bug 10404) Show rights log fragment for the selected user in Special:Userrights --- RELEASE-NOTES | 1 + includes/SpecialUserrights.php | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bc0ab95174..8657ddf9b6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index f69a1288df..93c1f38c51 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -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( "

" . htmlspecialchars( LogPage::logName( 'rights' ) ) . "

\n" ); + $viewer->showList( $output ); + } + +} \ No newline at end of file -- 2.20.1