Exemplo n.º 1
0
        private void MarkAsSent(HttpContext context)
        {
            ModResult result = new ModResult();

            if (LoadAndValidateForumObjects())
            {
                thread.NotificationSent = true;
                thread.UpdatePost();

                result.Msg = "success";

                //System.Threading.Thread.Sleep(3000);

                //context.Response.Write("{\"Msg\":\"success\"}");
                //context.Response.Write("{\"Msg\":\"rejected\"}");
            }
            else
            {
                //context.Response.Write("{\"Msg\":\"rejected\"}");
                result.Msg = "rejected";
            }

            context.Response.ContentType = "application/json";
            JavaScriptSerializer s = new JavaScriptSerializer();

            context.Response.Write(s.Serialize(result));
        }
Exemplo n.º 2
0
        private void SendNotification(HttpContext context)
        {
            //log.Info("theadId = " + threadId);
            //log.Info("postId = " + postId);
            //log.Info("pageId = " + pageId);
            //log.Info("mid = " + moduleId);

            bool      notifyModeratorOnly = false;
            ModResult result = new ModResult();

            if (LoadAndValidateForumObjects())
            {
                thread.NotificationSent = true;
                thread.UpdatePost();

                ForumNotification.NotifySubscribers(
                    forum,
                    thread,
                    module,
                    postUser,
                    siteSettings,
                    config,
                    SiteUtils.GetNavigationSiteRoot(),
                    pageId,
                    pageNumber,
                    SiteUtils.GetDefaultCulture(),
                    ForumConfiguration.GetSmtpSettings(),
                    notifyModeratorOnly
                    );

                result.Msg = "success";
            }
            else
            {
                log.Info("Send forum notification request rejected due to invalid params");

                result.Msg = "rejected";
            }

            context.Response.ContentType = "application/json";
            JavaScriptSerializer s = new JavaScriptSerializer();

            context.Response.Write(s.Serialize(result));
        }
Exemplo n.º 3
0
        private void SendNotification(HttpContext context)
        {
            //log.Info("theadId = " + threadId);
            //log.Info("postId = " + postId);
            //log.Info("pageId = " + pageId);
            //log.Info("mid = " + moduleId);

            bool notifyModeratorOnly = false;
            ModResult result = new ModResult();

            if (LoadAndValidateForumObjects())
            {
                thread.NotificationSent = true;
                thread.UpdatePost();

                ForumNotification.NotifySubscribers(
                forum,
                thread,
                module,
                postUser,
                siteSettings,
                config,
                SiteUtils.GetNavigationSiteRoot(),
                pageId,
                pageNumber,
                SiteUtils.GetDefaultCulture(),
                ForumConfiguration.GetSmtpSettings(),
                notifyModeratorOnly
                );

                result.Msg = "success";

            }
            else
            {
                log.Info("Send forum notification request rejected due to invalid params");

                result.Msg = "rejected";
            }

            context.Response.ContentType = "application/json";
            JavaScriptSerializer s = new JavaScriptSerializer();
            context.Response.Write(s.Serialize(result));
        }
Exemplo n.º 4
0
        private void MarkAsSent(HttpContext context)
        {
            ModResult result = new ModResult();

            if (LoadAndValidateForumObjects())
            {
                thread.NotificationSent = true;
                thread.UpdatePost();

                result.Msg = "success";

                //System.Threading.Thread.Sleep(3000);

                //context.Response.Write("{\"Msg\":\"success\"}");
                //context.Response.Write("{\"Msg\":\"rejected\"}");
            }
            else
            {
                //context.Response.Write("{\"Msg\":\"rejected\"}");
                result.Msg = "rejected";
            }

            context.Response.ContentType = "application/json";
            JavaScriptSerializer s = new JavaScriptSerializer();
            context.Response.Write(s.Serialize(result));
        }