From 39d96012ecaad2530d825f613b64a91265806f8d Mon Sep 17 00:00:00 2001 From: Nathaniel Herman Date: Sat, 29 Nov 2008 20:52:14 +0000 Subject: [PATCH] * Modified hook UserRights::showEditUserGroupsForm to actually be able to do 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 | 3 +-- includes/specials/SpecialUserrights.php | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 99c4ae2600..7a40302e0f 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 38169cc5ba..43ca318854 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -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 = ''; -- 2.20.1