public function authenticate(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null) { if (!$event->getUser()->isEnabled()) { return; } $config = new Config($event->getUser()); $config->setTheme($this->theme); $config->setItemsPerPage($this->itemsOnPage); $config->setRssLimit($this->rssLimit); $config->setLanguage($this->language); $this->em->persist($config); $this->em->flush(); }
public function authenticate(FilterUserResponseEvent $event) { if (!$event->getUser()->isEnabled()) { return; } try { $this->loginManager->loginUser($this->firewallName, $event->getUser(), $event->getResponse()); $event->getDispatcher()->dispatch(FOSUserEvents::SECURITY_IMPLICIT_LOGIN, new UserEvent($event->getUser(), $event->getRequest())); } catch (AccountStatusException $ex) { // We simply do not authenticate users which do not pass the user // checker (not enabled, expired, etc.). } }
public function fosProfileEditCompleted(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null) { $em = $this->em; if (!$event->getUser()->isEnabled()) { return; } $user = $event->getUser(); if ($user->getAthlete() == null) { $athlete = new Athlete(); $athlete->setName($user->getUsername()); $user->setAthlete($athlete); $em->persist($athlete); $em->flush(); } }
/** * @param FilterUserResponseEvent $event * @param array $default * @return array */ public function resolve($event, $default = array()) { if (!$event instanceof FilterUserResponseEvent) { return $default; } return $this->getEventDetailsArray("Password Changed", "Password of user '%s' Changed Successfully", $event->getUser()->getUsername()); }
function it_should_not_email_disabled_users(FilterUserResponseEvent $event, UserInterface $user, $mailer) { $user->isEnabled()->willReturn(false); $event->getUser()->willReturn($user); $mailer->sendCustomerWelcome($user)->shouldNotBeCalled(); $this->handleEvent($event); }
/** * @param FilterUserResponseEvent $event * @return array */ public function resolve($event) { if ($event instanceof FilterUserResponseEvent) { return $this->getEventDetailsArray($event->getUser()->getUsername()); } return null; }
public function resetCompleted(FilterUserResponseEvent $event) { /** @var User $user */ $user = $event->getUser(); $user->setCredentialsExpired(false); $this->manager->updateUser($user); }
/** * @param FilterUserResponseEvent $event */ public function onRegistrationComplete(FilterUserResponseEvent $event) { $user = $event->getUser(); $user->setMcUuid($this->minecraft->fetchUUID($user->getUsername())); $this->em->flush(); return; }
public function createAPlayer(FilterUserResponseEvent $event) { $user = $event->getUser(); $player = new Player(); //$this->em->persist($player); $user->setPlayer($player); $this->em->flush(); }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $user->addRole("ROLE_USER"); $request = $event->getRequest(); $this->em->persist($user); $this->em->flush(); return $event; }
public function onUserAccountDisabled(FilterUserResponseEvent $event) { $user = $event->getUser(); if ($user instanceof User) { $audit = AuditLog::make($user, 'account-deleted', $event->getRequest()->getClientIp()); $this->em->persist($audit); $this->em->flush(); } }
/** * Event automatically fired when user is registered * * @param FilterUserResponseEvent $event */ public function onUserRegistered(FilterUserResponseEvent $event) { /** @var User $user */ $user = $event->getUser(); $name = 'Unasigned actions'; $task = new Task($name, $user); $task->setDefault(true); $this->taskRepository->save($task); }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $tenantName = $this->_form->get('tenantName')->getData(); $tenantSubdomain = $this->_form->get('tenantSubdomain')->getData(); $tenant = $this->registrationManager->createTenant($user, $tenantName, $tenantSubdomain); // this referenced redirect response will be used $this->redirectResponse->setTargetUrl($this->tenantAwareRouter->generateUrl($tenant)); unset($this->_form); }
public function onUserCreation(FilterUserResponseEvent $event) { $user = $event->getUser(); // Create home project $home = new Project(); $this->projectManager->saveProject($home); $this->projectManager->setHome($home, $user); // set project as current project in session $this->session->set('projectid', $home->getId()); }
public function onChangePasswordCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $passwordHistory = new PasswordHistory(); $passwordHistory->setUser($user); $passwordHistory->setPassword($user->getPassword()); $passwordHistory->setSalt($user->getSalt()); $this->em->persist($passwordHistory); $this->em->flush(); return $event; }
/** * @param FilterUserResponseEvent $event * * @throws UnexpectedTypeException */ public function handleEvent(FilterUserResponseEvent $event) { $user = $event->getUser(); if (!$user instanceof UserInterface) { throw new UnexpectedTypeException($user, 'Sylius\\Component\\Core\\Model\\UserInterface'); } if (!$user->isEnabled()) { return; } $this->mailer->sendCustomerWelcome($user); }
/** * @param FilterUserResponseEvent $event */ public function onRegistrationCompleted(FilterUserResponseEvent $event) { $getMailEvent = $this->ojsMailer->getEventByName(FOSUserEvents::REGISTRATION_COMPLETED); if (!$getMailEvent) { return; } /** @var User $user */ $user = $event->getUser(); $transformParams = ['user.username' => $user->getUsername(), 'user.fullName' => $user->getFullName(), 'user.mail' => $user->getEmail()]; $template = $this->ojsMailer->transformTemplate($getMailEvent->getTemplate(), $transformParams); $this->ojsMailer->sendToUser($user, $getMailEvent->getSubject(), $template); }
public function finishRegistration(FilterUserResponseEvent $event) { $token = $this->getToken($event->getRequest()); $invitation = $this->getInvitation($token); $player = $invitation->getPlayer(); /** @var User $user */ $user = $event->getUser(); $user->setPlayer($player); $player->setName($user->getUsername()); $this->entityManager->persist($user); $this->entityManager->flush(); // TODO delete invitation? keep it? }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $auth = new Authorization(); $auth->setPerson($user); $auth->setClient($this->notificationHandler->getLoginCidadaoClient()); $auth->setScope(explode(' ', $this->lcSupportedScopes)); $this->em->persist($auth); $this->em->flush(); $this->mailer->sendConfirmationEmailMessage($user); if (strlen($user->getPassword()) == 0) { $this->notificationsHelper->enforceEmptyPasswordNotification($user); } }
/** * Añade el Rol correspondiente según el tipo de usuario seleccionado en * el formulario de registro. * * @param FilterUserResponseEvent $event */ public function onAddDefaultRoleSuccess(FilterUserResponseEvent $event) { $em = $this->doctrine->getManager(); $user = $event->getUser(); /** @var $user \FOS\UserBundle\Model\UserInterface */ if ($user->getType()->getCode() == 'developer') { $user->addRole('ROLE_DEVELOPER'); } if ($user->getType()->getCode() == 'requisiter') { $user->addRole('ROLE_REQUISITER'); } $em->persist($user); $em->flush(); }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $user_email = $user->getEmail(); $em = $this->doctrine->getEntityManager(); $invitations = $this->doctrine->getRepository('EventBundle:EventMail')->findBy(['email' => $user_email]); if ($invitations != null) { foreach ($invitations as $invitation) { $event = $invitation->getEvent(); $event->addUser($user); $em->remove($invitation); } $em->flush(); } }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $auth = new Authorization(); $auth->setPerson($user); $auth->setClient($this->clientRepository->findOneBy(['uid' => $this->defaultClientUid])); $auth->setScope(explode(' ', $this->lcSupportedScopes)); $this->em->persist($auth); $this->em->flush(); $this->mailer->sendConfirmationEmailMessage($user); if (strlen($user->getPassword()) == 0) { // TODO: DEPRECATE NOTIFICATIONS // TODO: create an optional task offering users to set a password //$this->notificationsHelper->enforceEmptyPasswordNotification($user); } $this->registerRequestedScope->clearRequestedScope($event->getRequest()); }
public function onRegistrationComleted(FilterUserResponseEvent $event) { $this->affiliate->recordRegistration($event->getResponse(), $event->getUser()); }
public function onRegistrationSuccess(FilterUserResponseEvent $event) { $user = $event->getUser(); $user->addRole('ROLE_AUTHOR'); $this->um->updateUser($user); }
/** * @param FilterUserResponseEvent $event */ public function onPasswordResettingSuccess(FilterUserResponseEvent $event) { $user = $event->getUser(); $user->setPasswordChanged(true); $this->userManager->updateUser($user); }
/** * @param FilterUserResponseEvent $userResponseEvent */ public function onRegistrationCompleted(FilterUserResponseEvent $userResponseEvent) { $user = $userResponseEvent->getUser(); $this->sendMail($user, 'User Event : User Registration', 'User Event -> User Registration Completed -> ' . $user->getEmail()); }
public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $this->manager->setUserAgreed($user); }
public function onRegistrationConfirmed(FilterUserResponseEvent $event) { // $junior = $this->container->getParameter('junior'); //ligne faisant bugger la validation, skippé pour un remplacement. TODO : Regler ce problème. $message = \Swift_Message::newInstance()->setSubject('Incipio : Nouvel utilisateur ' . $event->getUser()->getUsername())->setFrom('*****@*****.**')->setTo('*****@*****.**')->setBody($this->templating->render('MgateUserBundle:Default:alert-email.html.twig', array('username' => $event->getUser()->getUsername(), 'email' => $event->getUser()->getEmail())), 'text/html'); $this->mailer->send($message); }
public function onChangePasswordCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $this->notificationHelper->clearEmptyPasswordNotification($user); }
/** * @DI\Observe("fos_user.registration.completed") */ public function addReferrerToUser(FilterUserResponseEvent $event) { $request = $event->getRequest(); // No cookie, no nookie if (!($referralId = $request->cookies->get(self::REFERRAL_COOKIE))) { return; } // Find the referrer $referrer = $this->em->getRepository('ForexCoreBundle:User')->findOneById($referralId); if (!$referrer) { return; } $user = $event->getUser(); $this->referralManager->addReferrerToUser($user, $referrer); $this->em->flush(); }