From 3ab9d9964beaffdca22cc02a1771eab4dcce1d24 Mon Sep 17 00:00:00 2001 From: csteipp Date: Thu, 28 Aug 2014 11:04:57 -0700 Subject: [PATCH] Load password information when expiring 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/User.php b/includes/User.php index 665edb973c..6b42994ef7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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(); -- 2.20.1