From 520dadee695f1f4b569a56298738361903d80892 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sat, 25 Oct 2008 22:37:56 +0000 Subject: [PATCH] added new hook, UserRights::showEditUserGroupsForm from Wikia codebase --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 5 +++++ includes/specials/SpecialUserrights.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 89dae661bb..9fbe9c5b68 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -177,6 +177,8 @@ The following extensions are migrated into MediaWiki 1.14: * Make search matches bold only, not red as well * Hook SkinTemplateTabAction now passes $title by reference allowing it to be changed by extensions. +* Added 'UserRights::showEditUserGroupsForm' hook to allow extensions to alter + the groups that the user can be added to or removed from in Special:UserRights === Bug fixes in 1.14 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 6e92807d9a..b4ea58783a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1393,6 +1393,11 @@ $addergroups : Array of groups that the user is in 'remove-self' => array( removable groups from self ) ) +'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 + 'UserRetrieveNewTalks': called when retrieving "You have new messages!" message(s) $user: user retrieving new talks messages $talks: array of new talks page(s) diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 36a6e6f795..f0ad542aba 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -351,6 +351,8 @@ class UserrightsPage extends SpecialPage { list( $addable, $removable ) = $this->splitGroups( $groups ); + wfRunHooks( 'UserRights::showEditUserGroupsForm', array( &$user, &$addable, &$removable ) ); + $list = array(); foreach( $user->getGroups() as $group ) $list[] = self::buildGroupLink( $group ); -- 2.20.1