X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FUser.php;h=1c894a0f346687767264650763bb952ed20b0c87;hb=5fa4cdf860c79b32ab6ef034c6d9420c2727f695;hp=6115144d1bc48ff4c7d71e377ce3396c02a629dc;hpb=8998c0a0d5fa103c31abfb6dd90cfc2a72de5927;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/User.php b/includes/user/User.php index 6115144d1b..1c894a0f34 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -1462,15 +1462,17 @@ class User implements IDBAccessObject { } $oldGroups = $this->getGroups(); // previous groups + $oldUGMs = $this->getGroupMemberships(); foreach ( $toPromote as $group ) { $this->addGroup( $group ); } + $newGroups = array_merge( $oldGroups, $toPromote ); // all groups + $newUGMs = $this->getGroupMemberships(); + // update groups in external authentication database - Hooks::run( 'UserGroupsChanged', [ $this, $toPromote, [], false, false ] ); + Hooks::run( 'UserGroupsChanged', [ $this, $toPromote, [], false, false, $oldUGMs, $newUGMs ] ); AuthManager::callLegacyAuthPlugin( 'updateExternalDBGroups', [ $this, $toPromote ] ); - $newGroups = array_merge( $oldGroups, $toPromote ); // all groups - $logEntry = new ManualLogEntry( 'rights', 'autopromote' ); $logEntry->setPerformer( $this ); $logEntry->setTarget( $this->getUserPage() );