r67785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67784‎ | r67785 | r67786 >
Date:08:30, 10 June 2010
Author:ialex
Status:deferred
Tags:
Comment:
Set $wgUser to the new user before calling addNewUserLogEntry() since this method check $wgUser to add the correct log entry...
Modified paths:
  • /trunk/extensions/OpenID/SpecialOpenIDLogin.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php
@@ -393,8 +393,6 @@
394394 return;
395395 }
396396
397 - $wgUser = $user;
398 -
399397 $this->clearValues();
400398
401399 $this->displaySuccessLogin( $openid );
@@ -462,7 +460,7 @@
463461 if ($wgOpenIDUseEmailAsNickname) {
464462 $name = $this->getNameFromEmail( $openid, $sreg, $ax );
465463 if ( !empty($name) && $this->userNameOk( $name ) ) {
466 - $wgUser = $this->createUser( $openid, $sreg, $ax, $name );
 464+ $user = $this->createUser( $openid, $sreg, $ax, $name );
467465 $this->displaySuccessLogin( $openid );
468466 return;
469467 }
@@ -588,7 +586,7 @@
589587 }
590588
591589 function createUser( $openid, $sreg, $ax, $name ) {
592 - global $wgAuth;
 590+ global $wgUser, $wgAuth;
593591
594592 $user = User::newFromName( $name );
595593
@@ -598,7 +596,6 @@
599597 }
600598
601599 $user->addToDatabase();
602 - $user->addNewUserLogEntry();
603600
604601 if ( !$user->getId() ) {
605602 wfDebug( "OpenID: Error adding new user.\n" );
@@ -606,6 +603,9 @@
607604 $wgAuth->initUser( $user );
608605 $wgAuth->updateUser( $user );
609606
 607+ $wgUser = $user;
 608+ $user->addNewUserLogEntry();
 609+
610610 # Update site stats
611611 $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
612612 $ssUpdate->doUpdate();

Follow-up revisions

RevisionCommit summaryAuthorDate
r67787Fix for r67785: let the user log in when attaching its OpenID to an existing ...ialex08:37, 10 June 2010

Status & tagging log