Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -188,6 +188,9 @@ |
189 | 189 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'CentralAuthHooks::onGetUserPermissionsErrorsExpensive'; |
190 | 190 | $wgHooks['MakeGlobalVariablesScript'][] = 'CentralAuthHooks::onMakeGlobalVariablesScript'; |
191 | 191 | |
| 192 | +// For Special:Contributions |
| 193 | +$wgHooks['ContributionsToolLinks'][] = 'CentralAuthHooks::onContributionsToolLinks'; |
| 194 | + |
192 | 195 | // For interaction with the Special:Renameuser extension |
193 | 196 | $wgHooks['RenameUserWarning'][] = 'CentralAuthHooks::onRenameUserWarning'; |
194 | 197 | $wgHooks['RenameUserPreRename'][] = 'CentralAuthHooks::onRenameUserPreRename'; |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -605,4 +605,23 @@ |
606 | 606 | $params['url'] = $wiki->getUrl( 'User:' . str_replace( ' ', '_', $user->getName() ) ); |
607 | 607 | return true; |
608 | 608 | } |
| 609 | + |
| 610 | + public static function onContributionsToolLinks( $id, $user, &$tools ) { |
| 611 | + global $wgUser; |
| 612 | + |
| 613 | + $globalUser = CentralAuthUser::getInstance( $user ); |
| 614 | + if ( $globalUser->exists() ) { |
| 615 | + if ( $wgUser->isAllowed( 'centralauth-merge' ) ) { // Paranoia. Currently this right is assigned to '*' |
| 616 | + $sk = $wgUser->getSkin(); |
| 617 | + $tools[] = $sk->linkKnown( |
| 618 | + SpecialPage::getTitleFor( 'CentralAuth', $user->getText() ), |
| 619 | + wfMsg( 'centralauth-link-on-contribs' ), |
| 620 | + array( 'title' => wfMsgExt( 'centralauth-link-on-contribs-text', 'parseinline' ) ) |
| 621 | + ); |
| 622 | + } |
| 623 | + } else { |
| 624 | + $tools[] = wfMsg( 'centralauth-link-on-contribs-no' ); |
| 625 | + } |
| 626 | + return true; |
| 627 | + } |
609 | 628 | } |
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php |
— | — | @@ -238,6 +238,11 @@ |
239 | 239 | Renaming it will cause the local user to be detached from the global one.", |
240 | 240 | 'centralauth-renameuser-reserved' => "User $2 is reserved for a global account.", |
241 | 241 | |
| 242 | + // Interaction with Special:Contributions |
| 243 | + 'centralauth-link-on-contribs' => 'global account status', |
| 244 | + 'centralauth-link-on-contribs-text' => 'Status of the global account for this user', |
| 245 | + 'centralauth-link-on-contribs-no' => 'no global account', |
| 246 | + |
242 | 247 | // Other messages |
243 | 248 | 'centralauth-invalid-wiki' => 'No such wiki database: $1', |
244 | 249 | 'centralauth-account-exists' => 'Cannot create account: the requested username is already taken in the unified login system.', |