50 $this->authoritative = !isset( $params[
'authoritative'] ) || (bool)$params[
'authoritative'];
57 if ( $this->passwordFactory ===
null ) {
59 $this->config->get(
'PasswordConfig' ),
60 $this->config->get(
'PasswordDefault' )
76 $class = static::class;
77 $this->logger->debug(
"Invalid password hash in {$class}::getPassword()" );
88 if ( $this->authoritative ) {
90 wfMessage( $req->password ===
'' ?
'wrongpasswordempty' :
'wrongpassword' )
108 return \User::newFromName( $username )->checkPasswordValidity( $password );
125 if ( !$reset && $this->config->get(
'InvalidPasswordReset' ) && !$status->
isGood() ) {
126 $hard = $status->
getValue()[
'forceChange'] ??
false;
128 if ( $hard || !empty( $status->
getValue()[
'suggestChangeOnLogin'] ) ) {
130 'msg' => $status->
getMessage( $hard ?
'resetpass-validity' :
'resetpass-validity-soft' ),
137 $this->manager->setAuthenticationSessionData(
'reset-pass', $reset );
161 $days = $this->config->get(
'PasswordExpirationDays' );
162 $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')