Since updates are no longer truly deferred, replaced code for adding
authorEvan Prodromou <evanprodromou@users.mediawiki.org>
Mon, 29 Nov 2004 05:52:26 +0000 (05:52 +0000)
committerEvan Prodromou <evanprodromou@users.mediawiki.org>
Mon, 29 Nov 2004 05:52:26 +0000 (05:52 +0000)
UserUpdate's to the deferred list with in-place code for updating the
user. Removed UserUpdate.php from CVS and from UpdateClasses.php.

includes/Article.php
includes/SpecialPreferences.php
includes/SpecialUserlogin.php
includes/UpdateClasses.php
includes/UserUpdate.php [deleted file]

index b638ac5..ccffe7d 100644 (file)
@@ -1216,7 +1216,6 @@ class Article {
         */
        function watch( $add = true ) {
                global $wgUser, $wgOut;
-               global $wgDeferredUpdateList;
 
                if ( 0 == $wgUser->getID() ) {
                        $wgOut->errorpage( 'watchnologin', 'watchnologintext' );
@@ -1243,9 +1242,8 @@ class Article {
                        $text = wfMsg( 'removedwatchtext', $link );
                $wgOut->addWikiText( $text );
 
-               $up = new UserUpdate();
-               array_push( $wgDeferredUpdateList, $up );
-
+               $wgUser->saveSettings();
+               
                $wgOut->returnToMain( true, $this->mTitle->getPrefixedText() );
        }
 
index 25233d1..6d9e602 100644 (file)
@@ -162,7 +162,7 @@ class PreferencesForm {
         * @access private
         */
        function savePreferences() {
-               global $wgUser, $wgLang, $wgDeferredUpdateList, $wgOut;
+               global $wgUser, $wgLang, $wgOut;
 
                if ( '' != $this->mNewpass ) {
                        if ( $this->mNewpass != $this->mRetypePass ) {
@@ -213,8 +213,9 @@ class PreferencesForm {
                        $wgUser->setOption( $tname, $tvalue );
                }
                $wgUser->setCookies();
-               $up = new UserUpdate();
-               array_push( $wgDeferredUpdateList, $up );
+               
+               $wgUser->saveSettings();
+
                $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) );
                $po = ParserOptions::newFromUser( $wgUser );
                $this->mainPrefsForm( wfMsg( 'savedprefs' ) );
index 3ab19cd..0a913cf 100644 (file)
@@ -127,7 +127,6 @@ class LoginForm {
         */
        function addNewAccount() {
                global $wgUser, $wgOut;
-               global $wgDeferredUpdateList;
 
                $u = $this->addNewAccountInternal();
 
@@ -138,8 +137,7 @@ class LoginForm {
                $wgUser = $u;
                $wgUser->setCookies();
 
-               $up = new UserUpdate();
-               array_push( $wgDeferredUpdateList, $up );
+               $wgUser->saveSettings();
 
                if( $this->hasSessionCookie() ) {
                        return $this->successfulLogin( wfMsg( 'welcomecreation', $wgUser->getName() ) );
@@ -148,7 +146,6 @@ class LoginForm {
                }
        }
 
-
        /**
         * @access private
         */
@@ -233,7 +230,6 @@ class LoginForm {
         */
        function processLogin() {
                global $wgUser;
-               global $wgDeferredUpdateList;
 
                if ( '' == $this->mName ) {
                        $this->mainLoginForm( wfMsg( 'noname' ) );
@@ -281,9 +277,8 @@ class LoginForm {
                $wgUser = $u;
                $wgUser->setCookies();
 
-               $up = new UserUpdate();
-               array_push( $wgDeferredUpdateList, $up );
-
+               $wgUser->saveSettings();
+               
                if( $this->hasSessionCookie() ) {
                        return $this->successfulLogin( wfMsg( 'loginsuccess', $wgUser->getName() ) );
                } else {
index 8236b84..7cd39fc 100644 (file)
@@ -8,7 +8,7 @@
 /**
  *
  */
-require_once( 'UserUpdate.php' );
+
 require_once( 'SiteStatsUpdate.php' );
 require_once( 'LinksUpdate.php' );
 require_once( 'SearchUpdate.php' );
diff --git a/includes/UserUpdate.php b/includes/UserUpdate.php
deleted file mode 100644 (file)
index 4c5a952..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * See deferred.doc
- *
- * @package MediaWiki
- */
-
-/**
- *
- * @package MediaWiki
- */
-class UserUpdate {
-       /**
-        *
-        */
-       function UserUpdate() { }
-
-       /**
-        *
-        */
-       function doUpdate() {
-               global $wgUser;
-               $wgUser->saveSettings();
-       }
-}
-
-?>