MediaWiki  REL1_31
SendPasswordResetEmailUpdate.php
Go to the documentation of this file.
1 <?php
25 
32  private $authManager;
33 
35  private $reqs;
36 
38  private $logContext;
39 
46  $this->authManager = $authManager;
47  $this->reqs = $reqs;
48  $this->logContext = $logContext;
49  }
50 
51  public function doUpdate() {
52  $logger = LoggerFactory::getInstance( 'authentication' );
53  foreach ( $this->reqs as $req ) {
54  // This is adding a new temporary password, not intentionally changing anything
55  // (even though it might technically invalidate an old temporary password).
56  $this->authManager->changeAuthenticationData( $req, /* $isAddition */ true );
57  $logger->info(
58  "{requestingUser} did password reset of {targetUser} and an email was sent",
59  $this->logContext + [ 'targetUser' => $req->username ]
60  );
61  }
62  }
63 
64 }
use
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Definition: APACHE-LICENSE-2.0.txt:10
array
the array() calling protocol came about after MediaWiki 1.4rc1.
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:37
SendPasswordResetEmailUpdate
Sends emails to all accounts associated with that email to reset the password.
Definition: SendPasswordResetEmailUpdate.php:30
SendPasswordResetEmailUpdate\__construct
__construct(AuthManager $authManager, array $reqs, array $logContext)
Definition: SendPasswordResetEmailUpdate.php:45
SendPasswordResetEmailUpdate\$logContext
array $logContext
Definition: SendPasswordResetEmailUpdate.php:38
SendPasswordResetEmailUpdate\doUpdate
doUpdate()
Perform the actual work.
Definition: SendPasswordResetEmailUpdate.php:51
SendPasswordResetEmailUpdate\$authManager
AuthManager $authManager
Definition: SendPasswordResetEmailUpdate.php:32
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:83
$req
this hook is for auditing only $req
Definition: hooks.txt:990
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:22
LoggerFactory
MediaWiki Logger LoggerFactory implements a PSR[0] compatible message logging system Named Psr Log LoggerInterface instances can be obtained from the MediaWiki Logger LoggerFactory::getInstance() static method. MediaWiki\Logger\LoggerFactory expects a class implementing the MediaWiki\Logger\Spi interface to act as a factory for new Psr\Log\LoggerInterface instances. The "Spi" in MediaWiki\Logger\Spi stands for "service provider interface". An SPI is an API intended to be implemented or extended by a third party. This software design pattern is intended to enable framework extension and replaceable components. It is specifically used in the MediaWiki\Logger\LoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki. The service provider interface allows the backend logging library to be implemented in multiple ways. The $wgMWLoggerDefaultSpi global provides the classname of the default MediaWiki\Logger\Spi implementation to be loaded at runtime. This can either be the name of a class implementing the MediaWiki\Logger\Spi with a zero argument const ructor or a callable that will return an MediaWiki\Logger\Spi instance. Alternately the MediaWiki\Logger\LoggerFactory MediaWiki Logger LoggerFactory
Definition: logger.txt:5
SendPasswordResetEmailUpdate\$reqs
array $reqs
Definition: SendPasswordResetEmailUpdate.php:35
DeferrableUpdate
Interface that deferrable updates should implement.
Definition: DeferrableUpdate.php:9