31use Wikimedia\Assert\Assert;
47 private $passwordFactory =
null;
56 $this->authoritative = !isset(
$params[
'authoritative'] ) || (bool)
$params[
'authoritative'];
63 if ( $this->passwordFactory ===
null ) {
69 return $this->passwordFactory;
82 $class = static::class;
83 $this->logger->debug(
"Invalid password hash in {$class}::getPassword()" );
94 if ( $this->authoritative ) {
96 wfMessage( $req->password ===
'' ?
'wrongpasswordempty' :
'wrongpassword' )
114 return User::newFromName( $username )->checkPasswordValidity( $password );
129 Assert::precondition( !$status->isOK(), __METHOD__ .
' expects a fatal Status' );
131 ->getFullURL( [
'wpUsername' => $username ] );
148 $reset = $this->getPasswordResetData( $username, $data );
152 $hard = $status->
getValue()[
'forceChange'] ??
false;
154 if ( $hard || !empty( $status->
getValue()[
'suggestChangeOnLogin'] ) ) {
156 'msg' => $status->
getMessage( $hard ?
'resetpass-validity' :
'resetpass-validity-soft' ),
163 $this->manager->setAuthenticationSessionData(
'reset-pass', $reset );
188 $expires = $days ?
wfTimestamp( TS_MW, time() + $days * 86400 ) :
null;
191 $this->getHookRunner()->onResetPasswordExpiration(
192 User::newFromName( $username ), $expires );
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.
array $params
The job parameters.
A class containing constants representing the names of configuration variables.
const PasswordExpirationDays
Name constant for the PasswordExpirationDays setting, for use with Config::get()
const PasswordDefault
Name constant for the PasswordDefault setting, for use with Config::get()
const PasswordConfig
Name constant for the PasswordConfig setting, for use with Config::get()
const InvalidPasswordReset
Name constant for the InvalidPasswordReset setting, for use with Config::get()
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
isGood()
Returns whether the operation completed and didn't have any error or warnings.