*/ private array $macros = []; public function __construct(Environment $env) { parent::__construct($env); $this->source = $this->getSourceContext(); $this->parent = false; $this->blocks = [ ]; } protected function doDisplay(array $context, array $blocks = []): iterable { $macros = $this->macros; $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"]; $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Maker/registration/RegistrationController.tpl.php")); $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Maker/registration/RegistrationController.tpl.php")); // line 1 yield " namespace ; class extends AbstractController { public function __construct(private getPropertyType(\$email_verifier_class_details) ?>\$emailVerifier) { } generateRouteForControllerMethod(\$route_path, \$route_name) ?> public function register(Request \$request, UserPasswordHasherInterface \$userPasswordHasher, EntityManagerInterface \$entityManager): Response { \$user = new (); \$form = \$this->createForm(::class, \$user); \$form->handleRequest(\$request); if (\$form->isSubmitted() && \$form->isValid()) { /** @var string \$plainPassword */ \$plainPassword = \$form->get('plainPassword')->getData(); // encode the plain password \$user->set(\$userPasswordHasher->hashPassword(\$user, \$plainPassword)); \$entityManager->persist(\$user); \$entityManager->flush(); // generate a signed url and email it to the user \$this->emailVerifier->sendEmailConfirmation('app_verify_email', \$user, (new TemplatedEmail()) ->from(new Address('', '')) ->to((string) \$user->()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') ); // do anything else you need here, like send an email return \$security->login(\$user, , ''); return \$this->redirectToRoute(''); } return \$this->render('registration/register.html.twig', [ 'registrationForm' => \$form, ]); } generateRouteForControllerMethod('/verify/email', 'app_verify_email') ?> public function verifyUserEmail(Request \$request, TranslatorInterface \$translator): Response { \$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); \$id = \$request->query->get('id'); if (null === \$id) { return \$this->redirectToRoute('app_register'); } \$repository = \$manager->getRepository(::class); \$user = \$repository->find(\$id); \$user = ->find(\$id); if (null === \$user) { return \$this->redirectToRoute('app_register'); } // validate email confirmation link, sets User::isVerified=true and persists try { /** @var \$user */ \$user = \$this->getUser(); \$this->emailVerifier->handleEmailConfirmation(\$request, \$user); } catch (VerifyEmailExceptionInterface \$exception) { \$this->addFlash('verify_email_error', \$translator->trans(\$exception->getReason(), [], 'VerifyEmailBundle')\$exception->getReason()); return \$this->redirectToRoute(''); } // @TODO Change the redirect on success and handle or remove the flash message in your templates \$this->addFlash('success', 'Your email address has been verified.'); return \$this->redirectToRoute('app_register'); } } "; $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof); $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof); yield from []; } /** * @codeCoverageIgnore */ public function getTemplateName(): string { return "@Maker/registration/RegistrationController.tpl.php"; } /** * @codeCoverageIgnore */ public function getDebugInfo(): array { return array ( 48 => 1,); } public function getSourceContext(): Source { return new Source(" namespace ; class extends AbstractController { public function __construct(private getPropertyType(\$email_verifier_class_details) ?>\$emailVerifier) { } generateRouteForControllerMethod(\$route_path, \$route_name) ?> public function register(Request \$request, UserPasswordHasherInterface \$userPasswordHasher, EntityManagerInterface \$entityManager): Response { \$user = new (); \$form = \$this->createForm(::class, \$user); \$form->handleRequest(\$request); if (\$form->isSubmitted() && \$form->isValid()) { /** @var string \$plainPassword */ \$plainPassword = \$form->get('plainPassword')->getData(); // encode the plain password \$user->set(\$userPasswordHasher->hashPassword(\$user, \$plainPassword)); \$entityManager->persist(\$user); \$entityManager->flush(); // generate a signed url and email it to the user \$this->emailVerifier->sendEmailConfirmation('app_verify_email', \$user, (new TemplatedEmail()) ->from(new Address('', '')) ->to((string) \$user->()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') ); // do anything else you need here, like send an email return \$security->login(\$user, , ''); return \$this->redirectToRoute(''); } return \$this->render('registration/register.html.twig', [ 'registrationForm' => \$form, ]); } generateRouteForControllerMethod('/verify/email', 'app_verify_email') ?> public function verifyUserEmail(Request \$request, TranslatorInterface \$translator): Response { \$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); \$id = \$request->query->get('id'); if (null === \$id) { return \$this->redirectToRoute('app_register'); } \$repository = \$manager->getRepository(::class); \$user = \$repository->find(\$id); \$user = ->find(\$id); if (null === \$user) { return \$this->redirectToRoute('app_register'); } // validate email confirmation link, sets User::isVerified=true and persists try { /** @var \$user */ \$user = \$this->getUser(); \$this->emailVerifier->handleEmailConfirmation(\$request, \$user); } catch (VerifyEmailExceptionInterface \$exception) { \$this->addFlash('verify_email_error', \$translator->trans(\$exception->getReason(), [], 'VerifyEmailBundle')\$exception->getReason()); return \$this->redirectToRoute(''); } // @TODO Change the redirect on success and handle or remove the flash message in your templates \$this->addFlash('success', 'Your email address has been verified.'); return \$this->redirectToRoute('app_register'); } } ", "@Maker/registration/RegistrationController.tpl.php", "/var/www/cds/app/vendor/symfony/maker-bundle/templates/registration/RegistrationController.tpl.php"); } }