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
* @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();