From: Nathaniel Herman Date: Sat, 29 Nov 2008 20:52:14 +0000 (+0000) Subject: * Modified hook UserRights::showEditUserGroupsForm to actually be able to do X-Git-Tag: 1.31.0-rc.0~44164 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=39d96012ecaad2530d825f613b64a91265806f8d;p=lhc%2Fweb%2Fwiklou.git * 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. --- 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 = '';