Merge "checkTemporaryPassword should call loadPasswords() first"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 30 Jul 2014 01:17:49 +0000 (01:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 30 Jul 2014 01:17:49 +0000 (01:17 +0000)
1  2 
includes/User.php

diff --combined includes/User.php
@@@ -38,6 -38,14 +38,6 @@@ define( 'MW_USER_VERSION', 10 )
   */
  define( 'EDIT_TOKEN_SUFFIX', '+\\' );
  
 -/**
 - * Thrown by User::setPassword() on error.
 - * @ingroup Exception
 - */
 -class PasswordError extends MWException {
 -      // NOP
 -}
 -
  /**
   * The User object encapsulates all of the user-specific settings (user_id,
   * name, rights, password, email address, options, last login time). Client
@@@ -2412,8 -2420,8 +2412,8 @@@ class User implements IDBAccessObject 
                if ( $str == $this->mEmail ) {
                        return;
                }
 -              $this->mEmail = $str;
                $this->invalidateEmail();
 +              $this->mEmail = $str;
                wfRunHooks( 'UserSetEmail', array( $this, &$this->mEmail ) );
        }
  
                global $wgNewPasswordExpiry;
  
                $this->load();
+               $this->loadPasswords();
                if ( $this->mNewpassword->equals( $plaintext ) ) {
                        if ( is_null( $this->mNewpassTime ) ) {
                                return true;
                $this->mEmailToken = null;
                $this->mEmailTokenExpires = null;
                $this->setEmailAuthenticationTimestamp( null );
 +              $this->mEmail = '';
                wfRunHooks( 'InvalidateEmailComplete', array( $this ) );
                return true;
        }
         * @param bool|string $salt Optional salt, may be random or the user ID.
         *  If unspecified or false, will generate one automatically
         * @return string Password hash
 -       * @deprecated since 1.23, use Password class
 +       * @deprecated since 1.24, use Password class
         */
        public static function crypt( $password, $salt = false ) {
 -              wfDeprecated( __METHOD__, '1.23' );
 +              wfDeprecated( __METHOD__, '1.24' );
                $hash = self::getPasswordFactory()->newFromPlaintext( $password );
                return $hash->toString();
        }
         * @param string|bool $userId User ID for old-style password salt
         *
         * @return bool
 -       * @deprecated since 1.23, use Password class
 +       * @deprecated since 1.24, use Password class
         */
        public static function comparePasswords( $hash, $password, $userId = false ) {
 -              wfDeprecated( __METHOD__, '1.23' );
 +              wfDeprecated( __METHOD__, '1.24' );
  
                // Check for *really* old password hashes that don't even have a type
                // The old hash format was just an md5 hex hash, with no type information