From 72c969d6774eebf9ce70ab9b9cd3be7f2426de2f Mon Sep 17 00:00:00 2001 From: "This, that and the other" Date: Sat, 8 Apr 2017 17:32:53 +1000 Subject: [PATCH] Add UserGroupMembership details to the UserGroupsChanged hook For Echo. Bug: T159301 Change-Id: I5d32445f8e5b41599889b8488a2431e7a908f858 --- docs/hooks.txt | 4 ++++ includes/specials/SpecialUserrights.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index bee4477875..af0eb06152 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -3589,6 +3589,10 @@ $removed: Groups removed $performer: User who performed the change, false if via autopromotion $reason: The reason, if any, given by the user performing the change, false if via autopromotion. +$oldUGMs: An associative array (group name => UserGroupMembership object) of +the user's group memberships before the change. +$newUGMs: An associative array (group name => UserGroupMembership object) of +the user's current group memberships. 'UserIsBlockedFrom': Check if a user is blocked from a specific page (for specific block exemptions). diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index b33aa7db32..127b530e0f 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -387,7 +387,8 @@ class UserrightsPage extends SpecialPage { $user->invalidateCache(); // update groups in external authentication database - Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(), $reason ] ); + Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(), + $reason, $oldUGMs, $newUGMs ] ); MediaWiki\Auth\AuthManager::callLegacyAuthPlugin( 'updateExternalDBGroups', [ $user, $add, $remove ] ); -- 2.20.1