config = $config; $this->clientManager = $clientManager; $this->entityManager = $entityManager; } public function run(Request $request, Response $response): void { $requestId = $request->getQueryParam('id'); if (!$requestId) { throw new BadRequest(); } $passwordChangeRequest = $this->entityManager ->getRepository('PasswordChangeRequest') ->where([ 'requestId' => $requestId, ]) ->findOne(); $strengthParams = [ 'passwordStrengthLength' => $this->config->get('passwordStrengthLength'), 'passwordStrengthLetterCount' => $this->config->get('passwordStrengthLetterCount'), 'passwordStrengthNumberCount' => $this->config->get('passwordStrengthNumberCount'), 'passwordStrengthBothCases' => $this->config->get('passwordStrengthBothCases'), ]; if (!$passwordChangeRequest) { throw new NotFound(); } $options = [ 'id' => $requestId, 'strengthParams' => $strengthParams, ]; $runScript = " app.getController('PasswordChangeRequest', function (controller) { controller.doAction('passwordChange', ".json_encode($options)."); }); "; $this->clientManager->display($runScript); } }