namespace MediaWiki\Auth;
+ use MediaWiki\MediaWikiServices;
+
/**
* This represents the intention to set a temporary password for the user.
* @ingroup Auth
/** @var bool Email password to the user. */
public $mailpassword = false;
- /**
- * @var bool Do not fail certain operations if the password cannot be mailed, there is a
- * backchannel present.
- */
- public $hasBackchannel = false;
-
/** @var string Username or IP address of the caller */
public $caller;
* @return TemporaryPasswordAuthenticationRequest
*/
public static function newRandom() {
- $config = \ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+ $config = MediaWikiServices::getInstance()->getMainConfig();
// get the min password length
$minLength = $config->get( 'MinimalPasswordLength' );
namespace MediaWiki\Auth;
+ use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
/**
}
$config = new \MultiConfig( [
$this->config,
- \ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
+ MediaWikiServices::getInstance()->getMainConfig()
] );
if ( !$this->manager ) {
$provider = $this->getProvider( [ 'emailEnabled' => false ] );
$status = $provider->providerAllowsAuthenticationDataChange( $req, true );
$this->assertEquals( \StatusValue::newFatal( 'passwordreset-emaildisabled' ), $status );
- $req->hasBackchannel = true;
- $status = $provider->providerAllowsAuthenticationDataChange( $req, true );
- $this->assertFalse( $status->hasMessage( 'passwordreset-emaildisabled' ) );
- $req->hasBackchannel = false;
$provider = $this->getProvider( [ 'passwordReminderResendTime' => 10 ] );
$status = $provider->providerAllowsAuthenticationDataChange( $req, true );
$provider = $this->getProvider( [ 'emailEnabled' => false ] );
$status = $provider->testForAccountCreation( $user, $creator, [ $req ] );
$this->assertEquals( \StatusValue::newFatal( 'emaildisabled' ), $status );
- $req->hasBackchannel = true;
- $status = $provider->testForAccountCreation( $user, $creator, [ $req ] );
- $this->assertFalse( $status->hasMessage( 'emaildisabled' ) );
- $req->hasBackchannel = false;
$provider = $this->getProvider( [ 'emailEnabled' => true ] );
$status = $provider->testForAccountCreation( $user, $creator, [ $req ] );
$this->assertEquals( \StatusValue::newFatal( 'noemailcreate' ), $status );
- $req->hasBackchannel = true;
- $status = $provider->testForAccountCreation( $user, $creator, [ $req ] );
- $this->assertFalse( $status->hasMessage( 'noemailcreate' ) );
- $req->hasBackchannel = false;
$user->setEmail( 'test@localhost.localdomain' );
$status = $provider->testForAccountCreation( $user, $creator, [ $req ] );