* Fix regression in authentication hook auto-creation on login
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 30 Nov 2006 20:55:44 +0000 (20:55 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 30 Nov 2006 20:55:44 +0000 (20:55 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php

index 5a72c0b..ea652b6 100644 (file)
@@ -228,7 +228,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   images, not horizontally.
 * Patch from LeonWP: added UploadForm:BeforeProcessing hook in SpecialUpload.php
 * Add AuthPluginSetup hook to override $wgAuth after configuration
-* (bug 1331) Add "next page" link to bottom of Special:Allpages in chunk mode
+* Fix regression in authentication hook auto-creation on login
 
 
 == Languages updated ==
index 7205043..d43d249 100644 (file)
@@ -296,7 +296,7 @@ class LoginForm {
         * @return User object.
         * @private
         */
-       function &initUser( &$u ) {
+       function initUser( $u ) {
                $u->addToDatabase();
                $u->setPassword( $this->mPassword );
                $u->setEmail( $this->mEmail );
@@ -307,16 +307,21 @@ class LoginForm {
                $wgAuth->initUser( $u );
 
                $u->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
+               $u->saveSettings();
 
                return $u;
        }
 
        /**
+        * Internally authenticate the login request.
+        *
+        * This may create a local account as a side effect if the
+        * authentication plugin allows transparent local account
+        * creation.
+        *
         * @public
         */
-       
-       function authenticateUserData()
-       {
+       function authenticateUserData() {
                global $wgUser, $wgAuth;
                if ( '' == $this->mName ) {
                        return self::NO_NAME;
@@ -334,7 +339,7 @@ class LoginForm {
                         */
                        if ( $wgAuth->autoCreate() && $wgAuth->userExists( $u->getName() ) ) {
                                if ( $wgAuth->authenticate( $u->getName(), $this->mPassword ) ) {
-                                       $u =& $this->initUser( $u );
+                                       $u = $this->initUser( $u );
                                } else {
                                        return self::WRONG_PLUGIN_PASS;
                                }
@@ -347,9 +352,7 @@ class LoginForm {
 
                if (!$u->checkPassword( $this->mPassword )) {
                        return '' == $this->mPassword ? self::EMPTY_PASS : self::WRONG_PASS;
-               }
-               else
-               {       
+               } else {        
                        $wgAuth->updateUser( $u );
                        $wgUser = $u;