authManager = $authManager; $this->reqs = $reqs; $this->logContext = $logContext; } public function doUpdate() { $logger = LoggerFactory::getInstance( 'authentication' ); foreach ( $this->reqs as $req ) { // This is adding a new temporary password, not intentionally changing anything // (even though it might technically invalidate an old temporary password). $this->authManager->changeAuthenticationData( $req, /* $isAddition */ true ); $logger->info( "{requestingUser} did password reset of {targetUser} and an email was sent", $this->logContext + [ 'targetUser' => $req->username ] ); } } }