r60016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60015‎ | r60016 | r60017 >
Date:20:24, 13 December 2009
Author:simetrical
Status:deferred
Tags:
Comment:
Automatically link on login if passwords match
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -394,10 +394,8 @@
395395 * This may create a local account as a side effect if the
396396 * authentication plugin allows transparent local account
397397 * creation.
398 - *
399 - * @public
400398 */
401 - function authenticateUserData() {
 399+ public function authenticateUserData() {
402400 global $wgUser, $wgAuth;
403401 if ( '' == $this->mName ) {
404402 return self::NO_NAME;
@@ -451,6 +449,15 @@
452450 $isAutoCreated = true;
453451 }
454452 } else {
 453+ global $wgExternalAuthType, $wgAutocreatePolicy;
 454+ if ( $wgExternalAuthType && $wgAutocreatePolicy != 'never'
 455+ && is_object( $this->mExtUser )
 456+ && $this->mExtUser->authenticate( $this->mPassword ) ) {
 457+ # The external user and local user have the same name and
 458+ # password, so we assume they're the same.
 459+ $this->mExtUser->linkToLocal( $u->getID() );
 460+ }
 461+
455462 $u->load();
456463 }
457464

Status & tagging log