Index: trunk/extensions/CentralAuth/CentralAuthPlugin.php |
— | — | @@ -249,4 +249,21 @@ |
250 | 250 | public function getUserInstance( User &$user ) { |
251 | 251 | return CentralAuthUser::getInstance( $user ); |
252 | 252 | } |
| 253 | + |
| 254 | + public function modifyUITemplate( &$template, &$type ) { |
| 255 | + global $wgCentralAuthCookies; |
| 256 | + |
| 257 | + $template->set( 'usedomain', false ); |
| 258 | + |
| 259 | + if ( !$wgCentralAuthCookies ) return; |
| 260 | + |
| 261 | + $label = Xml::checkLabel( wfMsg( 'centralauth-login-global' ), 'wpCentralLogin', 'wpCentralLogin', true, array( 'tabindex' => '4' ) ); |
| 262 | + $field = <<<HTML |
| 263 | + <tr id="mw-centralauth-login"> |
| 264 | + <td></td> |
| 265 | + <td class="mw-input">$label</td> |
| 266 | + </tr> |
| 267 | +HTML; |
| 268 | + $template->set( 'extrafields', $field ); |
| 269 | + } |
253 | 270 | } |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | } |
103 | 103 | |
104 | 104 | static function onUserLoginComplete( &$user, &$inject_html ) { |
105 | | - global $wgCentralAuthCookies; |
| 105 | + global $wgCentralAuthCookies, $wgRequest; |
106 | 106 | if ( !$wgCentralAuthCookies ) { |
107 | 107 | // Use local sessions only. |
108 | 108 | return true; |
— | — | @@ -121,6 +121,11 @@ |
122 | 122 | return true; |
123 | 123 | } |
124 | 124 | |
| 125 | + if ( !$wgRequest->getCheck( 'wpCentralLogin' ) ) { |
| 126 | + // The user requested to log in just on this wiki |
| 127 | + return true; |
| 128 | + } |
| 129 | + |
125 | 130 | wfLoadExtensionMessages( 'SpecialCentralAuth' ); |
126 | 131 | $inject_html .= '<div class="centralauth-login-box"><p>' . |
127 | 132 | wfMsgExt( 'centralauth-login-progress', array( 'parsemag' ), $user->getName() ) . "</p>\n<p>"; |
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | 'centralauth-merge-step2-detail' => "Some of the accounts could not be automatically matched to the designated home wiki. |
37 | 37 | If these accounts belong to you, you can confirm that they are yours by providing the password for them.", |
38 | 38 | 'centralauth-merge-step2-submit' => 'Confirm login information', |
| 39 | + 'centralauth-login-global' => 'Log me globally', |
39 | 40 | |
40 | 41 | // Dry run messages |
41 | 42 | 'centralauth-merge-dryrun-complete' => 'All existing accounts can be automatically unified! |