示例#1
0
 /**
  * @param \Venne\Security\User $entity
  * @param \Doctrine\ORM\Event\LifecycleEventArgs $event
  */
 public function postPersist(User $entity, LifecycleEventArgs $event)
 {
     if (!self::$lock) {
         self::$lock = true;
         $this->notificationManager->notify(RegistrationEvent::getName(), $entity, 'registration', 'User has been registered.', $entity);
         self::$lock = false;
     }
 }
示例#2
0
 public function postPersist(Invitation $entity, LifecycleEventArgs $event)
 {
     if (!self::$lock) {
         self::$lock = true;
         $this->emailManager->send($entity->email, null, InvitationEvent::getName(), 'invitation', array('link' => $this->application->presenter->link('//:Admin:System:Login:default', array('registration' => $entity->registration->id, 'hash' => $entity->hash))));
         $this->notificationManager->notify(InvitationEvent::getName(), $entity, 'invitation', 'User has been invited.');
         self::$lock = false;
     }
 }
示例#3
0
 /**
  * @param \Venne\Security\User $user
  * @param string $link
  * @param \Venne\Security\User|null $sendBy
  */
 public function sendRecoveryUrl(User $user, $link, User $sendBy = null)
 {
     $sendBy = $sendBy !== null ? $sendBy : $user;
     $this->emailManager->send($user->getEmail(), null, PasswordRecoveryEvent::getName(), 'passwordRecovery', array('link' => $link));
     $this->notificationManager->notify(PasswordRecoveryEvent::getName(), $user, 'passwordRecovery', 'Password recovery URL has been sent.', $sendBy);
 }