public RoleService(IRoleRepository repository, IValidationService validator, IPluginEngine pluginEngine, OxiteContext context)
 {
     this.repository   = repository;
     this.validator    = validator;
     this.pluginEngine = pluginEngine;
     this.context      = context;
 }
 public SearchResultService(ISearchResultRepository repository, IPluginEngine pluginEngine, IModulesLoaded modules, OxiteContext context)
 {
     this.repository = repository;
     this.pluginEngine = pluginEngine;
     this.cache = modules.GetModules<IOxiteCacheModule>().Reverse().First();
     this.context = context;
 }
 public PluginController(IPluginService pluginService, IPluginEngine pluginEngine, OxiteContext context)
 {
     this.pluginService = pluginService;
     this.pluginEngine  = pluginEngine;
     this.context       = context;
     ValidateRequest    = false;
 }
 public RedirectionController(IEventService eventService, IScheduleItemService scheduleItemService, OxiteContext context)
 {
     this.eventService        = eventService;
     this.scheduleItemService = scheduleItemService;
     this.oxiteContext        = context;
     ValidateRequest          = false;
 }
Exemple #5
0
 public FormsAuthenticationUserService(IUserRepository repository, IValidationService validator, IPluginEngine pluginEngine, OxiteContext context)
 {
     this.repository   = repository;
     this.validator    = validator;
     this.pluginEngine = pluginEngine;
     this.context      = context;
 }
 public UserController(IScheduleItemService scheduleItemService, IUserScheduleService userScheduleService, IUserService userService, OxiteContext context)
 {
     this.scheduleItemService = scheduleItemService;
     this.userScheduleService = userScheduleService;
     this.userService         = userService;
     this.context             = context;
 }
 public PostController(IPostService postService, IBlogsCommentService commentService, OxiteContext context)
 {
     this.postService    = postService;
     this.commentService = commentService;
     this.context        = context;
     ValidateRequest     = false;
 }
Exemple #8
0
 public BlogService(IBlogRepository repository, IValidationService validator, IPluginEngine pluginEngine, IModulesLoaded modules, OxiteContext context)
 {
     this.repository   = repository;
     this.validator    = validator;
     this.pluginEngine = pluginEngine;
     this.cache        = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.context      = context;
 }
Exemple #9
0
        public static Post ProcessDisplayOfPost(this IPluginEngine pluginEngine, OxiteContext context, Func <Post> getPost)
        {
            PostForProcessing post = new PostForProcessing(getPost());

            pluginEngine.ExecuteAll("ProcessDisplayOfPost", new { context, post });

            return(post.ToPost());
        }
Exemple #10
0
 public CommentController(IPostService postService, IBlogsCommentService commentService, ITagService tagService, IBlogService blogService, OxiteContext context)
 {
     this.postService    = postService;
     this.commentService = commentService;
     this.tagService     = tagService;
     this.blogService    = blogService;
     this.context        = context;
 }
 public ScheduleItemService(IScheduleItemRepository repository, ITagService tagService, ICommentService commentService, IModulesLoaded modules, OxiteContext context)
 {
     this.repository     = repository;
     this.tagService     = tagService;
     this.commentService = commentService;
     cache        = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.context = context;
 }
 public MetaWeblogController(IBlogService blogService, IPostService postService, ITagService tagService, IUserService userService, IRegularExpressions expressions, OxiteContext context)
 {
     this.blogService = blogService;
     this.postService = postService;
     this.tagService  = tagService;
     this.userService = userService;
     this.expressions = expressions;
     this.context     = context;
 }
Exemple #13
0
 public ScheduleItemController(IEventService eventService, IScheduleItemService scheduleItemService, ITagService tagService, IConferencesCommentService commentService, OxiteContext context)
 {
     this.eventService        = eventService;
     this.scheduleItemService = scheduleItemService;
     this.tagService          = tagService;
     this.commentService      = commentService;
     this.context             = context;
     ValidateRequest          = false;
 }
Exemple #14
0
 public BlogMLController(ISiteService siteService, ILanguageService languageService, IBlogService blogService, IPostService postService, IBlogsCommentService commentService, OxiteContext context)
 {
     this.siteService     = siteService;
     this.languageService = languageService;
     this.blogService     = blogService;
     this.postService     = postService;
     this.commentService  = commentService;
     this.context         = context;
 }
 public PluginService(IPluginRepository repository, IValidationService validator, IPluginEngine pluginEngine, IModulesLoaded modules, PluginTemplateRegistry pluginTemplateRegistry, PluginStyleRegistry pluginStyleRegistry, PluginScriptRegistry pluginScriptRegistry, OxiteContext context)
 {
     this.repository             = repository;
     this.validator              = validator;
     this.pluginEngine           = pluginEngine;
     this.cache                  = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.modules                = modules;
     this.pluginTemplateRegistry = pluginTemplateRegistry;
     this.pluginStyleRegistry    = pluginStyleRegistry;
     this.pluginScriptRegistry   = pluginScriptRegistry;
     this.context                = context;
 }
Exemple #16
0
 public PostService(IPostRepository repository, ITrackbackOutboundRepository trackbackOutboundRepository, UrlHelper urlHelper, IRegularExpressions expressions, IValidationService validator, IPluginEngine pluginEngine, ITagService tagService, ICommentService commentService, IModulesLoaded modules, OxiteContext context)
 {
     this.repository = repository;
     this.trackbackOutboundRepository = trackbackOutboundRepository;
     this.urlHelper      = urlHelper;
     this.expressions    = expressions;
     this.validator      = validator;
     this.pluginEngine   = pluginEngine;
     this.tagService     = tagService;
     this.commentService = commentService;
     this.cache          = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.context        = context;
 }
 public BlogsCommentService(ICommentRepository commentRepository, IBlogsCommentRepository blogsCommentRepository, IPostRepository postRepository, ILanguageRepository languageRepository, ILocalizationRepository localizationRepository, IMessageOutboundRepository messageOutboundRepository, UrlHelper urlHelper, IValidationService validator, IPluginEngine pluginEngine, IModulesLoaded modules, OxiteContext context)
 {
     this.commentRepository         = commentRepository;
     this.blogsCommentRepository    = blogsCommentRepository;
     this.postRepository            = postRepository;
     this.languageRepository        = languageRepository;
     this.localizationRepository    = localizationRepository;
     this.messageOutboundRepository = messageOutboundRepository;
     this.urlHelper    = urlHelper;
     this.validator    = validator;
     this.pluginEngine = pluginEngine;
     this.cache        = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.context      = context;
 }
 public ConferencesCommentService(IConferencesCommentRepository conferencesCommentRepository, ICommentRepository commentRepository, IScheduleItemRepository scheduleItemRepository, IMessageOutboundRepository messageOutboundRepository, ILanguageRepository languageRepository, ILocalizationRepository localizationRepository, AbsolutePathHelper absolutePathHelper, IValidationService validator, IPluginEngine pluginEngine, IModulesLoaded modules, OxiteContext context)
 {
     this.conferencesCommentRepository = conferencesCommentRepository;
     this.commentRepository            = commentRepository;
     this.scheduleItemRepository       = scheduleItemRepository;
     this.messageOutboundRepository    = messageOutboundRepository;
     this.languageRepository           = languageRepository;
     this.localizationRepository       = localizationRepository;
     this.absolutePathHelper           = absolutePathHelper;
     this.validator    = validator;
     this.pluginEngine = pluginEngine;
     this.cache        = modules.GetModules <IOxiteCacheModule>().Reverse().First();
     this.context      = context;
 }
        public void MarkAsSpam(OxiteContext context, FormCollection form)
        {
            SpamCandidate spamCandidate = new SpamCandidate
            {
                blog                 = new Uri(context.Site.Host, context.HttpContext.Request.ApplicationPath),
                comment_author       = form["commentCreatorName"],
                comment_author_email = form["commentCreatorEmail"],
                comment_author_url   = form["commentCreatorUrl"],
                comment_content      = form["commentBody"],
                comment_type         = "comment",
                permalink            = !string.IsNullOrEmpty(form["permalinkUri"]) ? new Uri(form["permalinkUri"]) : null,
                referrer             = !string.IsNullOrEmpty(form["commentReferrerUri"]) ? new Uri(form["commentReferrerUri"]) : null,
                user_agent           = form["commentCreatorUserAgent"],
                user_ip              = form["commentCreatorIP"]
            };

            context.GeneratePostRequest(GetApiMethodUri("submit-spam"), Version, spamCandidate.ToQueryString()).GetResponse();
        }
        public void MarkAsSpam(OxiteContext context, FormCollection form)
        {
            SpamCandidate spamCandidate = new SpamCandidate
            {
                blog                 = null,
                comment_author       = form["commentCreatorName"],
                comment_author_email = form["commentCreatorEmail"],
                comment_author_url   = form["commentCreatorUrl"],
                comment_content      = form["commentBody"],
                comment_type         = "comment",
                permalink            = null,
                referrer             = null,
                user_agent           = form["commentCreatorUserAgent"],
                user_ip              = form["commentCreatorIP"]
            };

            context.GeneratePostRequest(GetApiMethodUri("submit-spam"), Version, spamCandidate.ToQueryString()).GetResponse();
        }
        public static HttpWebRequest GeneratePostRequest(this OxiteContext oxiteContext, Uri uri, string userAgent, string payload)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);

            webRequest.Method      = "POST";
            webRequest.UserAgent   = !string.IsNullOrEmpty(userAgent) ? userAgent : "Oxite"; //todo: (nheskew) need better UA string
            webRequest.ContentType = "application/x-www-form-urlencoded";

            byte[] payloadBytes = new ASCIIEncoding().GetBytes(payload);
            webRequest.ContentLength = payloadBytes.Length;

            StreamWriter streamWriter = new StreamWriter(webRequest.GetRequestStream());

            streamWriter.Write(payload);
            streamWriter.Flush();
            streamWriter.Close();

            return(webRequest);
        }
        public bool IsCommentSpam(OxiteContext context, CommentIn comment)
        {
            if (context.User.IsAuthenticated)
            {
                return(false);
            }

            SpamCandidate spamCandidate = new SpamCandidate
            {
                blog                 = null,
                comment_author       = comment.CreatorName,
                comment_author_email = comment.CreatorEmail,
                comment_author_url   = comment.CreatorUrl,
                comment_content      = comment.Body,
                comment_type         = "comment",
                permalink            = null,
                referrer             = context.HttpContext.Request.UrlReferrer,
                user_agent           = context.HttpContext.Request.UserAgent,
                user_ip              = context.HttpContext.Request.UserHostAddress
            };

            HttpWebRequest validationRequest = context.GeneratePostRequest(
                GetApiMethodUri("comment-check"),
                Version,
                spamCandidate.ToQueryString()
                );

            try
            {
                HttpWebResponse validationResponse = validationRequest.GetResponse() as HttpWebResponse;
                string          responseCode       = new StreamReader(validationResponse.GetResponseStream()).ReadToEnd();
                return(bool.Parse(responseCode));
            }
            catch
            {
                return(false);
            }
        }
 public ConferenceSkinResolver(OxiteContext context)
 {
     this.context = context;
 }
 public AntiForgeryAuthorizationFilter(OxiteContext context)
 {
     this.context = context;
 }
 /// <summary>
 /// Initializes a new instance of the ViewEnginesResultFilter class.
 /// </summary>
 /// <param name="skinResolvers"></param>
 /// <param name="context"></param>
 public ViewEnginesResultFilter(ISkinResolverRegistry skinResolvers, OxiteContext context)
 {
     this.skinResolvers = skinResolvers;
     this.context       = context;
 }
 public SqlServerSearchResultRepository(OxiteSearchDataContext context, OxiteContext oxiteContext)
 {
     this.context = context;
     siteID       = oxiteContext.Site.ID;
 }
        public static RouteData GetPostRouteDataFromUri(this UrlHelper urlHelper, Uri permalink, OxiteContext context)
        {
            if (permalink == null)
            {
                throw new ArgumentNullException();
            }

            if (!permalink.ToString().StartsWith(context.Site.Host.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                return(null);
            }

            return(context.Routes["Post"].GetRouteData(new DummyHttpContext(permalink, context.Site.Host)));
        }
Exemple #28
0
 public SiteValidator(ILocalizationService localizationService, IRegularExpressions expressions, OxiteContext context)
     : base(localizationService, expressions, context)
 {
 }
Exemple #29
0
 public ReportsController(IScheduleItemService scheduleItemService, OxiteContext context)
 {
     _scheduleItemService = scheduleItemService;
     _context             = context;
 }
 public SqlServerPageRepository(OxiteCMSDataContext context, OxiteContext oxiteContext)
 {
     this.context = context;
     siteID       = oxiteContext.Site.ID;
 }