From eb454a3f14bcb5ea7a3c79a76acb9d5b466663b7 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sat, 7 Mar 2009 18:58:52 +0000 Subject: [PATCH] add a link to Special:UserRights on Special:Contributions for privileged users. thanks to Skizzerz for patch review & fixing a little bug with my original code --- RELEASE-NOTES | 1 + includes/specials/SpecialContributions.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1c7fb95760..4238028f09 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -131,6 +131,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN LanguageConverter class) * (bug 17844) Redirect users to a specific page when they log in, see $wgRedirectOnLogin +* Added a link to Special:UserRights on Special:Contributions for privileged users === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 9c74be1710..b14bafa06d 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -165,14 +165,23 @@ class SpecialContributions extends SpecialPage { } # Other logs link $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ), - 'user=' . $nt->getPartialUrl() ); + 'user=' . $nt->getPartialUrl() ); # Add link to deleted user contributions for priviledged users if( $wgUser->isAllowed( 'deletedhistory' ) ) { - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions', + $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) ); } - + + # Add a link to change user rights for privileged users + $userrightsPage = new UserrightsPage(); + if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) { + $tools[] = $sk->makeKnownLinkObj( + SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ), + wfMsgHtml( 'userrights' ) + ); + } + wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); $links = $wgLang->pipeList( $tools ); -- 2.20.1