Beispiel #1
0
        public void AfterInitialize(IEngine engine)
        {
            HttpContext context = HttpContext.Current;

            if (context != null)
            {
                string userIP = context.Request.UserHostAddress;

                if (BlockedCountries.IsIpBlocked(userIP))
                {
                    throw new EPluginStopRequest((int)HttpStatusCode.Forbidden,
                                                 "Sorry, the administrator has blocked your country access.");
                }
            }
        }
Beispiel #2
0
 public BlockerPluginHost()
 {
     BlockedCountries.Initialize();
 }