Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -171,6 +171,7 @@ |
172 | 172 | $wgHooks['UserSetCookies'][] = 'CentralAuthHooks::onUserSetCookies'; |
173 | 173 | $wgHooks['UserLoadDefaults'][] = 'CentralAuthHooks::onUserLoadDefaults'; |
174 | 174 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'CentralAuthHooks::onGetUserPermissionsErrorsExpensive'; |
| 175 | +$wgHooks['MakeGlobalVariablesScript'][] = 'CentralAuthHooks::onMakeGlobalVariablesScript'; |
175 | 176 | |
176 | 177 | // For interaction with the Special:Renameuser extension |
177 | 178 | $wgHooks['RenameUserWarning'][] = 'CentralAuthHooks::onRenameUserWarning'; |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -484,6 +484,17 @@ |
485 | 485 | |
486 | 486 | return true; |
487 | 487 | } |
| 488 | + |
| 489 | + static function onMakeGlobalVariablesScript( $groups ) { |
| 490 | + global $wgUser; |
| 491 | + if ( !$wgUser->isAnon() ) { |
| 492 | + $centralUser = CentralAuthUser::getInstance( $wgUser ); |
| 493 | + if ($centralUser->exists() && $centralUser->isAttached()) { |
| 494 | + $groups['wgGlobalGroups'] = $centralUser->getGlobalGroups(); |
| 495 | + } |
| 496 | + } |
| 497 | + return true; |
| 498 | + } |
488 | 499 | |
489 | 500 | /** |
490 | 501 | * Destroy local login cookies so that remote logout works |