50 $this->authoritative = !isset( $params[
'authoritative'] ) || (bool)$params[
'authoritative'];
58 if ( $this->passwordFactory ===
null ) {
60 $this->config->get(
'PasswordConfig' ),
61 $this->config->get(
'PasswordDefault' )
77 $class = static::class;
78 $this->logger->debug(
"Invalid password hash in {$class}::getPassword()" );
89 if ( $this->authoritative ) {
91 wfMessage( $req->password ===
'' ?
'wrongpasswordempty' :
'wrongpassword' )
109 return \User::newFromName( $username )->checkPasswordValidity( $password );
126 if ( !$reset && $this->config->get(
'InvalidPasswordReset' ) && !$status->
isGood() ) {
127 $hard = $status->
getValue()[
'forceChange'] ??
false;
129 if ( $hard || !empty( $status->
getValue()[
'suggestChangeOnLogin'] ) ) {
131 'msg' => $status->
getMessage( $hard ?
'resetpass-validity' :
'resetpass-validity-soft' ),
138 $this->manager->setAuthenticationSessionData(
'reset-pass', $reset );
162 $days = $this->config->get(
'PasswordExpirationDays' );
163 $expires = $days ?
wfTimestamp( TS_MW, time() + $days * 86400 ) :
null;
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Show an error when any operation involving passwords fails to run.
Factory class for creating and checking Password objects.
Represents a password hash for use in authentication.
isGood()
Returns whether the operation completed and didn't have any error or warnings.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
getMessage( $shortContext=false, $longContext=false, $lang=null)
Get a bullet list of the errors as a Message object.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.