From: This, that and the other Date: Sat, 8 Apr 2017 07:32:53 +0000 (+1000) Subject: Add UserGroupMembership details to the UserGroupsChanged hook X-Git-Tag: 1.31.0-rc.0~3555^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=72c969d6774eebf9ce70ab9b9cd3be7f2426de2f;p=lhc%2Fweb%2Fwiklou.git Add UserGroupMembership details to the UserGroupsChanged hook For Echo. Bug: T159301 Change-Id: I5d32445f8e5b41599889b8488a2431e7a908f858 --- 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 ] );