jenkins-bot has submitted this change and it was merged.

Change subject: Add "User rights management" link on user page toolbox
......................................................................


Add "User rights management" link on user page toolbox

Bug: 34040
Change-Id: I507962161581c3d9ae928594d8d280be9a4ffbdd
---
M RELEASE-NOTES-1.21
M includes/SkinTemplate.php
2 files changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21
index 883fb8b..03790c8 100644
--- a/RELEASE-NOTES-1.21
+++ b/RELEASE-NOTES-1.21
@@ -115,6 +115,7 @@
   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 e1aec17..a7e567c 100644
--- a/includes/SkinTemplate.php
+++ b/includes/SkinTemplate.php
@@ -1174,6 +1174,7 @@
                $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...
@@ -1239,6 +1240,13 @@
                        if ( $this->showEmailUser( $user ) ) {
                                $nav_urls['emailuser'] = array(
                                        'href' => self::makeSpecialUrlSubpage( 
'Emailuser', $rootUser )
+                               );
+                       }
+
+                       $sur = new UserrightsPage;
+                       if ( $sur->userCanExecute( $this->getUser() ) ) {
+                               $nav_urls['userrights'] = array(
+                                       'href' => self::makeSpecialUrlSubpage( 
'UserRights', $rootUser )
                                );
                        }
                }
@@ -1439,7 +1447,7 @@
                                $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";

-- 
To view, visit https://gerrit.wikimedia.org/r/53022
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I507962161581c3d9ae928594d8d280be9a4ffbdd
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: devunt <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: devunt <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to