From: Tim Starling Date: Wed, 14 May 2008 00:35:14 +0000 (+0000) Subject: DB schema change. X-Git-Tag: 1.31.0-rc.0~47648 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=8ae900c46bef4e59583d514ee9cb1b7daa387ab3;p=lhc%2Fweb%2Fwiklou.git DB schema change. In CentralAuth (and related changes interface changes in Newuserlog and the core): * Moved the AutoAuthenticate hook to User::loadFromSession(), to defer processing for longer and avoid unstub loops * Undeprecated User::setID() * Added partial support for new user log registration and IP-based blocking of automatically created accounts. Still needs the same support implemented in Special:Userlogin. * Fixed all inappropriate uses of the term "DB name", changing them to "wiki" or "wiki ID". Renamed the relevant database fields. * Refactored central session and cache support --- diff --git a/includes/StubObject.php b/includes/StubObject.php index 9282ede555..07db880500 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -190,7 +190,6 @@ class StubUser extends StubObject { $user = new User; } else { $user = User::newFromSession(); - wfRunHooks( 'AutoAuthenticate', array( &$user ) ); } return $user; } diff --git a/includes/User.php b/includes/User.php index 464966c997..9e71e2e5ea 100644 --- a/includes/User.php +++ b/includes/User.php @@ -767,6 +767,12 @@ class User { private function loadFromSession() { global $wgMemc, $wgCookiePrefix; + $result = null; + wfRunHooks( 'UserLoadFromSession', array( $this, &$result ) ); + if ( $result !== null ) { + return $result; + } + if ( isset( $_SESSION['wsUserID'] ) ) { if ( 0 != $_SESSION['wsUserID'] ) { $sId = $_SESSION['wsUserID']; @@ -1238,10 +1244,8 @@ class User { /** * Set the user and reload all fields according to that ID - * @deprecated use User::newFromId() */ function setID( $v ) { - wfDeprecated( __METHOD__ ); $this->mId = $v; $this->clearInstanceCache( 'id' ); }