コード例 #1
0
ファイル: UserSubscriber.php プロジェクト: Yame-/mautic
 /**
  * Add a user entry to the audit log
  *
  * @param Events\UserEvent $event
  */
 public function onUserPostSave(Events\UserEvent $event)
 {
     $user = $event->getUser();
     if ($details = $event->getChanges()) {
         $log = array("bundle" => "user", "object" => "user", "objectId" => $user->getId(), "action" => $event->isNew() ? "create" : "update", "details" => $details, "ipAddress" => $this->factory->getIpAddressFromRequest());
         $this->factory->getModel('core.auditLog')->writeToLog($log);
     }
 }
コード例 #2
0
ファイル: UserSubscriber.php プロジェクト: dongilbert/mautic
 /**
  * Add a user entry to the audit log.
  *
  * @param Events\UserEvent $event
  */
 public function onUserPostSave(Events\UserEvent $event)
 {
     $user = $event->getUser();
     if ($details = $event->getChanges()) {
         $log = ['bundle' => 'user', 'object' => 'user', 'objectId' => $user->getId(), 'action' => $event->isNew() ? 'create' : 'update', 'details' => $details, 'ipAddress' => $this->ipLookupHelper->getIpAddressFromRequest()];
         $this->auditLogModel->writeToLog($log);
     }
 }