ヤミRoot VoidGate
User / IP
:
216.73.216.84
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Controller
/
Viewing: RegistrationController.php
<?php namespace App\Controller; use App\Entity\User; use App\Form\RegistrationFormType; use App\Security\EmailVerifier; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Mime\Address; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface; class RegistrationController extends AbstractController { private $emailVerifier; private $entityManager; public function __construct(EmailVerifier $emailVerifier, EntityManagerInterface $entityManager) { $this->emailVerifier = $emailVerifier; $this->entityManager = $entityManager; } /** * @Route({"es": "/register","en": "/register"}, name="app_register") */ public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response { $user = new User(); $form = $this->createForm(RegistrationFormType::class, $user); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { // encode the plain password $user->setPassword( $userPasswordHasher->hashPassword( $user, $form->get('plainPassword')->getData() ) ); $user->setUsername($user->getEmail()); $user->setUsernameCanonical($user->getEmail()); $user->setEnabled(false); $user->setActive(false); $user->addRole("ROLE_USER"); $user->addRole("ROLE_ADMIN"); $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('noreply@loger.cm', 'LOGER MAIL BOT')) ->to($user->getEmail()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') ); // do anything else you need here, like send an email // @TODO Change the redirect on success and handle or remove the flash message in your templates $this->addFlash('success', 'Check Your Mail Box to verify your email address.'); return $this->redirectToRoute('app_login'); } return $this->render('registration/register.html.twig', [ 'registrationForm' => $form->createView(), 'destination' => $request->get('destination'), 'companyName' => $this->getParameter('app_client') ]); } /** * * @Route({"es": "/verify/email","en": "/verify/email"}, name="app_verify_email") */ public function verifyUserEmail(Request $request, TranslatorInterface $translator): Response { $user=$request->get("user"); $user = $this->entityManager->getRepository(User::class)->findOneBy( ['id' => $user] ); // validate email confirmation link, sets User::isVerified=true and persists try { $this->emailVerifier->handleEmailConfirmation($request, $user); } catch (VerifyEmailExceptionInterface $exception) { $this->addFlash('verify_email_error', $translator->trans($exception->getReason(), [], 'VerifyEmailBundle')); return $this->redirectToRoute('app_register'); } // @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_login'); } /** * * @Route({"es": "/resend/email/{user}","en": "/resend/email/{user}"}, name="app_resend_email") */ public function resendVerifyUserEmail(Request $request): Response { $user=$request->get("user"); $user = $this->entityManager->getRepository(User::class)->findOneBy( ['id' => $user] ); $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user, (new TemplatedEmail()) ->from(new Address('noreply@loger.cm', 'LOGER MAIL BOT')) ->to($user->getEmail()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') ); // do anything else you need here, like send an email // @TODO Change the redirect on success and handle or remove the flash message in your templates $this->addFlash('success', 'email successfully.'); return $this->redirectToRoute('admin_dashboard'); } }
Coded With 💗 by
0x6ick