public ActionResult ResolveReport_GET(int reportId) { if (!_orchardServices.Authorizer.Authorize(Permissions.ModerateInappropriatePosts, T("You do not have the proper permissions to administer inappropriate posts"))) return new HttpUnauthorizedResult(); var report = _reportPostService.GetPostReport(reportId); var model = new ResolvePostReportViewModel(); if (report == null) { model.Report = new ReportedPostRecord(); } else { model.Report = report; } model.ReturnUrl = Request.UrlReferrer.AbsoluteUri; return View(model); }
public ActionResult ResolveReport_Post(ResolvePostReportViewModel model) { if (!_orchardServices.Authorizer.Authorize(Permissions.ModerateInappropriatePosts, T("You do not have the proper permissions to administer inappropriate posts"))) return new HttpUnauthorizedResult(); var report = _reportPostService.GetPostReport(model.Report.Id); report.Note = model.Report.Note; report.IsResolved = model.Report.IsResolved; if (report.IsResolved) { report.ResolvedByUserId = _orchardServices.WorkContext.CurrentUser.Id; report.ReportedDate = DateTime.UtcNow; } _reportPostService.UpdateReport(report); _orchardServices.Notifier.Add(NotifyType.Information, T("The report was successfully updated.")); return RedirectPermanent(model.ReturnUrl); }