Go to the documentation of this file.
47 $this->authoritative = !isset( $params[
'authoritative'] ) || (bool)$params[
'authoritative'];
55 if ( $this->passwordFactory ===
null ) {
57 $this->config->get(
'PasswordConfig' ),
58 $this->config->get(
'PasswordDefault' )
74 $class = static::class;
75 $this->logger->debug(
"Invalid password hash in {$class}::getPassword()" );
86 if ( $this->authoritative ) {
88 wfMessage( $req->password ===
'' ?
'wrongpasswordempty' :
'wrongpassword' )
106 return \User::newFromName( $username )->checkPasswordValidity( $password );
123 if ( !$reset && $this->config->get(
'InvalidPasswordReset' ) && !
$status->isGood() ) {
124 $hard =
$status->getValue()[
'forceChange'] ??
false;
126 if ( $hard || !empty(
$status->getValue()[
'suggestChangeOnLogin'] ) ) {
128 'msg' =>
$status->getMessage( $hard ?
'resetpass-validity' :
'resetpass-validity-soft' ),
135 $this->manager->setAuthenticationSessionData(
'reset-pass', $reset );
157 $days = $this->config->get(
'PasswordExpirationDays' );
158 $expires = $days ?
wfTimestamp( TS_MW, time() + $days * 86400 ) :
null;
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Show an error when any operation involving passwords fails to run.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Factory class for creating and checking Password objects.
Represents a password hash for use in authentication.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.