From 17e17ba57660c480fd2e5ae0b1098225ab3fca80 Mon Sep 17 00:00:00 2001 From: JuneHyeon Bae Date: Sun, 10 Mar 2013 18:55:14 +0900 Subject: [PATCH] Add "User rights management" link on user page toolbox Bug: 34040 Change-Id: I507962161581c3d9ae928594d8d280be9a4ffbdd --- RELEASE-NOTES-1.21 | 1 + includes/SkinTemplate.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 883fb8ba58..03790c850b 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -115,6 +115,7 @@ production. uz, vi. * Added 'CategoryAfterPageAdded' and 'CategoryAfterPageRemoved' hooks. * (bug 33186) Add image rotation api "imagerotate" +* (bug 34040) Add "User rights management" link on user page toolbox. === Bug fixes in 1.21 === * (bug 40353) SpecialDoubleRedirect should support interwiki redirects. diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index e1aec17f03..a7e567c29d 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1174,6 +1174,7 @@ class SkinTemplate extends Skin { $nav_urls['log'] = false; $nav_urls['blockip'] = false; $nav_urls['emailuser'] = false; + $nav_urls['userrights'] = false; // A print stylesheet is attached to all pages, but nobody ever // figures that out. :) Add a link... @@ -1241,6 +1242,13 @@ class SkinTemplate extends Skin { 'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser ) ); } + + $sur = new UserrightsPage; + if ( $sur->userCanExecute( $this->getUser() ) ) { + $nav_urls['userrights'] = array( + 'href' => self::makeSpecialUrlSubpage( 'UserRights', $rootUser ) + ); + } } wfProfileOut( __METHOD__ ); @@ -1439,7 +1447,7 @@ abstract class BaseTemplate extends QuickTemplate { $toolbox['feeds']['links'][$key]['class'] = 'feedlink'; } } - foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ) { + foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'userrights', 'upload', 'specialpages' ) as $special ) { if ( isset( $this->data['nav_urls'][$special] ) && $this->data['nav_urls'][$special] ) { $toolbox[$special] = $this->data['nav_urls'][$special]; $toolbox[$special]['id'] = "t-$special"; -- 2.20.1