Controller/Admin/UserController.php
public function clearPasswordRequestAction(Request $request)
    {
        $context = $this->loadContext($request);
        $resourceName = $this->config->getResourceName();
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
        $resource = $context->getResource($resourceName);

        $this->isGranted('EDIT', $resource);

        if ($resource->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {
            $resource
                ->setConfirmationToken(null)
                ->setPasswordRequestedAt(null)
            ;

            // TODO use ResourceManager
            $event = $this->getOperator()->update($resource);
            $event->toFlashes($this->getFlashBag());
            $this->addFlash('ekyna_user.user.alert.password_request_cleared', 'success');
        } else {
            $this->addFlash('ekyna_user.user.alert.no_password_request', 'warning');
        }

        return $this->redirect($this->generateResourcePath($resource));
    }
public function clearPasswordRequestAction(Request $request)
    {
        $context = $this->loadContext($request);
        $resourceName = $this->config->getResourceName();
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
        $resource = $context->getResource($resourceName);

        $this->isGranted('EDIT', $resource);

        if ($resource->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {
            $resource
                ->setConfirmationToken(null)
                ->setPasswordRequestedAt(null)
            ;

            // TODO use ResourceManager
            $event = $this->getOperator()->update($resource);
            $event->toFlashes($this->getFlashBag());
            $this->addFlash('ekyna_user.user.alert.password_request_cleared', 'success');
        } else {
            $this->addFlash('ekyna_user.user.alert.no_password_request', 'warning');
        }

        return $this->redirect($this->generateResourcePath($resource));
    }
public function clearPasswordRequestAction ( Request $ request ) { $ context = $ this -> loadContext ( $ request ) ; $ resourceName = $ this -> config -> getResourceName ( ) ; /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */ $ resource = $ context -> getResource ( $ resourceName ) ; $ this -> isGranted ( 'EDIT' , $ resource ) ; if ( $ resource -> isPasswordRequestNonExpired ( $ this -> container -> getParameter ( 'fos_user.resetting.token_ttl' ) ) ) { $ resource -> setConfirmationToken ( null ) -> setPasswordRequestedAt ( null ) ; // TODO use ResourceManager $ event = $ this -> getOperator ( ) -> update ( $ resource ) ; $ event -> toFlashes ( $ this -> getFlashBag ( ) ) ; $ this -> addFlash ( 'ekyna_user.user.alert.password_request_cleared' , 'success' ) ; } else { $ this -> addFlash ( 'ekyna_user.user.alert.no_password_request' , 'warning' ) ; } return $ this -> redirect ( $ this -> generateResourcePath ( $ resource ) ) ; }
Clears the user password request.

@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse
Clears the user password request .