Revert r35476, r35479 -- breaks first login with global account when ConfirmEdit...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 28 May 2008 18:43:18 +0000 (18:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 28 May 2008 18:43:18 +0000 (18:43 +0000)
docs/hooks.txt
includes/SpecialUserlogin.php

index e0373bf..2f9291c 100644 (file)
@@ -258,7 +258,6 @@ $err: error message
 'AbortNewAccount': Return false to cancel account creation.
 $user: the User object about to be created (read-only, incomplete)
 $message: out parameter: error message to display on abort
-$autocreate: whether the account is being automatically created.
 
 'AddNewAccount': after a user account is created
 $user: the User object that was created. (Parameter added in 1.7)
index aaedc3c..58b1280 100644 (file)
@@ -296,7 +296,7 @@ class LoginForm {
                $u->setRealName( $this->mRealName );
 
                $abortError = '';
-               if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError, false /* autocreate */ ) ) ) {
+               if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
                        // Hook point to add extra creation throttles and blocks
                        wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
                        $this->mainLoginForm( $abortError );
@@ -366,7 +366,7 @@ class LoginForm {
         *
         * @public
         */
-       function authenticateUserData(&$error_extra) {
+       function authenticateUserData() {
                global $wgUser, $wgAuth;
                if ( '' == $this->mName ) {
                        return self::NO_NAME;
@@ -388,7 +388,7 @@ class LoginForm {
 
                $isAutoCreated = false;
                if ( 0 == $u->getID() ) {
-                       $status = $this->attemptAutoCreate( $u, &$error_extra );
+                       $status = $this->attemptAutoCreate( $u );
                        if ( $status !== self::SUCCESS ) {
                                return $status;
                        } else {
@@ -458,7 +458,7 @@ class LoginForm {
         * Only succeeds if there is an external authentication method which allows it.
         * @return integer Status code
         */
-       function attemptAutoCreate( $user, &$error_extra ) {
+       function attemptAutoCreate( $user ) {
                global $wgAuth, $wgUser;
                /**
                 * If the external authentication plugin allows it,
@@ -469,7 +469,6 @@ class LoginForm {
                        return self::NOT_EXISTS;
                }
                if ( !$wgAuth->userExists( $user->getName() ) ) {
-                       die("Doesn't exist: ".$user->getName());
                        wfDebug( __METHOD__.": user does not exist\n" );
                        return self::NOT_EXISTS;
                }
@@ -481,14 +480,6 @@ class LoginForm {
                        wfDebug( __METHOD__.": user is blocked from account creation\n" );
                        return self::CREATE_BLOCKED;
                }
-               
-               $abortError = '';
-               if( !wfRunHooks( 'AbortNewAccount', array( $user, &$abortError, true /* autocreate */ ) ) ) {
-                       // Hook point to add extra creation throttles and blocks
-                       wfDebug( __METHOD__.": a hook blocked creation\n" );
-                       $error_extra = $abortError;
-                       return self::ABORTED;
-               }
 
                wfDebug( __METHOD__.": creating account\n" );
                $user = $this->initUser( $user, true );
@@ -498,8 +489,7 @@ class LoginForm {
        function processLogin() {
                global $wgUser, $wgAuth;
 
-               $error_extra = '';
-               switch ($this->authenticateUserData(&$error_extra))
+               switch ($this->authenticateUserData())
                {
                        case self::SUCCESS:
                                # We've verified now, update the real record
@@ -550,9 +540,6 @@ class LoginForm {
                        case self::CREATE_BLOCKED:
                                $this->userBlockedMessage();
                                break;
-                       case self::ABORTED:
-                               $this->mainLoginForm( $error_extra );
-                               break;
                        default:
                                throw new MWException( "Unhandled case value" );
                }