https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113619

Revision: 113619
Author:   ialex
Date:     2012-03-12 13:07:50 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
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()

Modified Paths:
--------------
    trunk/phase3/includes/User.php

Modified: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php      2012-03-12 13:05:42 UTC (rev 113618)
+++ trunk/phase3/includes/User.php      2012-03-12 13:07:50 UTC (rev 113619)
@@ -2890,6 +2890,7 @@
                        '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 @@
         */
        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 @@
                                'user_token' => $this->mToken,
                                'user_registration' => $dbw->timestamp( 
$this->mRegistration ),
                                'user_editcount' => 0,
+                               'user_touched' => $this->mTouched,
                        ), __METHOD__
                );
                $this->mId = $dbw->insertId();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to