From: Brion Vibber Date: Sat, 4 Aug 2007 16:34:21 +0000 (+0000) Subject: Clean up autocreation a smidge... let the auth plugin know whether the user you're... X-Git-Tag: 1.31.0-rc.0~51872 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=77a1935aa88c63203bd87cafd9734df454e5a05a;p=lhc%2Fweb%2Fwiklou.git Clean up autocreation a smidge... let the auth plugin know whether the user you're setting up was created manually or by the autocreation path, and have the CentralAuth plugin know whether it should be attaching (for autocreate) or not (for non-autocreate) --- diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 0e26ba9366..2689c03c4c 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -296,7 +296,7 @@ class LoginForm { return false; } - return $this->initUser( $u ); + return $this->initUser( $u, false ); } /** @@ -304,10 +304,11 @@ class LoginForm { * Give it a User object that has been initialised with a name. * * @param $u User object. + * @param $autocreate boolean -- true if this is an autocreation via auth plugin * @return User object. * @private */ - function initUser( $u ) { + function initUser( $u, $autocreate ) { global $wgAuth; $u->addToDatabase(); @@ -320,7 +321,7 @@ class LoginForm { $u->setRealName( $this->mRealName ); $u->setToken(); - $wgAuth->initUser( $u ); + $wgAuth->initUser( $u, $autocreate ); $u->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 ); $u->saveSettings(); @@ -359,7 +360,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, true ); } else { return self::WRONG_PLUGIN_PASS; }