r107247 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107246‎ | r107247 | r107248 >
Date:23:57, 24 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Use passed $user object in hook, rather than mix of it and $wgUser
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -32,7 +32,7 @@
3333 * @return bool
3434 */
3535 static function onGetPreferences( $user, &$preferences ) {
36 - global $wgUser, $wgLang;
 36+ global $wgLang;
3737
3838 if ( !$user->isAllowed( 'centralauth-merge' ) ) {
3939 // Not allowed to merge, don't display merge information
@@ -45,7 +45,7 @@
4646 // - this local account is attached, but migration incomplete
4747 // - all local accounts are attached
4848
49 - $global = CentralAuthUser::getInstance( $wgUser );
 49+ $global = CentralAuthUser::getInstance( $user );
5050 if ( $global->exists() ) {
5151 if ( $global->isAttached() ) {
5252 // Local is attached...
@@ -78,7 +78,7 @@
7979 $manageLinks = array();
8080 $manageLinks[] = Linker::linkKnown( SpecialPage::getTitleFor( 'MergeAccount' ),
8181 wfMsgExt( 'centralauth-prefs-manage', 'parseinline' ) );
82 - $manageLinks[] = Linker::linkKnown( SpecialPage::getTitleFor( 'CentralAuth', $wgUser->getName() ),
 82+ $manageLinks[] = Linker::linkKnown( SpecialPage::getTitleFor( 'CentralAuth', $user->getName() ),
8383 wfMsgExt( 'centralauth-prefs-view', 'parseinline' ) );
8484 $manageLinkList = wfMsg( 'parentheses', $wgLang->pipeList( $manageLinks ) );
8585

Status & tagging log