From: Alexandre Emsenhuber Date: Tue, 2 Feb 2010 15:59:47 +0000 (+0000) Subject: * (bug 21518) Special:UserRights no longer displays the user name box for users that... X-Git-Tag: 1.31.0-rc.0~37974 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=8689879ad13f8232be364cad80984755e7685385;p=lhc%2Fweb%2Fwiklou.git * (bug 21518) Special:UserRights no longer displays the user name box for users that can only change their rights * changed empty() to !count() * break line at 80 chars in RELEASE-NOTES --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4e9f643b8d..17b8ea3a4e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -730,7 +730,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 21870) No longer include Google logo from an external server on wiki error. * (bug 22181) Do not truncate if the ellipsis actually make the string longer * (bug 16039) Text disappearing after a bad image -* (bug 18784) Internal links like [[File:Foo|caption]] should read 'caption', not 'File:Foo' when Foo is not an image +* (bug 18784) Internal links like [[File:Foo|caption]] should read 'caption', + not 'File:Foo' when Foo is not an image +* (bug 21518) Special:UserRights no longer displays the user name box for users + that can only change their rights == API changes in 1.16 == diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index d3c9a31aa1..59dabf90c4 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -65,14 +65,15 @@ class UserrightsPage extends SpecialPage { return; } + $available = $this->changeableGroups(); + if ( !$this->mTarget ) { /* * If the user specified no target, and they can only * edit their own groups, automatically set them as the * target. */ - $available = $this->changeableGroups(); - if ( empty( $available['add'] ) && empty( $available['remove'] ) ) + if ( !count( $available['add'] ) && !count( $available['remove'] ) ) $this->mTarget = $wgUser->getName(); } @@ -100,7 +101,8 @@ class UserrightsPage extends SpecialPage { $this->setHeaders(); // show the general form - $this->switchForm(); + if ( count( $available['add'] ) || count( $available['remove'] ) ) + $this->switchForm(); if( $wgRequest->wasPosted() ) { // save settings