public ActionResult RemoveInappropriate_POST(RemoveInappropriateFlagViewModel model) { if (!_orchardServices.Authorizer.Authorize(Permissions.ModerateInappropriatePosts, T("You do not have the proper permissions to administer inappropriate posts"))) return new HttpUnauthorizedResult(); //update the report with any new notes and new status var report = _reportPostService.GetReportsForPost( model.Report.PostId).FirstOrDefault(); if (report == null) { _orchardServices.Notifier.Add(NotifyType.Error, T("The report associated with this post could not be found. ")); } else { report.Note = model.Report.Note; report.IsResolved = model.Report.IsResolved; } //update the post as being appropriate var post = _postService.Get(model.Report.PostId, VersionOptions.Published); if (post != null) { if (post.IsParentThread()) { post.ThreadPart.IsInappropriate = false; } post.IsInappropriate = false; _countersService.UpdateThreadPartAndForumPartCounters(post); } else { _orchardServices.Notifier.Add(NotifyType.Error, T("The post could not be found.")); } return RedirectPermanent(model.ReturnUrl); }
public ActionResult MarkInappropriate_GET(int contentId) { if (!_orchardServices.Authorizer.Authorize(Permissions.ModerateInappropriatePosts, T("You do not have the proper permissions to administer inappropriate posts"))) return new HttpUnauthorizedResult(); var contentItem = _orchardServices.ContentManager.Get(contentId); ReportedPostRecord report = _reportPostService.GetReportsForPost(contentId).FirstOrDefault(); var model = new RemoveInappropriateFlagViewModel(); //if no pre-existing report exists make one if (report == null) { //don't know who the poster is at this point so set it after below report = new ReportedPostRecord { IsResolved = true, PostId = contentId, }; } model.Report = report; model.ReturnUrl = Request.UrlReferrer.AbsoluteUri; return View(model); ; }
public ActionResult RemoveInappropriate_GET(int contentId) { if (!_orchardServices.Authorizer.Authorize(Permissions.ModerateInappropriatePosts, T("You do not have the proper permissions to administer inappropriate posts"))) return new HttpUnauthorizedResult(); var report = _reportPostService.GetReportsForPost(contentId).FirstOrDefault(); var model = new RemoveInappropriateFlagViewModel(); if (report != null) { model.Report = report; model.ReturnUrl = Request.UrlReferrer.AbsoluteUri; } model.ReturnUrl = Request.UrlReferrer.AbsoluteUri; return View(model); ; }