getConfirmationToken() public method

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
 public function sendEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['new'];
     $url = $this->router->generate('fos_user_registration_confirm_email', ['token' => $user->getConfirmationToken(), 'email' => $user->getEmail()], true);
     $context = ['user' => $user, 'confirmationUrl' => $url];
     $this->sendMessage($template, $context, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('get_reset_resetting', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => str_replace('api', '#', $url));
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 4
0
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['confirmation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => str_replace('%23', '#', $url)));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 public function sendInvitationEmail(UserInterface $user)
 {
     $template = $this->parameters['invitation.template'];
     $url = $this->router->generate('kreta_user_registration', ['token' => $user->getConfirmationToken()], true);
     $rendered = $this->templating->render($template, ['user' => $user, 'registerUrl' => $url]);
     $this->sendEmailMessage($rendered, self::KRETA_INVITATION_EMAIL, $user->getEmail());
 }
Esempio n. 6
0
 /**
  * {@inheritdoc}
  */
 public function sendCreationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['creation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $rendered = $this->templating->render($template, array('user' => $user, 'password' => $user->getPlainPassword(), 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['creation'], $user->getEmail());
 }
Esempio n. 7
0
 public function sendResettingEmailMessage(UserInterface $user, $engine)
 {
     $template = $this->parameters['resetting_password.template'];
     $url = $this->router->generate('fos_user_user_reset_password', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template . '.txt.' . $engine, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->getSenderEmail('resetting_password'), $user->getEmail());
 }
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->getTemplate('resetting');
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     return $this->sendMessage($template, $context, $this->getFromEmail('resetting'), $user->getEmail());
 }
Esempio n. 9
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['resetting.template'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 10
0
 /**
  * Override for change resetting url
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['resetting.template'];
     $resetLink = $this->parameters['password_resetting_link'];
     $url = $resetLink . '/' . $user->getConfirmationToken();
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 11
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('sonata_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $email = key($this->parameters['from_email']['resetting']);
     $context = array('user' => $user, 'confirmationUrl' => $url, 'ttl' => $this->parameters['ttl'], 'email' => $email, 'administrator' => $this->parameters['from_email']['resetting'][$email], 'request' => $this->requestStack->getCurrentRequest());
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $subject = $this->translate('resetting.email.subject', $user->getUsername(), $url);
     $body = $this->translate('resetting.email.message', $user->getUsername(), $url);
     $rendered = $this->templating->render('@App/Utils/email_structure.html.twig', array('body' => $body));
     $this->sendEmailMessage($rendered, $subject, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 13
0
 /**
  * Send mail to reset user password
  * 
  * @param UserInterface $user
  * @param string        $route_reset_connexion
  * @param string        $body_type             ['body_text', 'body_html']
  * 
  * @return string
  * @access public
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function sendResettingEmailMessage(UserInterface $user, $route_reset_connexion = 'fos_user_resetting_reset', $body_type = "body_html")
 {
     $url = $this->container->get('sfynx.tool.route.factory')->getRoute($route_reset_connexion, array('token' => $user->getConfirmationToken()));
     $html_url = 'http://' . $this->container->get('request')->getHttpHost() . $this->container->get('request')->getBasePath() . $url;
     $html_url = "<a href='{$html_url}'>" . $html_url . "</a>";
     $templateFile = str_replace('::', ':', $this->container->getParameter('sfynx.auth.theme.login')) . 'Resetting:email.txt.twig';
     $from = $this->container->getParameter('sfynx.auth.theme.email.resetting.from_email.address');
     //
     $this->sendEmailMessage($templateFile, $from, $user, $html_url, $body_type);
 }
Esempio n. 14
0
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     //        var_dump($user->getConfirmationToken());
     //        die();
     $template = $this->parameters['confirmation.template'];
     //        $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     $url = "http://localhost:8080/SymfonyClient/app/#/core/signup/confirm/?code=" . $user->getConfirmationToken();
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
Esempio n. 15
0
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $from = $this->fromEmail;
     $template = 'Emails/password_reseting_email.html.twig';
     $url = $this->router->generate('rentme', array(), true) . "/" . $user->getConfirmationToken();
     //$url = path('rentme') . "?passwordResetButton&token=" + $user->getConfirmationToken();
     $url .= "?passwordReset";
     $to = $user->getEmail();
     $rendered = $this->templating->render($template, array('user' => $user, 'resetUrl' => $url, 'mailer_app_url_prefix' => $this->parameters['mailer_app_url_prefix']));
     $this->sendEmailMessage($rendered, $from, $to, "hey! VIENNA password reset.");
 }
Esempio n. 16
0
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['confirmation.template'];
     $request = $this->requestStack->getMasterRequest();
     $callback = $request->request->get('callback');
     //TODO check si callback existe
     $pattern = $request->request->get('pattern') ?: ':token';
     $token = $user->getConfirmationToken();
     $url = preg_replace("/{$pattern}/", $token, $callback);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
Esempio n. 17
0
 public function sendResettingEmailMessage(UserInterface $user, $template = null, $route = null)
 {
     if ($template === null) {
         $template = $this->parameters['resetting.template'];
     }
     if ($route === null) {
         $route = 'enhavo_user_user_reset_password_confirm';
     }
     $url = $this->router->generate($route, array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 18
0
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $isAdmin = '/foladmin/resetting/send/email' === $this->router->getContext()->getPathInfo();
     $to_route = 'fos_user_resetting_reset';
     if ($isAdmin) {
         $to_route = 'admin_resetting_reset';
     }
     $template = $this->parameters['resetting.template'];
     $url = $this->router->generate($to_route, array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
 /**
  * @param boolean $confirmation
  */
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $this->userManager->updateUser($user);
 }
 /**
  * @param boolean $confirmation
  */
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $event = new FormEvent($this->form, $this->request);
     $this->event_dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
     $this->userManager->updateUser($user);
 }
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $user->setRoles(array('ROLE_CLIENT'));
     $user->setEnabled(true);
     $user->setLastLogin(new \DateTime());
 }
Esempio n. 22
0
 /**
  * Send an email to AB administrators for user application review and approval
  *
  * @param UserInterface $user
  * @return bool
  */
 public function sendActivationMessage(UserInterface $user)
 {
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     if ($user instanceof Mentor) {
         $template = 'ABBundle:Email:activate.mentor.review.html.twig';
     } else {
         if ($user instanceof Pupil) {
             $template = 'ABBundle:Email:activate.pupil.review.html.twig';
         } else {
             //TODO: Handle error
             return false;
         }
     }
     $context = array('user' => $user, 'confirmationURL' => $url);
     $this->sendMessage($template, $context, $this->parameters['fromEmail'], $this->parameters['fromEmail']);
 }
 protected function onSuccess(UserInterface $user, $confirmation)
 {
     if ($confirmation) {
         $user->setEnabled(false);
         if (null === $user->getConfirmationToken()) {
             $user->setConfirmationToken($this->tokenGenerator->generateToken());
         }
         $this->mailer->sendConfirmationEmailMessage($user);
     } else {
         $user->setEnabled(true);
     }
     $user->setRoles(array('ROLE_RIA'));
     $riaCompanyInformation = new RiaCompanyInformation();
     $riaCompanyInformation->setName($user->getProfile()->getCompany());
     $riaCompanyInformation->setRia($user);
     $user->setRiaCompanyInformation($riaCompanyInformation);
     $this->userManager->updateUser($user);
     if ($riaCompanyInformation->getRelationshipType() === RiaCompanyInformation::RELATIONSHIP_TYPE_LICENSE_FEE) {
         $this->feeManager->resetRiaFee($user);
     }
 }
Esempio n. 24
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $context = array('user' => $user, 'token' => $user->getConfirmationToken());
     $this->sendMessage($context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
Esempio n. 25
0
 /**
  * Send an email to a user to confirm the password reset
  *
  * @param UserInterface $user
  *
  * @return void
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $data = array('user' => $user, 'confirmationUrl' => $url);
     $this->emailManager->sendToUser($user, 'Password Reset', 'Account:Resetting\\password_reset', $data);
 }
Esempio n. 26
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = "UserBundle:Resetting:email.txt.twig";
     $context = ['user' => $user, 'token' => $user->getConfirmationToken()];
     $this->sendMessage($template, $context, $user->getEmail());
 }
Esempio n. 27
0
 public function sendRegistrationMail(UserInterface $user)
 {
     $url = $this->router->generate('mathsup_register_confirmation', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->getTemplating()->render($this->parameters['email_template'], array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email'], $user->getEmail());
 }