From 50bcbe6c89e4421768fa16d14ffe9b2aadac1027 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 3 Aug 2014 18:41:39 -0700 Subject: [PATCH] Add getPassword/getTemporaryPassword accessors to User In I0a9c972931a, User::load() no longer loaded the mPassword and mNewpassword member variables, and User::loadPasswords() is private. So this lets things that need to access the Password objects directly. Change-Id: Ib79ce01a47f90af681e376ce918eda559b4b94a6 --- includes/User.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/includes/User.php b/includes/User.php index a21119a4f8..7edd93ec78 100644 --- a/includes/User.php +++ b/includes/User.php @@ -181,8 +181,16 @@ class User implements IDBAccessObject { public $mRealName; + /** + * @todo Make this actually private + * @private + */ public $mPassword; + /** + * @todo Make this actually private + * @private + */ public $mNewpassword; public $mNewpassTime; @@ -2247,6 +2255,26 @@ class User implements IDBAccessObject { return $this->mTouched; } + /** + * @return Password + * @since 1.24 + */ + public function getPassword() { + $this->loadPasswords(); + + return $this->mPassword; + } + + /** + * @return Password + * @since 1.24 + */ + public function getTemporaryPassword() { + $this->loadPasswords(); + + return $this->mNewpassword; + } + /** * Set the password and reset the random token. * Calls through to authentication plugin if necessary; -- 2.20.1