public function resetAction(Request $request, $token)
 {
     if ($this->userAlreadyLoggedIn()) {
         $router = $this->container->get('router');
         return new RedirectResponse($router->generate('fos_user_profile_edit'), 302);
     }
     return parent::resetAction($request, $token);
 }
 /**
  * Reset user password
  */
 public function resetAction($token)
 {
     $return = parent::resetAction($token);
     if ($return instanceof RedirectResponse) {
         $user = $this->container->get('security.context')->getToken()->getUser();
         if ($user) {
             $discriminator = $this->container->get('nmn_user_discriminator');
             $discriminator->setClass(get_class($user), true);
         }
     }
     return $return;
 }
 /**
  * Reset user password
  */
 public function resetAction($token)
 {
     $return = parent::resetAction($token);
     if ($return instanceof RedirectResponse) {
         $user = $this->container->get('security.context')->getToken()->getUser();
         if (is_object($user) || $user instanceof UserInterface) {
             $dispatcher = $this->container->get('event_dispatcher');
             $event = new ManualLoginEvent($user);
             $dispatcher->dispatch('security.manual_login', $event);
         }
     }
     return $return;
 }
 /**
  * @ApiDoc(
  *  resource=false,
  *  section="Resetting",
  *  description="Reset user password",
  *  input="FOS\UserBundle\Form\Type\ResettingFormType"
  * )
  */
 public function resetAction(Request $request, $token)
 {
     return parent::resetAction($request, $token);
 }
Exemplo n.º 5
0
 /**
  * Reset user password
  */
 public function resetAction(Request $request, $token)
 {
     $event = new \SKCMS\FrontBundle\Event\PreRenderEvent($this->getRequest());
     $this->get('event_dispatcher')->dispatch(\SKCMS\FrontBundle\Event\SKCMSFrontEvents::PRE_RENDER, $event);
     return parent::resetAction($request, $token);
 }