r48140 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48139‎ | r48140 | r48141 >
Date:18:58, 7 March 2009
Author:ashley
Status:ok (Comments)
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -165,14 +165,23 @@
166166 }
167167 # Other logs link
168168 $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ),
169 - 'user=' . $nt->getPartialUrl() );
 169+ 'user=' . $nt->getPartialUrl() );
170170
171171 # Add link to deleted user contributions for priviledged users
172172 if( $wgUser->isAllowed( 'deletedhistory' ) ) {
173 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
 173+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
174174 $nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) );
175175 }
176 -
 176+
 177+ # Add a link to change user rights for privileged users
 178+ $userrightsPage = new UserrightsPage();
 179+ if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
 180+ $tools[] = $sk->makeKnownLinkObj(
 181+ SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
 182+ wfMsgHtml( 'userrights' )
 183+ );
 184+ }
 185+
177186 wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
178187
179188 $links = $wgLang->pipeList( $tools );
Index: trunk/phase3/RELEASE-NOTES
@@ -131,6 +131,7 @@
132132 LanguageConverter class)
133133 * (bug 17844) Redirect users to a specific page when they log in, see
134134 $wgRedirectOnLogin
 135+* Added a link to Special:UserRights on Special:Contributions for privileged users
135136
136137 === Bug fixes in 1.15 ===
137138 * (bug 16968) Special:Upload no longer throws useless warnings.

Comments

#Comment by Aaron Schulz (talk | contribs)   20:58, 7 March 2009

This is getting a tad cluttered it seems :/

#Comment by Brion VIBBER (talk | contribs)   03:07, 25 March 2009

I'll allow it for now since I was wanting such a link, but I'm filing bug 18144 to plansome UI refactoring on these...

Status & tagging log