Load password information when expiring
authorcsteipp <csteipp@wikimedia.org>
Thu, 28 Aug 2014 18:04:57 +0000 (11:04 -0700)
committercsteipp <csteipp@wikimedia.org>
Thu, 28 Aug 2014 18:04:57 +0000 (11:04 -0700)
Call loadPasswords when expiring the user's password, otherwise the
change is overwritten with the previous value.

This lets you do:
  $u = User::newFromName( 'User' );
  $u->expirePassword();
And the user will have to reset their password on the next login.

Change-Id: I47325dde1ce14280088efdc90ce7887b45e0dc6a

includes/User.php

index 665edb9..6b42994 100644 (file)
@@ -829,7 +829,7 @@ class User implements IDBAccessObject {
         * @param int $ts Optional timestamp to convert, default 0 for the current time
         */
        public function expirePassword( $ts = 0 ) {
-               $this->load();
+               $this->loadPasswords();
                $timestamp = wfTimestamp( TS_MW, $ts );
                $this->mPasswordExpires = $timestamp;
                $this->saveSettings();