jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/347143 )

Change subject: Add UserGroupMembership details to the UserGroupsChanged hook
......................................................................


Add UserGroupMembership details to the UserGroupsChanged hook

For Echo.

Bug: T159301
Change-Id: I5d32445f8e5b41599889b8488a2431e7a908f858
---
M docs/hooks.txt
M includes/specials/SpecialUserrights.php
2 files changed, 6 insertions(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Anomie: Looks good to me, approved



diff --git a/docs/hooks.txt b/docs/hooks.txt
index bee4477..af0eb06 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3589,6 +3589,10 @@
 $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 b33aa7d..127b530 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -387,7 +387,8 @@
                $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 ]
                );

-- 
To view, visit https://gerrit.wikimedia.org/r/347143
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d32445f8e5b41599889b8488a2431e7a908f858
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to