public AjaxResponse DoDeleteThread(int threadID, int categoryID)
        {
            var resp = new AjaxResponse
            {
                rs2 = threadID.ToString(),
                rs3 = categoryID.ToString()
            };

            var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, threadID);

            if (thread == null ||
                !ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null))
            {
                resp.rs1 = "0";
                resp.rs4 = Resources.ForumResource.ErrorAccessDenied;
                return(resp);
            }

            try
            {
                RemoveDataHelper.RemoveThread(thread);
                resp.rs1 = "1";
            }
            catch (Exception ex)
            {
                resp.rs1 = "0";
                resp.rs4 = ex.Message.HtmlEncode();
            }
            return(resp);
        }
Esempio n. 2
0
        public ForumThreadWrapper DeleteThread(int threadid)
        {
            var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, threadid);

            if (thread == null || !ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null))
            {
                throw new SecurityException(ForumResource.ErrorAccessDenied);
            }

            RemoveDataHelper.RemoveThread(thread);

            return(new ForumThreadWrapper(thread));
        }