Add getPassword/getTemporaryPassword accessors to User
authorKunal Mehta <legoktm@gmail.com>
Mon, 4 Aug 2014 01:41:39 +0000 (18:41 -0700)
committerKunal Mehta <legoktm@gmail.com>
Mon, 4 Aug 2014 01:41:39 +0000 (18:41 -0700)
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

index a21119a..7edd93e 100644 (file)
@@ -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;