Index: branches/RL2/extensions/Gadgets/GadgetHooks.php |
— | — | @@ -273,13 +273,12 @@ |
274 | 274 | * @param $out OutputPage |
275 | 275 | */ |
276 | 276 | public static function beforePageDisplay( $out ) { |
277 | | - global $wgUser; |
278 | | - |
279 | 277 | wfProfileIn( __METHOD__ ); |
280 | | - |
| 278 | + |
| 279 | + $user = $out->getUser(); |
281 | 280 | $gadgets = GadgetRepo::getAllGadgets(); |
282 | 281 | foreach ( $gadgets as $gadget ) { |
283 | | - if ( $gadget->isEnabledForUser( $wgUser ) && $gadget->isAllowed( $wgUser ) ) { |
| 282 | + if ( $gadget->isEnabledForUser( $user ) && $gadget->isAllowed( $user ) ) { |
284 | 283 | $out->addModules( $gadget->getModuleName() ); |
285 | 284 | } |
286 | 285 | } |