/// <summary> /// Clears event log for current site. Called when the "Clear event log" button is pressed. /// Expects the CreateAbuseReport method to be run first. /// </summary> private bool ClearLog() { // Clear event log for current site EventLogProvider.ClearEventLog(MembershipContext.AuthenticatedUser.UserID, MembershipContext.AuthenticatedUser.UserName, RequestContext.UserHostAddress, SiteContext.CurrentSiteID); return(true); }
/// <summary> /// Clears event log for current site. Called when the "Clear event log" button is pressed. /// Expects the CreateAbuseReport method to be run first. /// </summary> private bool ClearLog() { // Create new instance of event log provider EventLogProvider eventLog = new EventLogProvider(); // Clear event log for current site eventLog.ClearEventLog(CMSContext.CurrentUser.UserID, CMSContext.CurrentUser.UserName, HTTPHelper.UserHostAddress, CMSContext.CurrentSiteID); return(true); }
/// <summary> /// Clears event log for current site. Called when the "Clear event log" button is pressed. /// Expects the CreateAbuseReport method to be run first. /// </summary> private bool ClearLog() { // Create new instance of event log provider EventLogProvider eventLog = new EventLogProvider(); // Clear event log for current site eventLog.ClearEventLog(CMSContext.CurrentUser.UserID, CMSContext.CurrentUser.UserName, HTTPHelper.UserHostAddress, CMSContext.CurrentSiteID); return true; }
/// <summary> /// Deletes event logs from DB. /// </summary> protected void ClearLogButton_Click(object sender, EventArgs e) { if (!CMSContext.CurrentUser.IsAuthorizedPerResource("CMS.EventLog", "ClearLog")) { RedirectToAccessDenied("CMS.EventLog", "ClearLog"); } UserInfo ui = CMSContext.CurrentUser; // Deletes event logs of specific site from DB eventProvider.ClearEventLog(ui.UserID, ui.UserName, HTTPHelper.UserHostAddress, siteID); eventLog.ReloadData(); }
/// <summary> /// Handles clear button action. /// </summary> protected void HeaderActions_ActionPerformed(object sender, CommandEventArgs e) { if (e.CommandName.Equals("clear", StringComparison.InvariantCultureIgnoreCase)) { if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("CMS.EventLog", "ClearLog")) { RedirectToAccessDenied("CMS.EventLog", "ClearLog"); } UserInfo ui = MembershipContext.AuthenticatedUser; // Deletes event logs of specific site from DB EventLogProvider.ClearEventLog(ui.UserID, ui.UserName, RequestContext.UserHostAddress, siteID); eventLog.ReloadData(); } }