Esempio n. 1
0
 public function handleDisconnect($service)
 {
     $user = $this->extendedUser->getUser();
     foreach ($user->getLoginProviders() as $key => $item) {
         if ($item->getType() === $service) {
             $user->getLoginProviders()->remove($key);
             break;
         }
     }
     $this->userRepository->save($user);
     $this->redirect('this', array('provider' => NULL));
 }
Esempio n. 2
0
 public function resetFormSuccess(Form $form)
 {
     /** @var UserEntity $user */
     $user = $this->userRepository->findOneBy(array('email' => $form['email']->value));
     if (!$user) {
         $this->flashMessage($this->translator->translate('User with email %email% does not exist.', NULL, array('email' => $form['email']->value)), 'warning');
         return;
     }
     $this->sendEmail($user, $user->resetPassword());
     $this->userRepository->save($user);
     $this->flashMessage($this->translator->translate('New password has been sended'), 'success');
     $this->redirect('this', array('reset' => NULL));
 }