Index: trunk/phase3/includes/User.php |
— | — | @@ -3492,23 +3492,32 @@ |
3493 | 3493 | |
3494 | 3494 | /** |
3495 | 3495 | * Add a newuser log entry for this user |
| 3496 | + * @param $creator User who |
3496 | 3497 | * @param $byEmail Boolean: account made by email? |
3497 | 3498 | */ |
3498 | | - public function addNewUserLogEntry( $byEmail = false ) { |
| 3499 | + public function addNewUserLogEntry( $creator, $byEmail = false ) { |
3499 | 3500 | global $wgUser, $wgContLang, $wgNewUserLog; |
3500 | 3501 | if( empty($wgNewUserLog) ) { |
3501 | 3502 | return true; // disabled |
3502 | 3503 | } |
3503 | 3504 | $talk = $wgContLang->getFormattedNsText( NS_TALK ); |
3504 | | - if( $this->getName() == $wgUser->getName() ) { |
| 3505 | + if( $creator != $wgUser ) { |
3505 | 3506 | $action = 'create'; |
3506 | 3507 | $message = ''; |
3507 | 3508 | } else { |
3508 | 3509 | $action = 'create2'; |
3509 | | - $message = $byEmail ? wfMsgForContent( 'newuserlog-byemail' ) : ''; |
| 3510 | + $message = $byEmail |
| 3511 | + ? wfMsgForContent( 'newuserlog-byemail' ) |
| 3512 | + : ''; |
3510 | 3513 | } |
3511 | 3514 | $log = new LogPage( 'newusers' ); |
3512 | | - $log->addEntry( $action, $this->getUserPage(), $message, array( $this->getId() ) ); |
| 3515 | + $log->addEntry( |
| 3516 | + $action, |
| 3517 | + $this->getUserPage(), |
| 3518 | + $message, |
| 3519 | + array( $this->getId() ), |
| 3520 | + $creator |
| 3521 | + ); |
3513 | 3522 | return true; |
3514 | 3523 | } |
3515 | 3524 | |
Index: trunk/phase3/includes/Login.php |
— | — | @@ -298,11 +298,11 @@ |
299 | 299 | * Db errors etc). |
300 | 300 | */ |
301 | 301 | protected function initUser( $autocreate=false, $byEmail=false ) { |
302 | | - global $wgAuth; |
| 302 | + global $wgAuth, $wgUser; |
303 | 303 | |
304 | 304 | $fields = array( |
305 | 305 | 'name' => $this->mName, |
306 | | - 'password' => $byEmail ? null : $this->mPassword, |
| 306 | + 'password' => $byEmail ? null : User::crypt( $this->mPassword ), |
307 | 307 | 'email' => $this->mEmail, |
308 | 308 | 'options' => array( |
309 | 309 | 'rememberpassword' => $this->mRemember ? 1 : 0, |
— | — | @@ -332,8 +332,11 @@ |
333 | 333 | $ssUpdate->doUpdate(); |
334 | 334 | if( $autocreate ) |
335 | 335 | $this->mUser->addNewUserLogEntryAutoCreate(); |
| 336 | + elseif( $wgUser->isAnon() ) |
| 337 | + # Avoid spamming IP addresses all over the newuser log |
| 338 | + $this->mUser->addNewUserLogEntry( $this->mUser, $byEmail ); |
336 | 339 | else |
337 | | - $this->mUser->addNewUserLogEntry( $byEmail ); |
| 340 | + $this->mUser->addNewUserLogEntry( $wgUser, $byEmail ); |
338 | 341 | |
339 | 342 | # Run hooks |
340 | 343 | wfRunHooks( 'AddNewAccount', array( $this->mUser ) ); |
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php |
— | — | @@ -493,6 +493,7 @@ |
494 | 494 | $wgOut->returnToMain( false, $this->returnTo() ); |
495 | 495 | } |
496 | 496 | |
| 497 | + # FIXME: this should probably use a Login method |
497 | 498 | function createUser( $openid, $sreg, $name ) { |
498 | 499 | global $wgAuth; |
499 | 500 | |
— | — | @@ -504,7 +505,7 @@ |
505 | 506 | } |
506 | 507 | |
507 | 508 | $user->addToDatabase(); |
508 | | - $user->addNewUserLogEntry(); |
| 509 | + $user->addNewUserLogEntry( $user ); |
509 | 510 | |
510 | 511 | if ( !$user->getId() ) { |
511 | 512 | wfDebug( "OpenID: Error adding new user.\n" ); |