Summary description for XSSUpstreamer.
Example #1
0
        bool IMovableType.mt_setPostCategories(string postid, string username, string password, newtelligence.DasBlog.Web.Services.MovableType.Category[] categories)
        {
            if (!siteConfig.EnableBloggerApi)
            {
                throw new ServiceDisabledException();
            }
            UserToken token = SiteSecurity.Login(username, password);

            if (token == null)
            {
                throw new System.Security.SecurityException();
            }
            Entry entry = dataService.GetEntryForEdit(postid);

            if (entry != null)
            {
                string cats = "";
                foreach (newtelligence.DasBlog.Web.Services.MovableType.Category mcat in categories)
                {
                    if (cats.Length > 0)
                    {
                        cats += ";";
                    }
                    cats += mcat.categoryId;
                }
                entry.Categories = cats;
                dataService.SaveEntry(entry);
                // give the XSS upstreamer a hint that things have changed
                XSSUpstreamer.TriggerUpstreaming();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            log4net.Config.XmlConfigurator.Configure();
            //We clear out the Cache on App Restart...
            CacheFactory.GetCache().Clear();

            ILoggingDataService loggingService = null;

            loggingService = LoggingDataServiceFactory.GetService(SiteConfig.GetLogPathFromCurrentContext());
            loggingService.AddEvent(new EventDataItem(EventCodes.ApplicationStartup, "", ""));

            SiteConfig siteConfig = SiteConfig.GetSiteConfig(SiteConfig.GetConfigFilePathFromCurrentContext());

            //if (siteConfig.EnableReportMailer)
            {
                reportMailer = new ReportMailer(
                    SiteConfig.GetConfigFilePathFromCurrentContext(),
                    SiteConfig.GetContentPathFromCurrentContext(),
                    SiteConfig.GetLogPathFromCurrentContext()
                    );

                reportMailerThread = new Thread(new ThreadStart(reportMailer.Run));
                reportMailerThread.Name = "ReportMailer";
                reportMailerThread.IsBackground = true;
                reportMailerThread.Start();

            }

            if (siteConfig.EnablePop3)
            {
                mailToWeblog = new MailToWeblog(
                    SiteConfig.GetConfigFilePathFromCurrentContext(),
                    SiteConfig.GetContentPathFromCurrentContext(),
                    SiteConfig.GetBinariesPathFromCurrentContext(),
                    SiteConfig.GetLogPathFromCurrentContext(),
                    new Uri(new Uri(SiteConfig.GetSiteConfig().Root), SiteConfig.GetSiteConfig().BinariesDirRelative)
                    );

                mailToWeblogThread = new Thread(new ThreadStart(mailToWeblog.Run));
                mailToWeblogThread.Name = "MailToWeblog";
                mailToWeblogThread.IsBackground = true;
                mailToWeblogThread.Start();
            }

            if (siteConfig.EnableXSSUpstream)
            {
                xssUpstreamer = new XSSUpstreamer(
                    SiteConfig.GetConfigFilePathFromCurrentContext(),
                    SiteConfig.GetContentPathFromCurrentContext(),
                    SiteConfig.GetLogPathFromCurrentContext()
                    );

                xssUpstreamerThread = new Thread(new ThreadStart(xssUpstreamer.Run));
                xssUpstreamerThread.Name = "XSSUpstreamer";
                xssUpstreamerThread.IsBackground = true;
                xssUpstreamerThread.Start();
            }

            /*
            if (siteConfig.EnableMovableTypeBlackList)
            {
                ReferralBlackListFactory.AddBlacklist(new MovableTypeBlacklist(), Path.Combine(SiteConfig.GetConfigPathFromCurrentContext(), "blacklist.txt"));
            }
            */

            if (siteConfig.EnableReferralUrlBlackList && siteConfig.ReferralUrlBlackList.Length != 0)
            {
                ReferralBlackListFactory.AddBlacklist(new ReferralUrlBlacklist(), siteConfig.ReferralUrlBlackList);
            }
        }