From b51076f9f703f623fef6ce59a8f33aa3cd7051d8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 12 Mar 2012 13:07:50 +0000 Subject: [PATCH] Set the user_touched field directly when adding a new user to the database so that the field is correct when someone does not call saveSettings() after addToDatabase() --- includes/User.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/User.php b/includes/User.php index b44bd60ac1..c999651f46 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2890,6 +2890,7 @@ class User { 'user_token' => $user->mToken, 'user_registration' => $dbw->timestamp( $user->mRegistration ), 'user_editcount' => 0, + 'user_touched' => self::newTouchedTimestamp(), ); foreach ( $params as $name => $value ) { $fields["user_$name"] = $value; @@ -2908,6 +2909,9 @@ class User { */ public function addToDatabase() { $this->load(); + + $this->mTouched = self::newTouchedTimestamp(); + $dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $dbw->insert( 'user', @@ -2923,6 +2927,7 @@ class User { 'user_token' => $this->mToken, 'user_registration' => $dbw->timestamp( $this->mRegistration ), 'user_editcount' => 0, + 'user_touched' => $this->mTouched, ), __METHOD__ ); $this->mId = $dbw->insertId(); -- 2.20.1