* (bug 21518) Special:UserRights no longer displays the user name box for users that...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 2 Feb 2010 15:59:47 +0000 (15:59 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 2 Feb 2010 15:59:47 +0000 (15:59 +0000)
* changed empty() to !count()
* break line at 80 chars in RELEASE-NOTES

RELEASE-NOTES
includes/specials/SpecialUserrights.php

index 4e9f643..17b8ea3 100644 (file)
@@ -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 ==
 
index d3c9a31..59dabf9 100644 (file)
@@ -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