newDataObject(); // Set implicit parts of the log entry $entry->setDateLogged(Core::getCurrentDate()); $entry->setIPAddress($request->getRemoteAddr()); if (Validation::isLoggedInAs()) { // If user is logged in as another user log with real userid $sessionManager = SessionManager::getManager(); $session = $sessionManager->getUserSession(); $userId = $session->getSessionVar('signedInAs'); if ($userId) $entry->setUserId($userId); } else { $user = $request->getUser(); if ($user) $entry->setUserId($user->getId()); } $entry->setSubmissionId($submission->getId()); // Set explicit parts of the log entry $entry->setEventType($eventType); $entry->setMessage($messageKey); $entry->setParams($params); $entry->setIsTranslated(0); // Legacy for old entries. All messages now use locale keys. // Insert the resulting object $submissionEventLogDao->insertObject($entry); return $entry; } } ?>