public void LogInFailed(string userNameOrEmail, string password) { var eventData = new Dictionary <string, object> { { "UserName", userNameOrEmail } }; _auditTrailManager.CreateRecord <UserAuditTrailEventProvider>(UserAuditTrailEventProvider.LogInFailed, _wca.GetContext().CurrentUser, properties: null, eventData: eventData, eventFilterKey: "user", eventFilterData: userNameOrEmail); }
public void ContentFieldAttached(ContentFieldAttachedContext context) { var eventData = new Dictionary <string, object> { { "ContentPartName", context.ContentPartName }, { "ContentFieldName", context.ContentFieldName }, { "ContentFieldTypeName", context.ContentFieldTypeName }, { "ContentFieldDisplayName", context.ContentFieldDisplayName } }; _auditTrailManager.CreateRecord <ContentPartAuditTrailEventProvider>(ContentPartAuditTrailEventProvider.FieldAdded, _wca.GetContext().CurrentUser, properties: null, eventData: eventData, eventFilterKey: "contentpart", eventFilterData: context.ContentPartName); }
private void EndUpdateEvent(UpdateContentContext context, AuditTrailSettingsPart part) { var newEventSettings = part.Retrieve <string>("Events"); if (newEventSettings == _oldEventSettings) { return; } _auditTrailManager.CreateRecord <AuditTrailSettingsEventProvider>( eventName: AuditTrailSettingsEventProvider.EventsChanged, eventData: new Dictionary <string, object> { { "OldSettings", _auditTrailManager.ToEventData(_oldEventSettings) }, { "NewSettings", _auditTrailManager.ToEventData(newEventSettings) } }, user: _wca.GetContext().CurrentUser); }
private void RecordAuditTrailEvent(string eventName, IContent content, ContentItemVersionRecord previousContentItemVersion = null, XElement diffGram = null, XElement previousVersionXml = null) { var blackList = new[] { "Site" }; if (blackList.Contains(content.ContentItem.ContentType)) { return; } var properties = new Dictionary <string, object> { { "Content", content } }; var metaData = _contentManager.GetItemMetadata(content); var eventData = new Dictionary <string, object> { { "ContentId", content.Id }, { "ContentIdentity", metaData.Identity.ToString() }, { "ContentType", content.ContentItem.ContentType }, { "VersionId", content.ContentItem.Version }, { "VersionNumber", content.ContentItem.VersionRecord != null ? content.ContentItem.VersionRecord.Number : 0 }, { "Published", content.ContentItem.VersionRecord != null && content.ContentItem.VersionRecord.Published }, { "Title", metaData.DisplayText } }; if (previousContentItemVersion != null) { eventData["PreviousVersionId"] = previousContentItemVersion.Id; eventData["PreviousVersionNumber"] = previousContentItemVersion.Number; } if (diffGram != null && previousVersionXml != null) { eventData["PreviousVersionXml"] = previousVersionXml.ToString(SaveOptions.DisableFormatting); eventData["DiffGram"] = diffGram.ToString(SaveOptions.DisableFormatting); } _auditTrailManager.CreateRecord <ContentAuditTrailEventProvider>( eventName, _wca.GetContext().CurrentUser, properties, eventData, eventFilterKey: "content", eventFilterData: content.Id.ToString(CultureInfo.InvariantCulture)); }
private void EndUpdateEvent(UpdateContentContext context, AuditTrailTrimmingSettingsPart part) { var newRetentionPeriod = part.RetentionPeriod; var newMinimumRunInterval = part.MinimumRunInterval; if (newRetentionPeriod == _oldRetentionPeriod && newMinimumRunInterval == _oldMinimumRunInterval) { return; } _auditTrailManager.CreateRecord <AuditTrailTrimmingSettingsEventProvider>( eventName: AuditTrailTrimmingSettingsEventProvider.TrimmingSettingsChanged, user: _wca.GetContext().CurrentUser, eventData: new Dictionary <string, object> { { "OldRetentionPeriod", _oldRetentionPeriod }, { "NewRetentionPeriod", newRetentionPeriod }, { "OldMinimumRunInterval", _oldMinimumRunInterval }, { "NewMinimumRunInterval", newMinimumRunInterval } }); }
private void RecordAuditTrailEvent(string eventName, string roleName, IDictionary <string, object> properties, IDictionary <string, object> eventData) { _auditTrailManager.CreateRecord <RoleAuditTrailEventProvider>(eventName, _wca.GetContext().CurrentUser, properties, eventData, eventFilterKey: "role", eventFilterData: roleName); }
private void RecordContentTypeAuditTrail(string eventName, IDictionary <string, object> eventData, string contentTypeName) { _auditTrailManager.CreateRecord <ContentTypeAuditTrailEventProvider>(eventName, _wca.GetContext().CurrentUser, properties: null, eventData: eventData, eventFilterKey: "contenttype", eventFilterData: contentTypeName); }