From: Brion Vibber Date: Thu, 30 Nov 2006 20:55:44 +0000 (+0000) Subject: * Fix regression in authentication hook auto-creation on login X-Git-Tag: 1.31.0-rc.0~55026 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=d210b080fa698bc900ce38e7926c759943744a89;p=lhc%2Fweb%2Fwiklou.git * Fix regression in authentication hook auto-creation on login --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5a72c0bd96..ea652b66f4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 7205043164..d43d249c25 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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;