}
}
- /**
- * Set the password for a password reminder or new account email
- *
- * @deprecated Removed in 1.27. Use PasswordReset instead.
- * @param string $str New password to set or null to set an invalid
- * password hash meaning that the user will not be able to use it
- * @param bool $throttle If true, reset the throttle timestamp to the present
- */
- public function setNewpassword( $str, $throttle = true ) {
- throw new BadMethodCallException( __METHOD__ . ' has been removed in 1.27' );
- }
-
/**
* Get the user's e-mail address
* @return string User's email address
$this->setNewtalk( false );
// If there is a new, unseen, revision, use its timestamp
- $nextid = $oldid
- ? $title->getNextRevisionID( $oldid, Title::READ_LATEST )
- : null;
- if ( $nextid ) {
- $this->setNewtalk( true, Revision::newFromId( $nextid ) );
+ if ( $oldid ) {
+ $rl = MediaWikiServices::getInstance()->getRevisionLookup();
+ $oldRev = $rl->getRevisionById( $oldid, Title::READ_LATEST );
+ if ( $oldRev ) {
+ $newRev = $rl->getNextRevision( $oldRev );
+ if ( $newRev ) {
+ // TODO: actually no need to wrap in a revision,
+ // setNewtalk really only needs a RevRecord
+ $this->setNewtalk( true, new Revision( $newRev ) );
+ }
+ }
}
} );
}
'password' => $password,
]
);
- $res = AuthManager::singleton()->beginAuthentication( $reqs, 'null:' );
+ $res = $manager->beginAuthentication( $reqs, 'null:' );
switch ( $res->status ) {
case AuthenticationResponse::PASS:
return true;
case AuthenticationResponse::FAIL:
// Hope it's not a PreAuthenticationProvider that failed...
- \MediaWiki\Logger\LoggerFactory::getInstance( 'authentication' )
+ LoggerFactory::getInstance( 'authentication' )
->info( __METHOD__ . ': Authentication failed: ' . $res->message->plain() );
return false;
default: