* Modified hook UserRights::showEditUserGroupsForm to actually be able to do
authorNathaniel Herman <pinky@users.mediawiki.org>
Sat, 29 Nov 2008 20:52:14 +0000 (20:52 +0000)
committerNathaniel Herman <pinky@users.mediawiki.org>
Sat, 29 Nov 2008 20:52:14 +0000 (20:52 +0000)
  something, before it was using $addable and $removable which are not used in
  the showEditUserGroupsForm function since r32610, now it uses $groups instead.
* Changed a $user->getGroups call in showEditUserGroupsForm to use $groups
  instead, the function is passed $groups, which is supposed to be an array of
  groups the user is in, so no point in getting the array again
* Removed a useless line of code in showEditUserGroupsForm
  "list( $addable, $removable ) = $this->splitGroups( $groups );"
  this was never removed from when $addable and $removable were changed to
  just $groups, and so it does nothing and is just confusing.

docs/hooks.txt
includes/specials/SpecialUserrights.php

index 99c4ae2..7a40302 100644 (file)
@@ -1403,8 +1403,7 @@ $addergroups : Array of groups that the user is in
 
 'UserRights::showEditUserGroupsForm': called right before the form to edit group memberships at Special:UserRights is shown
 &$user: User or UserRightsProxy you're editing
-&$addable: Array of groups you can add the user into
-&$removable: Array of groups that you can remove the user from
+&$groups: Array of groups the user is in
 
 'UserRetrieveNewTalks': called when retrieving "You have new messages!" message(s)
 $user: user retrieving new talks messages
index 38169cc..43ca318 100644 (file)
@@ -349,12 +349,10 @@ class UserrightsPage extends SpecialPage {
        protected function showEditUserGroupsForm( $user, $groups ) {
                global $wgOut, $wgUser, $wgLang;
 
-               list( $addable, $removable ) = $this->splitGroups( $groups );
-
-               wfRunHooks( 'UserRights::showEditUserGroupsForm', array( &$user, &$addable, &$removable ) );
+               wfRunHooks( 'UserRights::showEditUserGroupsForm', array( &$user, &$groups ) );
 
                $list = array();
-               foreach( $user->getGroups() as $group )
+               foreach( $groups as $group )
                        $list[] = self::buildGroupLink( $group );
 
                $grouplist = '';