From 144c4431d9226db67f8b77a5378ab61d8513144f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 30 Apr 2006 05:36:00 +0000 Subject: [PATCH] Emergency revert of r 13955, serious privacy violation --- includes/SpecialUserlogin.php | 48 +++++++++++++---------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 1fdf9752ae..caedffbcad 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -135,41 +135,27 @@ class LoginForm { */ function addNewAccount() { global $wgUser, $wgEmailAuthentication; - - # Create the account and abort if there's a problem doing so + $u = $this->addNewAccountInternal(); - if( $u == NULL ) + + if ($u == NULL) { return; - - # Save user settings and send out an email authentication message if needed - $u->saveSettings(); - if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) ) - $u->sendConfirmationMail(); - - # Call hooks + } + + $wgUser = $u; + $wgUser->setCookies(); + + $wgUser->saveSettings(); + if( $wgEmailAuthentication && $wgUser->isValidEmailAddr( $wgUser->getEmail() ) ) { + $wgUser->sendConfirmationMail(); + } + wfRunHooks( 'AddNewAccount', array( $u ) ); - - # If not logged in, assume the new account as the current one and set session cookies - # then show a "welcome" message or a "need cookies" message as needed - if( $wgUser->isAnon() ) { - $wgUser = $u; - $wgUser->setCookies(); - if( $this->hasSessionCookie() ) { - return $this->successfulLogin( wfMsg( 'welcomecreation', $wgUser->getName() ), false ); - } else { - return $this->cookieRedirectCheck( 'new' ); - } + + if( $this->hasSessionCookie() ) { + return $this->successfulLogin( wfMsg( 'welcomecreation', $wgUser->getName() ), false ); } else { - # Confirm that the account was created - global $wgOut; - $skin = $wgUser->getSkin(); - $self = Title::makeTitle( NS_SPECIAL, 'Userlogin' ); - $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) ); - $wgOut->setArticleRelated( false ); - $wgOut->setRobotPolicy( 'noindex,nofollow' ); - $wgOut->addHtml( wfMsgWikiHtml( 'accountcreatedtext', $u->getName() ) ); - $wgOut->returnToMain( $self->getPrefixedText() ); - return true; + return $this->cookieRedirectCheck( 'new' ); } } -- 2.20.1