r61873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61872‎ | r61873 | r61874 >
Date:20:45, 2 February 2010
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* (bug 21593) Special:UserRights now lists automatic groups membership
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -977,6 +977,7 @@
978978 'userrights-editusergroup',
979979 'saveusergroups',
980980 'userrights-groupsmember',
 981+ 'userrights-groupsmember-auto',
981982 'userrights-groups-help',
982983 'userrights-reason',
983984 'userrights-no-interwiki',
Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -403,11 +403,22 @@
404404 foreach( $groups as $group )
405405 $list[] = self::buildGroupLink( $group );
406406
 407+ $autolist = array();
 408+ if ( $user instanceof User ) {
 409+ foreach( Autopromote::getAutopromoteGroups( $user ) as $group ) {
 410+ $autolist[] = self::buildGroupLink( $group );
 411+ }
 412+ }
 413+
407414 $grouplist = '';
408415 if( count( $list ) > 0 ) {
409416 $grouplist = wfMsgHtml( 'userrights-groupsmember' );
410 - $grouplist = '<p>' . $grouplist . ' ' . $wgLang->listToText( $list ) . '</p>';
 417+ $grouplist = '<p>' . $grouplist . ' ' . $wgLang->listToText( $list ) . "</p>\n";
411418 }
 419+ if( count( $autolist ) > 0 ) {
 420+ $autogrouplistintro = wfMsgHtml( 'userrights-groupsmember-auto' );
 421+ $grouplist .= '<p>' . $autogrouplistintro . ' ' . $wgLang->listToText( $autolist ) . "</p>\n";
 422+ }
412423 $wgOut->addHTML(
413424 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) .
414425 Xml::hidden( 'user', $this->mTarget ) .
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1801,6 +1801,7 @@
18021802 'userrights-editusergroup' => 'Edit user groups',
18031803 'saveusergroups' => 'Save user groups',
18041804 'userrights-groupsmember' => 'Member of:',
 1805+'userrights-groupsmember-auto' => 'Implicit member of:',
18051806 'userrights-groups-help' => 'You may alter the groups this user is in:
18061807 * A checked box means the user is in that group.
18071808 * An unchecked box means the user is not in that group.
Index: trunk/phase3/RELEASE-NOTES
@@ -734,6 +734,7 @@
735735 not 'File:Foo' when Foo is not an image
736736 * (bug 21518) Special:UserRights no longer displays the user name box for users
737737 that can only change their rights
 738+* (bug 21593) Special:UserRights now lists automatic groups membership
738739
739740 == API changes in 1.16 ==
740741

Comments

#Comment by Simetrical (talk | contribs)   19:00, 4 February 2010

I don't think this is the right place. Special:UserRights is to change user groups, not view them. You can't even view the page if you're unprivileged. This should be at Special:ListUsers IMO.

#Comment by IAlex (talk | contribs)   19:21, 4 February 2010

This could be useful if there're "implicit" groups and "normal" groups that have the same meaning (like the "autoconfirmed" and "confirmed" groups we have on Wikimedia). The problem with Special:ListUsers is that we need to "calculate" it for each user and when there's a limit to 5000 users, this might take a really long time.

#Comment by Simetrical (talk | contribs)   19:23, 4 February 2010

Why might it take a long time, as long as you grab the right columns from the user table (when you're querying it anyway)?

#Comment by IAlex (talk | contribs)   20:00, 4 February 2010

Right, it seems that we're already calculating it on Special:Listusers. I don't see why this shouldn't be displayed on Special:UserRights, this doesn't mean that they couldn't be displayed on Special:ListUsers.

#Comment by Simetrical (talk | contribs)   00:23, 5 February 2010

Okay, reasonable point.

Status & tagging log