DB schema change.
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 14 May 2008 00:35:14 +0000 (00:35 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 14 May 2008 00:35:14 +0000 (00:35 +0000)
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

includes/StubObject.php
includes/User.php

index 9282ede..07db880 100644 (file)
@@ -190,7 +190,6 @@ class StubUser extends StubObject {
                        $user = new User;
                } else {
                        $user = User::newFromSession();
-                       wfRunHooks( 'AutoAuthenticate', array( &$user ) );
                }
                return $user;
        }
index 464966c..9e71e2e 100644 (file)
@@ -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' );
        }