Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -394,10 +394,8 @@ |
395 | 395 | * This may create a local account as a side effect if the |
396 | 396 | * authentication plugin allows transparent local account |
397 | 397 | * creation. |
398 | | - * |
399 | | - * @public |
400 | 398 | */ |
401 | | - function authenticateUserData() { |
| 399 | + public function authenticateUserData() { |
402 | 400 | global $wgUser, $wgAuth; |
403 | 401 | if ( '' == $this->mName ) { |
404 | 402 | return self::NO_NAME; |
— | — | @@ -451,6 +449,15 @@ |
452 | 450 | $isAutoCreated = true; |
453 | 451 | } |
454 | 452 | } 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 | + |
455 | 462 | $u->load(); |
456 | 463 | } |
457 | 464 | |