Esempio n. 1
0
        public static IEnumerable <ZabHostAvailability> WebyData(IEnumerable <string> items)
        {
            if (items == null)
            {
                return(null);
            }

            return(webyData.Get()?
                   .Where(m => items.Contains(m.Host.itemIdResponseTime)));
        }
Esempio n. 2
0
 public static IEnumerable <ZabHost> Weby(string group)
 {
     if (!string.IsNullOrEmpty(group))
     {
         return(webyList.Get().Where(w => w.groups.Contains(group)));
     }
     else
     {
         return(webyList.Get());
     }
 }
Esempio n. 3
0
 protected void Application_BeginRequest(Object sender, EventArgs e)
 {
     if (BannedIPs.Get().Contains(HttpContext.Current.Request.UserHostAddress.ToLower()))
     {
         Response.Clear();
         Response.StatusCode = 403;
         Server.Transfer("~/banned.aspx");
     }
 }
Esempio n. 4
0
        // Used for searching
        public JsonResult Autocomplete(string q)
        {
            Devmasters.Cache.LocalMemory.AutoUpdatedLocalMemoryCache <Index <Autocomplete> > FullTextSearchCache =
                new Devmasters.Cache.LocalMemory.AutoUpdatedLocalMemoryCache <Index <Autocomplete> >(
                    TimeSpan.FromDays(1),
                    "FulltextSearchForAutocomplete_main",
                    o =>
            {
                return(BuildSearchIndex());
            });

            var searchCache = FullTextSearchCache.Get();

            var searchResult = searchCache.Search(q, 5, ac => ac.Priority);

            return(Json(searchResult.Select(r => r.Original), JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
 public static IEnumerable <ZabHostSslStatus> SslStatuses()
 {
     return(webySslData.Get());
 }