Beispiel #1
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            //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);
            }
        }
Beispiel #2
0
 public ActionResult EmailTaxiLater()
 {
     ReportMailer.ReportProduced().SendAsync();
     return(View());
 }