Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / includes / user / User.php
index 6115144..1c894a0 100644 (file)
@@ -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() );