From 7bbf73582fbf384286bd9b8b0d7d8b591b1a1f2f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 29 Nov 2004 05:52:26 +0000 Subject: [PATCH] Since updates are no longer truly deferred, replaced code for adding 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 | 6 ++---- includes/SpecialPreferences.php | 7 ++++--- includes/SpecialUserlogin.php | 11 +++-------- includes/UpdateClasses.php | 2 +- includes/UserUpdate.php | 27 --------------------------- 5 files changed, 10 insertions(+), 43 deletions(-) delete mode 100644 includes/UserUpdate.php diff --git a/includes/Article.php b/includes/Article.php index b638ac5937..ccffe7d23b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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() ); } diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 25233d105c..6d9e60219a 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -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' ) ); diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 3ab19cdf07..0a913cf9ab 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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 { diff --git a/includes/UpdateClasses.php b/includes/UpdateClasses.php index 8236b849a6..7cd39fc854 100644 --- a/includes/UpdateClasses.php +++ b/includes/UpdateClasses.php @@ -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 index 4c5a952c47..0000000000 --- a/includes/UserUpdate.php +++ /dev/null @@ -1,27 +0,0 @@ -saveSettings(); - } -} - -?> -- 2.20.1