r75041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75040‎ | r75041 | r75042 >
Date:21:17, 19 October 2010
Author:platonides
Status:reverted (Comments)
Tags:
Comment:
Add an option option to not perform a global login (bug 20852).
This also provides a solution to bug 24471 as clarified in bug 14407#c30
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.i18n.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthPlugin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthPlugin.php
@@ -249,4 +249,21 @@
250250 public function getUserInstance( User &$user ) {
251251 return CentralAuthUser::getInstance( $user );
252252 }
 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+ }
253270 }
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -101,7 +101,7 @@
102102 }
103103
104104 static function onUserLoginComplete( &$user, &$inject_html ) {
105 - global $wgCentralAuthCookies;
 105+ global $wgCentralAuthCookies, $wgRequest;
106106 if ( !$wgCentralAuthCookies ) {
107107 // Use local sessions only.
108108 return true;
@@ -121,6 +121,11 @@
122122 return true;
123123 }
124124
 125+ if ( !$wgRequest->getCheck( 'wpCentralLogin' ) ) {
 126+ // The user requested to log in just on this wiki
 127+ return true;
 128+ }
 129+
125130 wfLoadExtensionMessages( 'SpecialCentralAuth' );
126131 $inject_html .= '<div class="centralauth-login-box"><p>' .
127132 wfMsgExt( 'centralauth-login-progress', array( 'parsemag' ), $user->getName() ) . "</p>\n<p>";
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php
@@ -35,6 +35,7 @@
3636 'centralauth-merge-step2-detail' => "Some of the accounts could not be automatically matched to the designated home wiki.
3737 If these accounts belong to you, you can confirm that they are yours by providing the password for them.",
3838 'centralauth-merge-step2-submit' => 'Confirm login information',
 39+ 'centralauth-login-global' => 'Log me globally',
3940
4041 // Dry run messages
4142 'centralauth-merge-dryrun-complete' => 'All existing accounts can be automatically unified!

Follow-up revisions

RevisionCommit summaryAuthorDate
r75070Follow-up r75041 per Siebrand's suggestionraymond06:28, 20 October 2010
r91733Fix r91706 (bug 28147): removing "the" as it suggests you're logged in to *al...robin16:53, 8 July 2011
r106801* (bug 30671) CentralAuth should globally autologin user on account creation...reedy14:15, 20 December 2011
r106839Revert r75041: adds extra "do what you should always do 100% of the time" che...brion19:19, 20 December 2011

Comments

#Comment by Siebrand (talk | contribs)   21:58, 19 October 2010

+ 'centralauth-login-global' => 'Log me globally',
You mean "Log me in globally"?

#Comment by Nemo bis (talk | contribs)   08:15, 17 February 2011

Discussion on wikitech-l with revert suggestion by Brion: http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/52265

#Comment by Brion VIBBER (talk | contribs)   19:12, 20 December 2011

This is a misfeature and should be removed.

#Comment by Brion VIBBER (talk | contribs)   19:19, 20 December 2011

Reverted in r106839.

Status & tagging log