config = $config; $this->clientManager = $clientManager; $this->entityManager = $entityManager; } public function run($request) { $requestId = $request->get('id'); if (!$requestId) throw new BadRequest(); $config = $this->config; $request = $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 (!$request) throw new NotFound(); $options = [ 'id' => $requestId, 'strengthParams' => $strengthParams, ]; $runScript = " app.getController('PasswordChangeRequest', function (controller) { controller.doAction('passwordChange', ".json_encode($options)."); }); "; $this->clientManager->display($runScript); } }