Ejemplo n.º 1
0
 /**
  * Delete user's messages when the user is deleted
  *
  * @param UserEvent $event
  */
 public function onUserDelete(UserEvent $event)
 {
     $user = $event->getUser();
     // Delete the chats for this user
     $repo = $this->factory->getEntityManager()->getRepository('MauticChatBundle:Chat');
     $repo->deleteUserMessages($user->deletedId);
 }
Ejemplo n.º 2
0
 /**
  * Add a user delete entry to the audit log
  *
  * @param Events\UserEvent $event
  */
 public function onUserDelete(Events\UserEvent $event)
 {
     $user = $event->getUser();
     $log = array("bundle" => "user", "object" => "user", "objectId" => $user->deletedId, "action" => "delete", "details" => array('name' => $user->getName()), "ipAddress" => $this->factory->getIpAddressFromRequest());
     $this->factory->getModel('core.auditLog')->writeToLog($log);
 }
Ejemplo n.º 3
0
 /**
  * Add a user delete entry to the audit log.
  *
  * @param Events\UserEvent $event
  */
 public function onUserDelete(Events\UserEvent $event)
 {
     $user = $event->getUser();
     $log = ['bundle' => 'user', 'object' => 'user', 'objectId' => $user->deletedId, 'action' => 'delete', 'details' => ['name' => $user->getName()], 'ipAddress' => $this->ipLookupHelper->getIpAddressFromRequest()];
     $this->auditLogModel->writeToLog($log);
 }
 public function iWarnYou(UserEvent $event)
 {
     trigger_error('I warn you, the skeleton subscriber should be rewritten.' . ' Besides to your violence to ' . $event->getUser()->getName(), E_USER_WARNING);
 }